ReactOS 0.4.15-dev-5666-gc548b97
madt.c File Reference
#include <hal.h>
#include <acpi.h>
#include <smp.h>
#include <debug.h>
Include dependency graph for madt.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID HalpParseApicTables (_In_ PLOADER_PARAMETER_BLOCK LoaderBlock)
 
VOID HalpPrintApicTables (VOID)
 

Variables

PROCESSOR_IDENTITY HalpStaticProcessorIdentity [MAXIMUM_PROCESSORS] = {{0}}
 
PPROCESSOR_IDENTITY HalpProcessorIdentity = NULL
 
HALP_APIC_INFO_TABLE HalpApicInfoTable
 
ACPI_TABLE_MADTMadtTable
 
ACPI_SUBTABLE_HEADERAcpiHeader
 
ACPI_MADT_LOCAL_APICLocalApic
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 15 of file madt.c.

Function Documentation

◆ HalpParseApicTables()

VOID HalpParseApicTables ( _In_ PLOADER_PARAMETER_BLOCK  LoaderBlock)

Definition at line 30 of file madt.c.

32{
33 ULONG_PTR TableEnd;
34 ULONG ValidProcessorCount;
35
36 /* We only support legacy APIC for now, this will be updated in the future */
38 MadtTable = HalAcpiGetTable(LoaderBlock, 'CIPA');
39
43
46
50
51 while ((ULONG_PTR)AcpiHeader <= TableEnd)
52 {
54
57 {
58 ValidProcessorCount = HalpApicInfoTable.ProcessorCount;
59
60 HalpProcessorIdentity[ValidProcessorCount].LapicId = LocalApic->Id;
62
64
66 }
67 else
68 {
69 /* End the parsing early if we don't use the currently selected table */
71 }
72 }
73}
@ ACPI_MADT_TYPE_LOCAL_APIC
Definition: actbl2.h:1005
struct acpi_table_madt ACPI_TABLE_MADT
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
#define ULONG_PTR
Definition: config.h:101
PVOID NTAPI HalAcpiGetTable(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN ULONG Signature)
Definition: halacpi.c:446
unsigned int ULONG
Definition: retypes.h:1
ACPI_MADT_LOCAL_APIC * LocalApic
Definition: madt.c:25
ACPI_TABLE_MADT * MadtTable
Definition: madt.c:23
HALP_APIC_INFO_TABLE HalpApicInfoTable
Definition: madt.c:22
PROCESSOR_IDENTITY HalpStaticProcessorIdentity[MAXIMUM_PROCESSORS]
Definition: madt.c:20
PPROCESSOR_IDENTITY HalpProcessorIdentity
Definition: madt.c:21
ACPI_SUBTABLE_HEADER * AcpiHeader
Definition: madt.c:24
ULONG ProcessorCount
Definition: smp.h:25
ULONG ApicMode
Definition: smp.h:24
UCHAR ProcessorId
Definition: smp.h:13
UCHAR LapicId
Definition: smp.h:14
ACPI_SUBTABLE_HEADER Header
Definition: actbl2.h:1042
UINT32 Length
Definition: actbl.h:109
ACPI_TABLE_HEADER Header
Definition: actbl2.h:985
uint32_t ULONG_PTR
Definition: typedefs.h:65

Referenced by HalpInitProcessor().

◆ HalpPrintApicTables()

VOID HalpPrintApicTables ( VOID  )

Definition at line 76 of file madt.c.

77{
78 UINT32 i;
79
80 DPRINT1("HAL has detected a physical processor count of: %d\n", HalpApicInfoTable.ProcessorCount);
81 for (i = 0; i < HalpApicInfoTable.ProcessorCount; i++)
82 {
83 DPRINT1("Information about the following processor is for processors number: %d\n"
84 " The BSPCheck is set to: %X\n"
85 " The LapicID is set to: %X\n",
86 i, HalpProcessorIdentity[i].BSPCheck, HalpProcessorIdentity[i].LapicId);
87 }
88}
unsigned int UINT32
#define DPRINT1
Definition: precomp.h:8
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

Referenced by HalpInitPhase0().

Variable Documentation

◆ AcpiHeader

ACPI_SUBTABLE_HEADER* AcpiHeader

Definition at line 24 of file madt.c.

Referenced by HalpParseApicTables().

◆ HalpApicInfoTable

HALP_APIC_INFO_TABLE HalpApicInfoTable

Definition at line 22 of file madt.c.

Referenced by HalpParseApicTables(), and HalpPrintApicTables().

◆ HalpProcessorIdentity

PPROCESSOR_IDENTITY HalpProcessorIdentity = NULL

Definition at line 21 of file madt.c.

Referenced by HalpParseApicTables(), and HalpPrintApicTables().

◆ HalpStaticProcessorIdentity

PROCESSOR_IDENTITY HalpStaticProcessorIdentity[MAXIMUM_PROCESSORS] = {{0}}

Definition at line 20 of file madt.c.

Referenced by HalpParseApicTables().

◆ LocalApic

Definition at line 25 of file madt.c.

Referenced by HalpParseApicTables().

◆ MadtTable

ACPI_TABLE_MADT* MadtTable

Definition at line 23 of file madt.c.

Referenced by HalpParseApicTables().