mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 16:10:29 +00:00
[HALX86/APIC] Use physical addressing in HalEnableSystemInterrupt
This commit is contained in:
parent
f1f01771b6
commit
faaac75546
1 changed files with 12 additions and 18 deletions
|
@ -675,7 +675,6 @@ HalEnableSystemInterrupt(
|
|||
IN KINTERRUPT_MODE InterruptMode)
|
||||
{
|
||||
IOAPIC_REDIRECTION_REGISTER ReDirReg;
|
||||
PKPRCB Prcb = KeGetCurrentPrcb();
|
||||
UCHAR Index;
|
||||
ASSERT(Irql <= HIGH_LEVEL);
|
||||
ASSERT((IrqlToTpr(Irql) & 0xF0) == (Vector & 0xF0));
|
||||
|
@ -693,26 +692,21 @@ HalEnableSystemInterrupt(
|
|||
/* Read the redirection entry */
|
||||
ReDirReg = ApicReadIORedirectionEntry(Index);
|
||||
|
||||
/* Check if the interrupt was unused */
|
||||
if (ReDirReg.Vector != Vector)
|
||||
/* Check if the interrupt is already enabled */
|
||||
if (ReDirReg.Mask == FALSE)
|
||||
{
|
||||
ReDirReg.Vector = Vector;
|
||||
ReDirReg.MessageType = APIC_MT_LowestPriority;
|
||||
ReDirReg.DestinationMode = APIC_DM_Logical;
|
||||
ReDirReg.Destination = 0;
|
||||
/* If the vector matches, there is nothing more to do,
|
||||
otherwise something is wrong. */
|
||||
return (ReDirReg.Vector == Vector);
|
||||
}
|
||||
|
||||
/* Check if the destination is logical */
|
||||
if (ReDirReg.DestinationMode == APIC_DM_Logical)
|
||||
{
|
||||
/* Set the bit for this cpu */
|
||||
ReDirReg.Destination |= ApicLogicalId(Prcb->Number);
|
||||
}
|
||||
|
||||
/* Set the trigger mode */
|
||||
ReDirReg.TriggerMode = 1 - InterruptMode;
|
||||
|
||||
/* Now unmask it */
|
||||
/* Set up the redirection entry */
|
||||
ReDirReg.Vector = Vector;
|
||||
ReDirReg.MessageType = APIC_MT_Fixed;
|
||||
ReDirReg.DestinationMode = APIC_DM_Physical;
|
||||
ReDirReg.Destination = KeGetCurrentPrcb()->InitialApicId;
|
||||
ReDirReg.TriggerMode = (InterruptMode == LevelSensitive) ?
|
||||
APIC_TGM_Level : APIC_TGM_Edge;
|
||||
ReDirReg.Mask = FALSE;
|
||||
|
||||
/* Write back the entry */
|
||||
|
|
Loading…
Reference in a new issue