aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/acpi/acpi.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/acpi/acpi.h')
-rw-r--r--src/kernel/acpi/acpi.h180
1 files changed, 90 insertions, 90 deletions
diff --git a/src/kernel/acpi/acpi.h b/src/kernel/acpi/acpi.h
index 0b98552..d487bdd 100644
--- a/src/kernel/acpi/acpi.h
+++ b/src/kernel/acpi/acpi.h
@@ -2,7 +2,7 @@
#define MELVIX_ACPI_H
#include <stdint.h>
-#include <kernel/multiboot.h>
+#include <multiboot.h>
/**
* Initialize the ACP interface
@@ -21,38 +21,38 @@ void reboot();
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;
+ u8 address_space_id;
+ u8 register_bit_width;
+ u8 register_bit_offset;
+ u8 reserved;
+ u64 address;
};
// p. 138
struct fadt_flags {
- uint8_t WBINVD : 1;
- uint8_t WBINVD_flush : 1;
- uint8_t C1_support : 1;
- uint8_t C2_mp_support : 1;
- uint8_t power_button : 1; // 1 if not present
- uint8_t sleep_button : 1; // 1 if not present
- uint8_t rtc_fix_reg : 1;
- uint8_t rtc_wakes_S4 : 1;
- uint8_t timer_32 : 1;
- uint8_t dock_support : 1;
- uint8_t reset_support : 1;
- uint8_t sealed_case : 1;
- uint8_t headless : 1;
- uint8_t slp_instruction : 1;
- uint8_t pci_wake_support : 1;
- uint8_t use_platform_clock : 1;
- uint8_t rtc_valid_S4 : 1;
- uint8_t remote_on_support : 1;
- uint8_t force_apic_cluster : 1;
- uint8_t force_apic_physical : 1;
- uint8_t hw_reduced_acpi : 1;
- uint8_t low_power_S0_support : 1;
- uint16_t reserved : 10;
+ u8 WBINVD : 1;
+ u8 WBINVD_flush : 1;
+ u8 C1_support : 1;
+ u8 C2_mp_support : 1;
+ u8 power_button : 1; // 1 if not present
+ u8 sleep_button : 1; // 1 if not present
+ u8 rtc_fix_reg : 1;
+ u8 rtc_wakes_S4 : 1;
+ u8 timer_32 : 1;
+ u8 dock_support : 1;
+ u8 reset_support : 1;
+ u8 sealed_case : 1;
+ u8 headless : 1;
+ u8 slp_instruction : 1;
+ u8 pci_wake_support : 1;
+ u8 use_platform_clock : 1;
+ u8 rtc_valid_S4 : 1;
+ u8 remote_on_support : 1;
+ u8 force_apic_cluster : 1;
+ u8 force_apic_physical : 1;
+ u8 hw_reduced_acpi : 1;
+ u8 low_power_S0_support : 1;
+ u16 reserved : 10;
};
struct rsdp {
@@ -60,76 +60,76 @@ struct rsdp {
char checksum;
char oem_id[6];
char revision;
- uint32_t *rsdt_address;
+ u32 *rsdt_address;
};
struct sdt_header {
char signature[4];
- uint32_t length;
- uint8_t revision;
- uint8_t checksum;
+ u32 length;
+ u8 revision;
+ u8 checksum;
char oem_id[6];
char oem_table_id[8];
- uint32_t oem_revision;
- uint32_t creator_id;
- uint32_t creator_revision;
+ u32 oem_revision;
+ u32 creator_id;
+ u32 creator_revision;
};
struct rsdt {
struct sdt_header header;
- uint32_t sdt_pointer[];
+ u32 sdt_pointer[];
};
struct xsdt {
struct sdt_header header;
- uint32_t sdt_pointer[];
+ u32 sdt_pointer[];
};
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;
+ u32 firmware_ctl;
+ u32 dsdt;
+ u8 reserved;
+ u8 preferred_power_management;
+ u16 sci_interrupt;
+ u32 smi_commandPort;
+ u8 acpi_enable;
+ u8 acpi_disable;
+ u8 S4BIOS_req;
+ u8 PSTATE_control;
+ u32 PM1a_event_block;
+ u32 PM1b_event_block;
+ u32 PM1a_control_block;
+ u32 PM1b_control_block;
+ u32 PM2_control_block;
+ u32 PM_timer_block;
+ u32 GPE0_block;
+ u32 GPE1_block;
+ u8 PM1_event_length;
+ u8 PM1_control_length;
+ u8 PM2_control_length;
+ u8 PM_timer_length;
+ u8 GPE0_length;
+ u8 GPE1_length;
+ u8 GPE1_base;
+ u8 C_state_control;
+ u16 worst_C2_latency;
+ u16 worst_C3_latency;
+ u16 flush_size;
+ u16 flush_stride;
+ u8 duty_offset;
+ u8 duty_width;
+ u8 day_alarm;
+ u8 month_alarm;
+ u8 century;
+ u16 boot_architecture_flags; // Reserved in 1.0
+ u8 reserved2;
struct fadt_flags 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
+ u8 reset_value;
+ u8 reserved3[3];
+ u64 x_firmware_control; // Reserved in 1.0
+ u64 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;
@@ -142,22 +142,22 @@ struct fadt {
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;
+ u8 hardware_rev_id;
+ u8 comparator_count : 5;
+ u8 counter_size : 1;
+ u8 reserved : 1;
+ u8 legacy_replacement : 1;
+ u16 pci_vendor_id;
struct address_structure address;
- uint8_t hpet_number;
- uint16_t minimum_tick;
- uint8_t page_protection;
+ u8 hpet_number;
+ u16 minimum_tick;
+ u8 page_protection;
};
struct madt {
struct sdt_header header;
- uint32_t address;
- uint32_t flags;
+ u32 address;
+ u32 flags;
// Interrupt devices...
};