:: commit 066aa1511c5db9c9a382e589becbe9841da6fa38

VAN BOSSUYT Nicolas <nicolas.van.bossuyt@gmail.com> — 2020-09-18 12:44

parents: 41c68e5e43

Added stivale mmap struct.

diff --git a/stivale/stivale.h b/stivale/stivale.h
index d3f155bf..8e5c0891 100644
--- a/stivale/stivale.h
+++ b/stivale/stivale.h
@@ -25,6 +25,22 @@ struct stivale_module {
     uint64_t next;
 } __attribute__((packed));
 
+enum  {
+    STIVALE_MMAP_USABLE = 1,
+    STIVALE_MMAP_RESERVED = 2,
+    STIVALE_MMAP_ACPI_RECLAIMABLE = 3,
+    STIVALE_MMAP_ACPI_NVS = 4,
+    STIVALE_MMAP_BAD_MEMORY = 5,
+    STIVALE_MMAP_KERNEL_AND_MODULES = 10, // Kernel/Modules
+};
+
+struct stivale_mmap_entry {
+    uint64_t base;
+    uint64_t length;
+    uint32_t type;
+    uint32_t unused;
+} __attribute__((packed));
+
 struct stivale_struct {
     uint64_t cmdline;
     uint64_t memory_map_addr;
diff --git a/stivale/stivale2.h b/stivale/stivale2.h
index 34617800..61ca16b9 100644
--- a/stivale/stivale2.h
+++ b/stivale/stivale2.h
@@ -58,6 +58,16 @@ struct stivale2_struct_tag_cmdline {
 
 #define STIVALE2_STRUCT_TAG_MEMMAP_ID 0x2187f79e8612de07
 
+enum {
+    STIVALE2_MMAP_USABLE = 1,
+    STIVALE2_MMAP_RESERVED = 2,
+    STIVALE2_MMAP_ACPI_RECLAIMABLE = 3,
+    STIVALE2_MMAP_ACPI_NVS = 4,
+    STIVALE2_MMAP_BAD_MEMORY = 5,
+    STIVALE2_MMAP_BOOTLOADER_RECLAIMABLE = 0x1000,
+    STIVALE2_MMAP_KERNEL_AND_MODULES = 0x1001
+};
+
 struct stivale2_mmap_entry {
     uint64_t base;
     uint64_t length;
tab: 248 wrap: offon