1 /**
2  * 解析acpi信息的模块
3  **/
4 
5 #pragma once
6 
7 #include <common/glib.h>
8 #include <mm/mm.h>
9 
10 struct acpi_RSDP_t
11 {
12     unsigned char Signature[8];
13     unsigned char Checksum;
14     unsigned char OEMID[6];
15 
16     unsigned char Revision;
17 
18     // 32bit physical address of the RSDT
19     uint RsdtAddress;
20 } __attribute__((packed));
21 
22 struct acpi_RSDP_2_t
23 {
24     struct acpi_RSDP_t rsdp1;
25 
26     // fields below are only valid when the revision value is 2 or above
27     // 表的长度(单位:字节)从offset=0开始算
28     uint Length;
29     // 64bit的XSDT的物理地址
30     ul XsdtAddress;
31     unsigned char ExtendedChecksum; // 整个表的checksum,包括了之前的checksum区域
32 
33     unsigned char Reserved[3];
34 } __attribute__((packed));
35 
36 // 初始化acpi模块
37 void acpi_init();