Boot framework rework (#45)
[lunaix-os.git] / lunaix-os / includes / lunaix / boot_generic.h
index a229c454b8f8668251b140eaeab8d1746a13e504..9ffb7e2ddae015166cf40abcafd7256a06b53606 100644 (file)
@@ -38,11 +38,12 @@ struct boot_handoff
 
     struct
     {
 
     struct
     {
-        ptr_t ksections;
-        size_t size;
+        struct {
+            char* cmdline;
+            size_t len;
+        };
 
 
-        char* cmdline;
-        size_t len;
+        ptr_t dtb_pa;
     } kexec;
 
     struct
     } kexec;
 
     struct
@@ -68,7 +69,29 @@ void
 boot_end(struct boot_handoff*);
 
 void
 boot_end(struct boot_handoff*);
 
 void
-boot_cleanup();
+boot_begin_arch_reserve(struct boot_handoff*);
+
+void
+boot_clean_arch_reserve(struct boot_handoff*);
+
+static inline bool
+free_memregion(struct boot_mmapent* mmapent)
+{
+    return !mmapent->type;
+}
+
+static inline bool
+reserved_memregion(struct boot_mmapent* mmapent)
+{
+    return !!(mmapent->type & BOOT_MMAP_RSVD);
+}
+
+static inline bool
+reclaimable_memregion(struct boot_mmapent* mmapent)
+{
+    return !!(mmapent->type & BOOT_MMAP_RCLM);
+}
+
 #endif
 
 #endif /* __LUNAIX_BOOT_GENERIC_H */
 #endif
 
 #endif /* __LUNAIX_BOOT_GENERIC_H */