ld-tool portability fix: MacOS build experience
[lunaix-os.git] / lunaix-os / includes / hal / acpi / fadt.h
1 #ifndef __LUNAIX_FADT_H
2 #define __LUNAIX_FADT_H
3
4 #include "sdt.h"
5
6 // Pulled from ACPI Specification (v6.4) section 5.2.9
7
8 enum PMProfile
9 {
10     Desktop = 1,
11     Mobile = 2,
12     Workstation = 3,
13     EnterpriseServer = 4,
14     SOHOServer = 5,
15     AppliancePC = 6,
16     PerformanceServer = 7,
17     Tablet = 8,
18 };
19
20 #define IPM1AEVT_BLK_PORT 0
21 #define IPM1BEVT_BLK_PORT 1
22 #define IPM1ACNT_BLK_PORT 2
23 #define IPM1BCNT_BLK_PORT 3
24 #define IPM2CNT_BLK_PORT 4
25 #define IPMTMR_BLK_PORT 5
26
27 #define IPM1EVT_BLK_LEN 0
28 #define IPM1CNT_BLK_LEN 1
29 #define IPM2CNT_BLK_LEN 2
30 #define IPMTMR_BLK_LEN 3
31
32 #define ITIME_DAY_ALARM 0
33 #define ITIME_MON_ALARM 1
34 #define ITIME_CENTURY 2
35
36 #define IAPC_ARCH_LEGACY 0x1
37 #define IAPC_ARCH_8042 0x2
38 #define IAPC_ARCH_NO_VGA 0x4
39 #define IAPC_ARCH_NO_MSI 0x8
40 #define IAPC_ARCH_ASPM 0x10
41 #define IAPC_ARCH_NO_RTC 0x20
42
43 typedef struct acpi_fadt
44 {
45     acpi_sdthdr_t header;
46     u32_t firmware_controller_addr;
47     u32_t dsdt_addr;
48     u8_t reserved;
49     u8_t pm_profile;
50     u16_t sci_int;
51     u32_t smi_cmd_port_addr;
52     u8_t smi_acpi_enable;
53     u8_t smi_acpi_disable;
54     u8_t smi_s4bios_state;
55     u8_t smi_pstate;
56     u32_t pm_reg_ports[6];
57     u32_t gpe0_port_addr;
58     u32_t gpe1_port_addr;
59     u8_t pm_reg_lens[4];
60     u8_t gpe0_len;
61     u8_t gpe1_len;
62     u8_t gpe1_base;
63     u8_t cst_cnt;
64     u16_t p_lvl2_lat;
65     u16_t p_lvl3_lat;
66     u16_t flush_size;
67     u16_t flush_stride;
68     u8_t duty_offset;
69     u8_t duty_width;
70     u8_t time_info[3];
71     u16_t boot_arch;
72 } ACPI_TABLE_PACKED acpi_fadt_t;
73
74 // TODO: FADT parser & support
75
76 #endif /* __LUNAIX_FADT_H */