Implement HlClearApicErrors() and HlSendEoi() routines, change HlDisableLegacyPic() calling convention
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 45s
Builds / ExectOS (i686) (push) Successful in 20s

This commit is contained in:
Rafal Kupiec 2024-02-09 15:11:14 +01:00
parent 73cd4bd4f2
commit 77bc796769
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
5 changed files with 54 additions and 8 deletions

View File

@ -10,6 +10,21 @@
#include <xtos.h>
/**
* Clears all errors on the APIC.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTAPI
VOID
HlClearApicErrors()
{
/* Clear APIC errors */
HlWriteApicRegister(APIC_ESR, 0);
}
/**
* Disables the legacy 8259 Programmable Interrupt Controller (PIC).
*
@ -17,9 +32,9 @@
*
* @since XT 1.0
*/
XTCDECL
XTAPI
VOID
HlDisablePic(VOID)
HlDisableLegacyPic()
{
HlIoPortOutByte(PIC1_DATA_PORT, 0xFF);
HlIoPortOutByte(PIC2_DATA_PORT, 0xFF);
@ -51,6 +66,21 @@ HlReadApicRegister(IN APIC_REGISTER Register)
}
}
/**
* Signals to the APIC that handling an interrupt is complete.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTAPI
VOID
HlSendEoi()
{
/* Send APIC EOI */
HlWriteApicRegister(APIC_EOI, 0);
}
/**
* Writes to the APIC register.
*

View File

@ -13,14 +13,22 @@
/* HAL library routines forward references */
XTCDECL
XTAPI
VOID
HlDisablePic(VOID);
HlClearApicErrors();
XTAPI
VOID
HlDisableLegacyPic();
XTFASTCALL
ULONG
HlReadApicRegister(IN APIC_REGISTER Register);
XTAPI
VOID
HlSendEoi();
XTFASTCALL
VOID
HlWriteApicRegister(IN APIC_REGISTER Register,

View File

@ -13,14 +13,22 @@
/* HAL library routines forward references */
XTCDECL
XTAPI
VOID
HlDisablePic(VOID);
HlClearApicErrors();
XTAPI
VOID
HlDisableLegacyPic();
XTFASTCALL
ULONG
HlReadApicRegister(IN APIC_REGISTER Register);
XTAPI
VOID
HlSendEoi();
XTFASTCALL
VOID
HlWriteApicRegister(IN APIC_REGISTER Register,

View File

@ -71,7 +71,7 @@ KepInitializeMachine(VOID)
HlIoPortOutByte(0x3F6, 0);
/* Disable the legacy PIC */
HlDisablePic();
HlDisableLegacyPic();
/* Initialize frame buffer */
HlInitializeFrameBuffer();

View File

@ -71,7 +71,7 @@ KepInitializeMachine(VOID)
HlIoPortOutByte(0x3F6, 0);
/* Disable the legacy PIC */
HlDisablePic();
HlDisableLegacyPic();
/* Initialize frame buffer */
HlInitializeFrameBuffer();