Implement HlReadApicRegister() and HlWriteApicRegister() routines for basic APIC support
This commit is contained in:
parent
a3c28cee73
commit
1eecad21db
@ -13,6 +13,7 @@ list(APPEND XTOSKRNL_SOURCE
|
||||
${XTOSKRNL_SOURCE_DIR}/ar/${ARCH}/procsup.c
|
||||
${XTOSKRNL_SOURCE_DIR}/ar/${ARCH}/traps.c
|
||||
${XTOSKRNL_SOURCE_DIR}/ex/rundown.c
|
||||
${XTOSKRNL_SOURCE_DIR}/hl/apic.c
|
||||
${XTOSKRNL_SOURCE_DIR}/hl/cport.c
|
||||
${XTOSKRNL_SOURCE_DIR}/hl/efifb.c
|
||||
${XTOSKRNL_SOURCE_DIR}/hl/globals.c
|
||||
|
48
xtoskrnl/hl/apic.c
Normal file
48
xtoskrnl/hl/apic.c
Normal file
@ -0,0 +1,48 @@
|
||||
/**
|
||||
* PROJECT: ExectOS
|
||||
* COPYRIGHT: See COPYING.md in the top level directory
|
||||
* FILE: xtoskrnl/hl/apic.c
|
||||
* DESCRIPTION: Advanced Programmable Interrupt Controller (APIC) support
|
||||
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
|
||||
*/
|
||||
|
||||
#include <xtos.h>
|
||||
|
||||
|
||||
/**
|
||||
* Reads from the local APIC register.
|
||||
*
|
||||
* @param Register
|
||||
* Supplies the APIC register to read from.
|
||||
*
|
||||
* @return This routine returns the value read from the APIC register.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTFASTCALL
|
||||
ULONG
|
||||
HlReadApicRegister(IN APIC_REGISTER Register)
|
||||
{
|
||||
return RtlReadRegisterLong((PULONG)APIC_BASE + (Register << 4));
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes to the local APIC register.
|
||||
*
|
||||
* @param Register
|
||||
* Supplies the APIC register to write to.
|
||||
*
|
||||
* @param Value
|
||||
* Supplies the value to write to the APIC register.
|
||||
*
|
||||
* @return This routine does not return any value.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTFASTCALL
|
||||
VOID
|
||||
HlWriteApicRegister(IN APIC_REGISTER Register,
|
||||
IN ULONG Value)
|
||||
{
|
||||
RtlWriteRegisterLong((PULONG)APIC_BASE + (Register << 4), Value);
|
||||
}
|
@ -51,4 +51,13 @@ XTAPI
|
||||
XTSTATUS
|
||||
HlInitializeDisplay(VOID);
|
||||
|
||||
XTFASTCALL
|
||||
ULONG
|
||||
HlReadApicRegister(IN APIC_REGISTER Register);
|
||||
|
||||
XTFASTCALL
|
||||
VOID
|
||||
HlWriteApicRegister(IN APIC_REGISTER Register,
|
||||
IN ULONG Value);
|
||||
|
||||
#endif /* __XTOSKRNL_HL_H */
|
||||
|
Loading…
Reference in New Issue
Block a user