refactor: isrm to centeralize interrupt/irq resources management.
[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     Desktop = 1,
10     Mobile = 2,
11     Workstation = 3,
12     EnterpriseServer = 4,
13     SOHOServer = 5,
14     AppliancePC = 6,
15     PerformanceServer = 7,
16     Tablet = 8,
17 };
18
19 #define IPM1AEVT_BLK_PORT 0
20 #define IPM1BEVT_BLK_PORT 1
21 #define IPM1ACNT_BLK_PORT 2
22 #define IPM1BCNT_BLK_PORT 3
23 #define IPM2CNT_BLK_PORT 4
24 #define IPMTMR_BLK_PORT 5
25
26 #define IPM1EVT_BLK_LEN 0
27 #define IPM1CNT_BLK_LEN 1
28 #define IPM2CNT_BLK_LEN 2
29 #define IPMTMR_BLK_LEN 3
30
31 #define ITIME_DAY_ALARM 0
32 #define ITIME_MON_ALARM 1
33 #define ITIME_CENTURY 2
34
35 #define IAPC_ARCH_LEGACY   0x1
36 #define IAPC_ARCH_8042     0x2
37 #define IAPC_ARCH_NO_VGA   0x4
38 #define IAPC_ARCH_NO_MSI   0x8
39 #define IAPC_ARCH_ASPM     0x10
40 #define IAPC_ARCH_NO_RTC   0x20
41
42 typedef struct acpi_fadt {
43     acpi_sdthdr_t header;
44     uint32_t firmware_controller_addr;
45     uint32_t dsdt_addr;
46     uint8_t reserved;
47     uint8_t pm_profile;
48     uint16_t sci_int;
49     uint32_t smi_cmd_port_addr;
50     uint8_t smi_acpi_enable;
51     uint8_t smi_acpi_disable;
52     uint8_t smi_s4bios_state;
53     uint8_t smi_pstate;
54     uint32_t pm_reg_ports[6];
55     uint32_t gpe0_port_addr;
56     uint32_t gpe1_port_addr;
57     uint8_t pm_reg_lens[4];
58     uint8_t gpe0_len;
59     uint8_t gpe1_len;
60     uint8_t gpe1_base;
61     uint8_t cst_cnt;
62     uint16_t p_lvl2_lat;
63     uint16_t p_lvl3_lat;
64     uint16_t flush_size;
65     uint16_t flush_stride;
66     uint8_t duty_offset;
67     uint8_t duty_width;
68     uint8_t time_info[3];
69     uint16_t boot_arch;
70 } ACPI_TABLE_PACKED acpi_fadt_t;
71
72 // TODO: FADT parser & support
73
74 #endif /* __LUNAIX_FADT_H */