blob: 886dc6cad3443e5e3b05c391c88087663ac4c642 (
plain) (
blame)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
#ifndef MELVIX_ACPI_H
#define MELVIX_ACPI_H
#include <stdint.h>
#include <kernel/multiboot.h>
/**
* Initialize the ACP interface
*/
void acpi_old_init(struct multiboot_tag_old_acpi *tag);
void acpi_new_init(struct multiboot_tag_new_acpi *tag);
/**
* Activate a ACPI based device reboot
*/
void reboot();
/**
* Activate a ACPI based device shutdown/poweroff
*/
void acpi_poweroff();
struct address_structure {
uint8_t address_space_id;
uint8_t register_bit_width;
uint8_t register_bit_offset;
uint8_t reserved;
uint64_t address;
};
struct rsdp {
char signature[8];
char checksum;
char oem_id[6];
char revision;
uint32_t *rsdt_address;
};
struct sdt_header {
char signature[4];
uint32_t length;
uint8_t revision;
uint8_t checksum;
char oem_id[6];
char oem_table_id[8];
uint32_t oem_revision;
uint32_t creator_id;
uint32_t creator_revision;
};
struct rsdt {
struct sdt_header header;
uint32_t sdt_pointer[0];
};
struct xsdt {
struct sdt_header header;
uint32_t sdt_pointer[0];
};
struct fadt {
struct sdt_header header;
uint32_t firmware_ctl;
uint32_t dsdt;
uint8_t reserved;
uint8_t preferred_power_management;
uint16_t sci_interrupt;
uint32_t smi_commandPort;
uint8_t acpi_enable;
uint8_t acpi_disable;
uint8_t S4BIOS_req;
uint8_t PSTATE_control;
uint32_t PM1a_event_block;
uint32_t PM1b_event_block;
uint32_t PM1a_control_block;
uint32_t PM1b_control_block;
uint32_t PM2_control_block;
uint32_t PM_timer_block;
uint32_t GPE0_block;
uint32_t GPE1_block;
uint8_t PM1_event_length;
uint8_t PM1_control_length;
uint8_t PM2_control_length;
uint8_t PM_timer_length;
uint8_t GPE0_length;
uint8_t GPE1_length;
uint8_t GPE1_base;
uint8_t C_state_control;
uint16_t worst_C2_latency;
uint16_t worst_C3_latency;
uint16_t flush_size;
uint16_t flush_stride;
uint8_t duty_offset;
uint8_t duty_width;
uint8_t day_alarm;
uint8_t month_alarm;
uint8_t century;
uint16_t boot_architecture_flags; // Reserved in 1.0
uint8_t reserved2;
uint32_t flags;
struct address_structure reset_reg;
uint8_t reset_value;
uint8_t reserved3[3];
uint64_t x_firmware_control; // Reserved in 1.0
uint64_t x_dsdt; // Reserved in 1.0
struct address_structure x_PM1a_event_block;
struct address_structure x_PM1b_event_block;
struct address_structure x_PM1a_control_block;
struct address_structure x_PM1b_control_block;
struct address_structure x_PM2_control_block;
struct address_structure x_PM_timer_block;
struct address_structure x_GPE0_block;
struct address_structure x_GPE1_block;
};
struct hpet {
struct sdt_header header;
uint8_t hardware_rev_id;
uint8_t comparator_count : 5;
uint8_t counter_size : 1;
uint8_t reserved : 1;
uint8_t legacy_replacement : 1;
uint16_t pci_vendor_id;
struct address_structure address;
uint8_t hpet_number;
uint16_t minimum_tick;
uint8_t page_protection;
};
struct madt {
struct sdt_header header;
uint32_t address;
uint32_t flags;
// Interrupt devices...
};
struct rsdt *rsdt;
struct fadt *fadt;
struct hpet *hpet;
struct madt *madt;
#endif
|