2021-12-24 19:13:28 +00:00
|
|
|
#pragma once
|
2023-02-21 13:36:20 +00:00
|
|
|
#include "../terminal/kterm.h"
|
2023-02-19 22:38:32 +00:00
|
|
|
#include <CoreLib/Memory.h>
|
2023-02-21 13:36:20 +00:00
|
|
|
#include <stdint-gcc.h>
|
2023-02-19 22:38:32 +00:00
|
|
|
|
2021-12-24 19:13:28 +00:00
|
|
|
|
|
|
|
struct ACPISDTHeader{
|
|
|
|
char Signature[4];
|
|
|
|
uint32_t Length;
|
2023-02-21 13:36:20 +00:00
|
|
|
uint8_t Revision;
|
2021-12-24 19:13:28 +00:00
|
|
|
uint8_t CheckSum;
|
|
|
|
char OEMID[6];
|
|
|
|
char OEMTableID[8];
|
|
|
|
uint32_t OEMRevision;
|
|
|
|
uint32_t CreatorID;
|
|
|
|
uint32_t CreatorRevision;
|
2023-02-21 13:36:20 +00:00
|
|
|
};
|
2021-12-24 19:13:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
struct RSDT{
|
2023-02-21 13:36:20 +00:00
|
|
|
struct ACPISDTHeader h;
|
2021-12-24 19:13:28 +00:00
|
|
|
uint32_t PointerToSDT[]; // Length of array : (header.Length - sizeof(header))/ 4
|
|
|
|
}__attribute__((packed));
|
2023-02-26 23:32:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
struct RSDPDescriptor {
|
|
|
|
char signature[8];
|
|
|
|
uint8_t Checksum ;
|
|
|
|
char OEMID [6];
|
|
|
|
uint8_t Revision;
|
|
|
|
RSDT* RsdtAddress;
|
|
|
|
}__attribute__((packed));
|
|
|
|
|
|
|
|
struct RSCPDescriptor20{
|
|
|
|
RSDPDescriptor base;
|
|
|
|
uint32_t Length;
|
|
|
|
uint64_t XsdtAddress;
|
|
|
|
uint8_t ExtendedChecksum;
|
|
|
|
uint8_t reserved[3];
|
|
|
|
}__attribute__((packed));
|
|
|
|
|
2023-02-21 13:36:20 +00:00
|
|
|
RSDPDescriptor* FindRSD();
|
2021-12-24 19:13:28 +00:00
|
|
|
|
2023-02-21 13:36:20 +00:00
|
|
|
void printRSD(RSDPDescriptor* rsd);
|
2021-12-24 19:13:28 +00:00
|
|
|
|
2023-02-21 13:36:20 +00:00
|
|
|
RSDT* getRSDT(RSDPDescriptor* rsd);
|