git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: striped more arch-related code from the kernel code base
[lunaix-os.git]
/
lunaix-os
/
includes
/
hal
/
acpi
/
acpi.h
diff --git
a/lunaix-os/includes/hal/acpi/acpi.h
b/lunaix-os/includes/hal/acpi/acpi.h
index 892624497c1d274bf78ca8f30b36284cec98164d..8f51a2cb18ef5ac12752fc586136be99b6178e84 100644
(file)
--- a/
lunaix-os/includes/hal/acpi/acpi.h
+++ b/
lunaix-os/includes/hal/acpi/acpi.h
@@
-1,41
+1,53
@@
#ifndef __LUNAIX_ACPI_ACPI_H
#define __LUNAIX_ACPI_ACPI_H
#ifndef __LUNAIX_ACPI_ACPI_H
#define __LUNAIX_ACPI_ACPI_H
-#include <s
tdin
t.h>
+#include <s
ys/boot/multiboo
t.h>
#include <stddef.h>
#include <stddef.h>
-#include <
arch/x86/boot/multiboo
t.h>
+#include <
stdin
t.h>
-#include "
s
dt.h"
+#include "
fa
dt.h"
#include "madt.h"
#include "madt.h"
+#include "mcfg.h"
+#include "sdt.h"
+
+// * for quick conversion from a table name into ACPI favoured signature
+// * use `echo <TableName> | xxd -eg4`
-#define ACPI_RSDP_SIG_L
0x20445352
// 'RSD '
-#define ACPI_RSDP_SIG_H
0x20525450
// 'PTR '
+#define ACPI_RSDP_SIG_L
0x20445352
// 'RSD '
+#define ACPI_RSDP_SIG_H
0x20525450
// 'PTR '
-#define ACPI_MADT_SIG 0x43495041 // 'APIC'
+#define ACPI_MADT_SIG 0x43495041 // 'APIC'
+#define ACPI_FADT_SIG 0x50434146 // 'FACP' Notice that it is not 'FADT'.
-typedef struct {
- uint32_t signature_l;
- uint32_t signature_h;
- uint8_t chksum;
- uint8_t oem_id[6];
+// 'MCFG' (Not part of ACPI standard. See PCI Firmware Spec.)
+#define ACPI_MCFG_SIG 0x4746434d
+
+typedef struct
+{
+ u32_t signature_l;
+ u32_t signature_h;
+ u8_t chksum;
+ char oem_id[6];
// Revision
// Revision
- u
int
8_t rev;
+ u8_t rev;
acpi_rsdt_t* rsdt;
acpi_rsdt_t* rsdt;
- u
int
32_t length;
+ u32_t length;
acpi_sdthdr_t* xsdt;
acpi_sdthdr_t* xsdt;
- u
int
8_t x_chksum;
- char reserved[3];
// Reserved field
+ u8_t x_chksum;
+ char reserved[3]; // Reserved field
} __attribute__((packed)) acpi_rsdp_t;
/**
* @brief Main TOC of ACPI tables, provide hassle-free access of ACPI info.
} __attribute__((packed)) acpi_rsdp_t;
/**
* @brief Main TOC of ACPI tables, provide hassle-free access of ACPI info.
- *
+ *
*/
typedef struct
{
// Make it as null terminated
char oem_id[7];
acpi_madt_toc_t madt;
*/
typedef struct
{
// Make it as null terminated
char oem_id[7];
acpi_madt_toc_t madt;
+ acpi_fadt_t fadt;
+ struct acpi_mcfg_toc mcfg;
} acpi_context;
int
} acpi_context;
int
@@
-44,4
+56,7
@@
acpi_init(multiboot_info_t* mb_info);
acpi_context*
acpi_get_context();
acpi_context*
acpi_get_context();
+u8_t
+acpi_gistranslate(u8_t old_irq);
+
#endif /* __LUNAIX_ACPI_ACPI_H */
#endif /* __LUNAIX_ACPI_ACPI_H */