From 5c7990051923441a35304c75a3ef964dc5c61052 Mon Sep 17 00:00:00 2001 From: Justin Miller Date: Sat, 26 Mar 2022 10:22:12 -0700 Subject: [PATCH] [HALX86] Add a way to print the ProcessorTable data on bootup --- hal/halx86/acpi/madt.c | 15 +++++++++++++++ hal/halx86/apic/halinit.c | 3 +++ hal/halx86/include/smp.h | 3 +++ hal/halx86/smp/mps/mps.c | 21 +++++++++++++++++++++ 4 files changed, 42 insertions(+) diff --git a/hal/halx86/acpi/madt.c b/hal/halx86/acpi/madt.c index 9d4cdd070f8..183eaefcb04 100644 --- a/hal/halx86/acpi/madt.c +++ b/hal/halx86/acpi/madt.c @@ -28,3 +28,18 @@ HalpParseApicTables( { UNIMPLEMENTED; } + +VOID +HalpPrintApicTables(VOID) +{ + UINT32 i; + + DPRINT1("HAL has detected a physical processor count of: %d\n", HalpApicInfoTable.ProcessorCount); + for (i = 0; i < HalpApicInfoTable.ProcessorCount; i++) + { + DPRINT1("Information about the following processor is for processors number: %d\n" + " The BSPCheck is set to: %X\n" + " The LapicID is set to: %X\n", + i, HalpProcessorIdentity[i].BSPCheck, HalpProcessorIdentity[i].LapicId); + } +} diff --git a/hal/halx86/apic/halinit.c b/hal/halx86/apic/halinit.c index 87c6a37854d..cb0c5af7b77 100644 --- a/hal/halx86/apic/halinit.c +++ b/hal/halx86/apic/halinit.c @@ -59,6 +59,9 @@ HalpInitPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock) CLOCK2_LEVEL, HalpClockInterrupt, Latched); +#if DBG + HalpPrintApicTables(); +#endif } VOID diff --git a/hal/halx86/include/smp.h b/hal/halx86/include/smp.h index 5eaccdbc285..cac946310f2 100644 --- a/hal/halx86/include/smp.h +++ b/hal/halx86/include/smp.h @@ -25,3 +25,6 @@ HalpParseApicTables( VOID HalpSetupProcessorsTable( _In_ UINT32 NTProcessorNumber); + +VOID +HalpPrintApicTables(VOID); diff --git a/hal/halx86/smp/mps/mps.c b/hal/halx86/smp/mps/mps.c index a03c80c4db8..a55a962f02d 100644 --- a/hal/halx86/smp/mps/mps.c +++ b/hal/halx86/smp/mps/mps.c @@ -12,6 +12,12 @@ #define NDEBUG #include +/* GLOBALS ********************************************************************/ + +PROCESSOR_IDENTITY HalpStaticProcessorIdentity[MAXIMUM_PROCESSORS] = {{0}}; +PPROCESSOR_IDENTITY HalpProcessorIdentity = NULL; +UINT32 PhysicalProcessorCount = 0; + /* FUNCTIONS ******************************************************************/ VOID @@ -20,3 +26,18 @@ HalpParseApicTables( { UNIMPLEMENTED; } + +VOID +HalpPrintApicTables(VOID) +{ + UINT32 i; + + DPRINT1("HAL has detected a physical processor count of: %d\n", PhysicalProcessorCount); + for (i = 0; i < PhysicalProcessorCount; i++) + { + DPRINT1("Information about the following processor is for processors number: %d\n" + " The BSPCheck is set to: %X\n" + " The LapicID is set to: %X\n", + i, HalpProcessorIdentity[i].BSPCheck, HalpProcessorIdentity[i].LapicId); + } +}