PatchworkOS
Loading...
Searching...
No Matches
rsdp.c
Go to the documentation of this file.
1#include "rsdp.h"
2
3void* rsdp_get(EFI_SYSTEM_TABLE* systemTable)
4{
5 Print(L"Searching for RSDP... ");
6 EFI_CONFIGURATION_TABLE* configTable = systemTable->ConfigurationTable;
7 EFI_GUID acpi2TableGuid = ACPI_20_TABLE_GUID;
8
9 void* rsdp = NULL;
10 for (uint64_t i = 0; i < systemTable->NumberOfTableEntries; i++)
11 {
12 if (CompareGuid(&configTable[i].VendorGuid, &acpi2TableGuid) &&
13 CompareMem("RSD PTR ", configTable->VendorTable, 8) == 0)
14 {
15 rsdp = configTable->VendorTable;
16 }
17 configTable++;
18 }
19
20 if (rsdp == NULL)
21 {
22 Print(L"failed to locate rsdp!\n");
23 }
24 else
25 {
26 Print(L"found at %p!\n", rsdp);
27 }
28 return rsdp;
29}
#define NULL
Pointer error value.
Definition NULL.h:23
void * rsdp_get(EFI_SYSTEM_TABLE *systemTable)
Definition rsdp.c:3
__UINT64_TYPE__ uint64_t
Definition stdint.h:17