Nucleus
Barry ACPI DSDT + PCI 53a772a (3 years, 3 months ago)
diff --git a/kernel/acpi/fadt.c b/kernel/acpi/fadt.c
new file mode 100644
index 0000000..92ce4c1
--- /dev/null
+++ b/kernel/acpi/fadt.c
@@ -0,0 +1,40 @@
+/*
+ * This file contains the code for handling the Fixed ACPI Description Table.
+ * The FADT describes the ACPI fixed register blocks related to power
+ * management. It should also contain a pointer to the Differentiated System
+ * Description Table.
+ */
+
+#include <io.h>
+#include "acpi.h"
+
+/* Preferred Power Management Profile */
+enum PMProfile {
+ PM_UNSPECIFIED,
+ PM_DESKTOP,
+ PM_MOBILE,
+ PM_WORKSTATION,
+ PM_ENTERPRISE_SERVER,
+ PM_SOHO_SERVER,
+ PM_APPLIANCE_PC,
+ PM_PERFORMANCE_SERVER,
+};
+
+/* Structure of the FADT */
+struct FADTable {
+ uint32_t firmwareCtrl;
+ uint32_t dsdt;
+ uint8_t reserved;
+ uint8_t prefPMProfile;
+ uint16_t sciInterrupt;
+ uint32_t smiCommandPort;
+ /* Bunch more boring stuff */
+};
+
+/* Parse FADT for information */
+void
+init_fadt(struct SDTHeader *header)
+{
+ struct FADTable *fadt = (struct FADTable *) (header + 1);
+ init_table((void *) fadt->dsdt);
+}