summaryrefslogtreecommitdiff
path: root/src/include/acpi.h
blob: c15e044d6df5cbd62f8bc627e34b1e9976e47b5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <stdint.h>
#include <libc.h>

struct rsdp_v1 {
  char sig[8];
  uint8_t checksum;
  char OEMID[6];
  uint8_t version;
  uint32_t rsdt_addr;

} __attribute__((packed));

struct rsdp_v2 {
  struct rsdp_v1 v1;
  uint32_t len;
  uint64_t xsdt_addr;
  uint8_t extended_checksum;
  uint8_t reserved[3]; 
} __attribute__((packed));


typedef union rsdp_t { 
  struct rsdp_v1 v1;
  struct rsdp_v2 v2;
} rsdp_t;

struct acpi_header {
  char sig[4];
  uint32_t length;
  uint8_t revision;
  uint8_t checksum;
  char OEMID[6];
  char OEMTableID[8];
  uint32_t OEMRevision;
  uint32_t creator_id;
  uint32_t creator_revision;
} __attribute__((packed));

rsdp_t *find_RSDP();