Skip to content

Commit

Permalink
HACK [HAL] Schedule all interrupts on CPU 0
Browse files Browse the repository at this point in the history
Logical addressing is broken.
  • Loading branch information
tkreuzer authored and DarkFire01 committed Nov 29, 2023
1 parent 1a586c6 commit 3216a35
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions hal/halx86/apic/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ HalEnableSystemInterrupt(
IN KINTERRUPT_MODE InterruptMode)
{
IOAPIC_REDIRECTION_REGISTER ReDirReg;
PKPRCB Prcb = KeGetCurrentPrcb();
// PKPRCB Prcb = KeGetCurrentPrcb();
UCHAR Index;
ASSERT(Irql <= HIGH_LEVEL);
ASSERT((IrqlToTpr(Irql) & 0xF0) == (Vector & 0xF0));
Expand All @@ -739,6 +739,12 @@ HalEnableSystemInterrupt(
/* Read the redirection entry */
ReDirReg = ApicReadIORedirectionEntry(Index);

if (ReDirReg.Mask == FALSE)
{
/* Interrupt is already enabled */
return TRUE;
}

/* Check if the interrupt was unused */
if (ReDirReg.Vector != Vector)
{
Expand All @@ -752,7 +758,7 @@ HalEnableSystemInterrupt(
if (ReDirReg.DestinationMode == APIC_DM_Logical)
{
/* Set the bit for this cpu */
ReDirReg.Destination |= ApicLogicalId(Prcb->Number);
ReDirReg.Destination |= ApicLogicalId(0);
}

/* Set the trigger mode */
Expand Down

0 comments on commit 3216a35

Please sign in to comment.