Skip to content

Commit

Permalink
madt 1659
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeGautherie committed Nov 26, 2023
1 parent 91d7f61 commit d496ffb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion hal/halx86/acpi/halacpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static ULONG HalpInvalidAcpiTable;
#if 0
static ULONG HalpPicVectorRedirect[] = {0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15};
#else // TODO: Is that correct?
ULONG HalpPicVectorRedirect[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
ULONG HalpPicVectorRedirect[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
#endif

/* This determines the HAL type */
Expand Down
18 changes: 12 additions & 6 deletions hal/halx86/acpi/madt.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ HALP_APIC_INFO_TABLE HalpApicInfoTable;
static PROCESSOR_IDENTITY HalpStaticProcessorIdentity[MAXIMUM_PROCESSORS];
PPROCESSOR_IDENTITY HalpProcessorIdentity = HalpStaticProcessorIdentity;

extern ULONG HalpPicVectorRedirect[16];

/* FUNCTIONS ******************************************************************/

// Note: HalpParseApicTables() is called early, so its DPRINT*() do nothing.
Expand Down Expand Up @@ -198,15 +200,15 @@ HalpParseApicTables(
IoApic->Id, IoApic->Address, IoApic->GlobalIrqBase);

// Ensure HalpApicInfoTable.IOAPICCount consistency.
if (HalpApicInfoTable[IoApic->Id].IoApicPA != NULL)
if (HalpApicInfoTable.IoApicPA[IoApic->Id] != 0)
{
DPRINT1("Id duplication: %p, %u\n", IoApic, IoApic->Id);
return;
}

// Note: Address and GlobalIrqBase are not validated in any way (yet).
HalpApicInfoTable[IoApic->Id].IoApicPA = IoApic->Address;
HalpApicInfoTable[IoApic->Id].IoApicIrqBase = IoApic->GlobalIrqBase;
HalpApicInfoTable.IoApicPA[IoApic->Id] = IoApic->Address;
HalpApicInfoTable.IoApicIrqBase[IoApic->Id] = IoApic->GlobalIrqBase;

HalpApicInfoTable.IOAPICCount++;

Expand Down Expand Up @@ -295,8 +297,12 @@ HalpPrintApicTables(VOID)
DPRINT1("Physical processor count: %lu\n", HalpApicInfoTable.ProcessorCount);
for (i = 0; i < HalpApicInfoTable.ProcessorCount; i++)
{
DPRINT1(" Processor %lu: ProcessorId %u, LapicId %u, BSPCheck %u\n",
i, HalpProcessorIdentity[i].ProcessorId, HalpProcessorIdentity[i].LapicId,
HalpProcessorIdentity[i].BSPCheck);
DPRINT1(" Processor %lu: ProcessorId %u, LapicId %u, ProcessorStarted %u, BSPCheck %u, ProcessorPrcb %p\n",
i,
HalpProcessorIdentity[i].ProcessorId,
HalpProcessorIdentity[i].LapicId,
HalpProcessorIdentity[i].ProcessorStarted,
HalpProcessorIdentity[i].BSPCheck,
HalpProcessorIdentity[i].ProcessorPrcb);
}
}
10 changes: 7 additions & 3 deletions hal/halx86/smp/mps/mps.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ HalpPrintApicTables(VOID)
DPRINT1("Physical processor count: %lu\n", PhysicalProcessorCount);
for (i = 0; i < PhysicalProcessorCount; i++)
{
DPRINT1(" Processor %lu: ProcessorId %u, LapicId %u, BSPCheck %u\n",
i, HalpProcessorIdentity[i].ProcessorId, HalpProcessorIdentity[i].LapicId,
HalpProcessorIdentity[i].BSPCheck);
DPRINT1(" Processor %lu: ProcessorId %u, LapicId %u, ProcessorStarted %u, BSPCheck %u, ProcessorPrcb %p\n",
i,
HalpProcessorIdentity[i].ProcessorId,
HalpProcessorIdentity[i].LapicId,
HalpProcessorIdentity[i].ProcessorStarted,
HalpProcessorIdentity[i].BSPCheck,
HalpProcessorIdentity[i].ProcessorPrcb);
}
}

0 comments on commit d496ffb

Please sign in to comment.