summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlmuHS <almuhs@github.com>2019-10-03 14:56:28 +0200
committerAlmuHS <almuhs@github.com>2019-10-03 14:56:28 +0200
commit563082e5e117c305ca955558dd0e86928d1fd74b (patch)
tree48678b3831d48d51ad01e9973af282b5028bf924
parent61587d1b2633c15d11a1d7d33a2650d3204a5db8 (diff)
docs: described acpi rdsp structures
-rw-r--r--i386/i386at/acpi_rsdp.h46
1 files changed, 41 insertions, 5 deletions
diff --git a/i386/i386at/acpi_rsdp.h b/i386/i386at/acpi_rsdp.h
index c68cd6af..661d101c 100644
--- a/i386/i386at/acpi_rsdp.h
+++ b/i386/i386at/acpi_rsdp.h
@@ -31,6 +31,14 @@ struct acpi_rsdp
uint32_t rsdt_addr;
} __attribute__((__packed__));
+
+/* RSDT Entry Header
+ *
+ * Header which stores the descriptors of tables pointed from RDSP's Entry Field
+ * Includes the signature of the table, to identify each table
+ *
+ * In MADT, the signature is 'APIC'
+ */
struct acpi_dhdr
{
uint8_t signature[4];
@@ -53,36 +61,58 @@ struct acpi_rsdt
uint32_t entry[0];
} __attribute__((__packed__));
-
+//APIC table signature
#define ACPI_APIC_SIG "APIC"
+//Types value for Local APIC and I/O APIC ACPI's structures
#define ACPI_APIC_ENTRY_LAPIC 0
#define ACPI_APIC_ENTRY_IOAPIC 1
+/* APIC descriptor header
+ * Define the type of the structure (Local APIC, I/O APIC or others)
+ * Type: Local APIC (0), I/O APIC (1)
+ */
struct acpi_apic_dhdr
{
uint8_t type;
uint8_t length;
} __attribute__((__packed__));
+
+/* Multiple APIC Description Table (MADT)
+ *
+ * Describes the APIC structures which exist in the machine
+ * Includes the common address where Local APIC is mapped in main memory
+ *
+ * Entry field stores the descriptors of APIC structures
+ */
struct acpi_apic
{
- struct acpi_dhdr header;
- uint32_t lapic_addr;
+ struct acpi_dhdr header; //Header, which stores the descriptor for RDST's Entry field
+ uint32_t lapic_addr; //Local Interrupt Controller Address
uint32_t flags;
- struct acpi_apic_dhdr entry[0];
+ struct acpi_apic_dhdr entry[0]; //Interrupt Controller Structure
} __attribute__((__packed__));
+/* Processor Local APIC Structure
+ *
+ * Stores information about APIC ID, flags and ACPI Processor UID
+ */
struct acpi_apic_lapic
{
struct acpi_apic_dhdr header;
- uint8_t processor_id;
+ uint8_t processor_id; //ACPI Processor UID
uint8_t apic_id;
uint32_t flags;
} __attribute__((__packed__));
+/* I/O APIC Structure
+ *
+ * Stores information about APIC ID, and I/O APIC tables
+ */
+
struct acpi_apic_ioapic
{
struct acpi_apic_dhdr header;
@@ -97,6 +127,12 @@ struct acpi_apic_ioapic
int acpi_setup();
void acpi_print_info();
+
+/* extra_setup() function:
+ *
+ * Must be executed after configure paging
+ * Reserve Local APIC common pointer in a physical page
+ */
int extra_setup();