PatchworkOS
Loading...
Searching...
No Matches
acpi.h
Go to the documentation of this file.
1#pragma once
2
3#include <kernel/fs/sysfs.h>
4
5#include <boot/boot_info.h>
6#include <kernel/defs.h>
7
8#include <stdint.h>
9
66#define RSDP_CURRENT_REVISION 2
67
71#define SDT_SIGNATURE_LENGTH 4
72
76#define SDT_OEM_ID_LENGTH 6
77
81#define SDT_OEM_TABLE_ID_LENGTH 8
82
101
105#define RSDP_SIGNATURE_LENGTH 8
106
125
129#define RSDP_V1_LENGTH 20
130
137typedef struct PACKED
138{
140 sdt_header_t* tables[];
141} xsdt_t;
142
151bool acpi_is_checksum_valid(void* table, uint64_t length);
152
161
172
dentry_t * acpi_get_sysfs_root(void)
Retrieve the sysfs root directory for ACPI.
Definition acpi.c:28
#define SDT_OEM_ID_LENGTH
The length of the OEM ID field in the SDT header structure.
Definition acpi.h:76
#define SDT_OEM_TABLE_ID_LENGTH
The length of the OEM Table ID field in the SDT header structure.
Definition acpi.h:81
bool acpi_is_checksum_valid(void *table, uint64_t length)
Check if the sum of all bytes in a table is 0.
Definition acpi.c:17
#define SDT_SIGNATURE_LENGTH
The length of the signature field in the SDT header structure.
Definition acpi.h:71
#define RSDP_SIGNATURE_LENGTH
Length of the signature field in the RSDP structure.
Definition acpi.h:105
void acpi_reclaim_memory(const boot_memory_map_t *map)
Reclaim ACPI memory regions.
Definition acpi.c:44
#define PACKED
GCC packed attribute.
Definition defs.h:32
boot_memory_map_t * map
Definition mem.c:19
__UINT32_TYPE__ uint32_t
Definition stdint.h:15
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
__UINT8_TYPE__ uint8_t
Definition stdint.h:11
Directory entry structure.
Definition dentry.h:83
Root System Description Pointer.
Definition acpi.h:114
uint8_t extendedChecksum
This is the checksum for the entire table.
Definition acpi.h:122
uint32_t rsdtAddress
Definition acpi.h:119
uint8_t revision
Definition acpi.h:118
uint32_t length
Definition acpi.h:120
uint8_t checksum
This is the checksum for the first 20 bytes only.
Definition acpi.h:116
uint64_t xsdtAddress
Definition acpi.h:121
System Description Table Header.
Definition acpi.h:90
uint32_t oemRevision
Definition acpi.h:97
uint32_t creatorRevision
Definition acpi.h:99
uint8_t revision
Definition acpi.h:93
uint32_t length
Definition acpi.h:92
uint8_t checkSum
Definition acpi.h:94
uint32_t creatorID
Definition acpi.h:98
Extended System Description Table.
Definition acpi.h:138
sdt_header_t header
Definition acpi.h:139