Chameleon

Chameleon Svn Source Tree

Root/branches/rekursor/i386/libsaio/acpi.h

1#ifndef __LIBSAIO_ACPI_H
2#define __LIBSAIO_ACPI_H
3
4#define ACPI_RANGE_START (0x0E0000)
5#define ACPI_RANGE_END (0x0FFFFF)
6
7#define UINT64_LE_FROM_CHARS(a,b,c,d,e,f,g,h) \
8( ((uint64_t)h << 56) \
9| ((uint64_t)g << 48) \
10| ((uint64_t)f << 40) \
11| ((uint64_t)e << 32) \
12| ((uint64_t)d << 24) \
13| ((uint64_t)c << 16) \
14| ((uint64_t)b << 8) \
15| ((uint64_t)a << 0) \
16)
17
18#define ACPI_SIGNATURE_UINT64_LE UINT64_LE_FROM_CHARS('R','S','D',' ','P','T','R',' ')
19
20/* Per ACPI 3.0a spec */
21
22// TODO Migrate
23struct acpi_2_rsdp {
24 char Signature[8];
25 uint8_t Checksum;
26 char OEMID[6];
27 uint8_t Revision;
28 uint32_t RsdtAddress;
29 uint32_t Length;
30 uint64_t XsdtAddress;
31 uint8_t ExtendedChecksum;
32 char Reserved[3];
33} __attribute__((packed));
34
35// TODO Migrate
36struct acpi_2_rsdt {
37char Signature[4];
38uint32_t Length;
39uint8_t Revision;
40uint8_t Checksum;
41char OEMID[6];
42char OEMTableId[8];
43uint32_t OEMRevision;
44uint32_t CreatorId;
45uint32_t CreatorRevision;
46} __attribute__((packed));
47
48// TODO Migrate
49struct acpi_2_xsdt {
50char Signature[4];
51uint32_t Length;
52uint8_t Revision;
53uint8_t Checksum;
54char OEMID[6];
55char OEMTableId[8];
56uint32_t OEMRevision;
57uint32_t CreatorId;
58uint32_t CreatorRevision;
59} __attribute__((packed));
60
61// TODO Migrate
62struct acpi_2_fadt {
63char Signature[4];
64uint32_t Length;
65uint8_t Revision;
66uint8_t Checksum;
67char OEMID[6];
68char OEMTableId[8];
69uint32_t OEMRevision;
70uint32_t CreatorId;
71uint32_t CreatorRevision;
72uint32_t FIRMWARE_CTRL;
73uint32_t DSDT;
74/*We absolutely don't care about theese fields*/
75uint8_tnotimp1[68];
76/*Reset Fix*/
77uint32_tFlags;
78uint8_tReset_SpaceID;
79uint8_tReset_BitWidth;
80uint8_tReset_BitOffset;
81uint8_tReset_AccessWidth;
82uint64_tReset_Address;
83uint8_tReset_Value;
84uint8_tReserved[3];
85uint64_tX_FIRMWARE_CTRL;
86uint64_tX_DSDT;
87/*We absolutely don't care about theese fields*/
88uint8_tnotimp2[96];
89} __attribute__((packed));
90
91#endif /* !__LIBSAIO_ACPI_H */
92

Archive Download this file

Revision: 5