33 lines
677 B
C
33 lines
677 B
C
|
|
#ifndef TABLE_H_
|
||
|
|
#define TABLE_H_
|
||
|
|
|
||
|
|
#include <stdint.h>
|
||
|
|
#include <stddef.h>
|
||
|
|
|
||
|
|
enum loader_status {
|
||
|
|
LOADER_OK = 0,
|
||
|
|
LOADER_IOERR,
|
||
|
|
LOADER_BADSUM,
|
||
|
|
LOADER_NOMEM,
|
||
|
|
};
|
||
|
|
|
||
|
|
struct acpi_table {
|
||
|
|
char sig[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;
|
||
|
|
};
|
||
|
|
|
||
|
|
extern enum loader_status acpi_table_load(const char *path, struct acpi_table **out);
|
||
|
|
extern void acpi_table_destroy(struct acpi_table *table);
|
||
|
|
extern void acpi_table_get_payload(struct acpi_table *table, void **p, size_t *len);
|
||
|
|
|
||
|
|
extern const char *loader_status_string(enum loader_status status);
|
||
|
|
|
||
|
|
#endif
|