Add support for limine RSDP request

This commit is contained in:
Michael Shaw 2023-02-27 20:53:41 -05:00
commit 0cc86fc37d
8 changed files with 83 additions and 0 deletions

22
include/dev/apic.h Normal file
View file

@ -0,0 +1,22 @@
#ifndef _APIC_H_
#define _APIC_H_
#ifndef __ASM__
#include <kernel/common.h>
struct madt {
char signature[4];
uint32_t length;
uint8_t revision;
uint8_t checksum;
char oemid[6];
uint64_t oem_tableid;
uint32_t oem_rev;
uint32_t creator_id;
uint32_t creator_revision;
} __attribute__((packed));
#endif /* __ASM__ */
#endif /* _APIC_H_ */

36
include/kernel/acpi.h Normal file
View file

@ -0,0 +1,36 @@
#ifndef _ACPI_H_
#define _ACPI_H_
#ifndef __ASM__
#include <kernel/common.h>
struct rsdp {
char signature[8];
uint8_t checksum;
char oemid[6];
uint8_t revision;
uint32_t rsdt_addr;
uint32_t length;
uint64_t xsdt_addr; /* the REAL address */
uint8_t checksum_ext;
char reserved[3];
} PACKED;
struct acpi_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;
} PACKED;
void acpi_init();
#endif /* __ASM__ */
#endif /* _ACPI_H_ */

View file

@ -7,4 +7,6 @@
#include <stddef.h>
#include <stdbool.h>
#define PACKED __attribute__((packed))
#endif /* _COMMON_H_ */