:: commit f245d0e280c4fa5bde29879087fdb8d39785f6b0

mintsuki <mintsuki@protonmail.com> — 2020-09-21 10:15

parents: e721c3c814

Reorganise headers

diff --git a/stage2/drivers/vga_textmode.c b/stage2/drivers/vga_textmode.c
index 15dcf47b..b7c7a2eb 100644
--- a/stage2/drivers/vga_textmode.c
+++ b/stage2/drivers/vga_textmode.c
@@ -1,7 +1,7 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <stdbool.h>
-#include <lib/cio.h>
+#include <sys/cpu.h>
 #include <lib/real.h>
 #include <drivers/vga_textmode.h>
 
diff --git a/stage2/fs/ext2.h b/stage2/fs/ext2.h
index c0f082c6..0fbc1f8f 100644
--- a/stage2/fs/ext2.h
+++ b/stage2/fs/ext2.h
@@ -1,5 +1,5 @@
-#ifndef __FS_EXT2_H__

-#define __FS_EXT2_H__

+#ifndef __FS__EXT2_H__

+#define __FS__EXT2_H__

 

 #include <stdint.h>

 #include <stddef.h>

@@ -36,7 +36,7 @@ struct ext2_inode {
     uint32_t i_generation;

 

     /* EXT2 v >= 1.0 */

-    uint32_t i_eab; 

+    uint32_t i_eab;

     uint32_t i_maj;

 

     /* EXT2 vAll */

diff --git a/stage2/lib/blib.c b/stage2/lib/blib.c
index e7be9956..a11f8c62 100644
--- a/stage2/lib/blib.c
+++ b/stage2/lib/blib.c
@@ -6,7 +6,7 @@
 #include <lib/libc.h>
 #include <lib/term.h>
 #include <lib/real.h>
-#include <lib/cio.h>
+#include <sys/cpu.h>
 #include <sys/e820.h>
 #include <lib/print.h>
 
diff --git a/stage2/lib/print.c b/stage2/lib/print.c
index ecd77056..418fc8ed 100644
--- a/stage2/lib/print.c
+++ b/stage2/lib/print.c
@@ -3,7 +3,7 @@
 #include <stdint.h>
 #include <lib/print.h>
 #include <lib/blib.h>
-#include <lib/cio.h>
+#include <sys/cpu.h>
 #include <lib/term.h>
 
 static const char *base_digits = "0123456789abcdef";
diff --git a/stage2/mm/vmm64.c b/stage2/mm/vmm.c
similarity index 98%
rename from stage2/mm/vmm64.c
rename to stage2/mm/vmm.c
index 97503ebe..27dc7bf8 100644
--- a/stage2/mm/vmm64.c
+++ b/stage2/mm/vmm.c
@@ -1,6 +1,6 @@
 #include <stdint.h>
 #include <stddef.h>
-#include <mm/vmm64.h>
+#include <mm/vmm.h>
 #include <mm/pmm.h>
 #include <lib/blib.h>
 
diff --git a/stage2/mm/vmm64.h b/stage2/mm/vmm.h
similarity index 84%
rename from stage2/mm/vmm64.h
rename to stage2/mm/vmm.h
index a42511fc..fe265903 100644
--- a/stage2/mm/vmm64.h
+++ b/stage2/mm/vmm.h
@@ -1,5 +1,5 @@
-#ifndef __MM__VMM64_H__
-#define __MM__VMM64_H__
+#ifndef __MM__VMM_H__
+#define __MM__VMM_H__
 
 #include <stdint.h>
 
diff --git a/stage2/protos/stivale.c b/stage2/protos/stivale.c
index f6abde9f..64c178fc 100644
--- a/stage2/protos/stivale.c
+++ b/stage2/protos/stivale.c
@@ -14,7 +14,7 @@
 #include <lib/term.h>
 #include <sys/pic.h>
 #include <fs/file.h>
-#include <mm/vmm64.h>
+#include <mm/vmm.h>
 #include <mm/pmm.h>
 #include <stivale/stivale.h>
 
diff --git a/stage2/protos/stivale.h b/stage2/protos/stivale.h
index cba6fd31..7cf8e1a0 100644
--- a/stage2/protos/stivale.h
+++ b/stage2/protos/stivale.h
@@ -4,7 +4,7 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include <sys/e820.h>
-#include <mm/vmm64.h>
+#include <mm/vmm.h>
 
 void stivale_load(char *cmdline, int boot_drive);
 
diff --git a/stage2/lib/cio.h b/stage2/sys/cpu.h
similarity index 98%
rename from stage2/lib/cio.h
rename to stage2/sys/cpu.h
index 8c8842ca..732ab4f3 100644
--- a/stage2/lib/cio.h
+++ b/stage2/sys/cpu.h
@@ -1,5 +1,5 @@
-#ifndef __CIO_H__
-#define __CIO_H__
+#ifndef __SYS__CPU_H__
+#define __SYS__CPU_H__
 
 #include <stdint.h>
 
diff --git a/stage2/sys/e820.h b/stage2/sys/e820.h
index 7ee07683..525d33a2 100644
--- a/stage2/sys/e820.h
+++ b/stage2/sys/e820.h
@@ -1,5 +1,5 @@
-#ifndef __LIB__E820_H__
-#define __LIB__E820_H__
+#ifndef __SYS__E820_H__
+#define __SYS__E820_H__
 
 #include <stdint.h>
 #include <stddef.h>
diff --git a/stage2/sys/lapic.h b/stage2/sys/lapic.h
index 28e88f17..6142f7c2 100644
--- a/stage2/sys/lapic.h
+++ b/stage2/sys/lapic.h
@@ -1,9 +1,9 @@
-#ifndef __DRIVERS__APIC_H__
-#define __DRIVERS__APIC_H__
+#ifndef __SYS__APIC_H__
+#define __SYS__APIC_H__
 
 #include <stdint.h>
 #include <stddef.h>
-#include <lib/cio.h>
+#include <sys/cpu.h>
 
 #define LAPIC_REG_ICR0     0x300
 #define LAPIC_REG_ICR1     0x310
diff --git a/stage2/sys/pic.c b/stage2/sys/pic.c
index 3dda8932..d95e55e9 100644
--- a/stage2/sys/pic.c
+++ b/stage2/sys/pic.c
@@ -2,7 +2,7 @@
 #include <stdint.h>
 #include <stdbool.h>
 #include <sys/pic.h>
-#include <lib/cio.h>
+#include <sys/cpu.h>
 
 void pic_eoi(int irq) {
     if (irq >= 8) {
diff --git a/stage2/sys/pic.h b/stage2/sys/pic.h
index e4962bb6..6810c221 100644
--- a/stage2/sys/pic.h
+++ b/stage2/sys/pic.h
@@ -1,5 +1,5 @@
-#ifndef __DRIVERS__PIT_H__
-#define __DRIVERS__PIT_H__
+#ifndef __SYS__PIC_H__
+#define __SYS__PIC_H__
 
 #include <stdbool.h>
 
diff --git a/stage2/sys/smp.c b/stage2/sys/smp.c
index de60c559..4d7b4d0d 100644
--- a/stage2/sys/smp.c
+++ b/stage2/sys/smp.c
@@ -2,12 +2,12 @@
 #include <stdint.h>
 #include <stdbool.h>
 #include <lib/acpi.h>
-#include <lib/cio.h>
+#include <sys/cpu.h>
 #include <lib/blib.h>
 #include <lib/print.h>
 #include <sys/smp.h>
 #include <sys/lapic.h>
-#include <mm/vmm64.h>
+#include <mm/vmm.h>
 #include <mm/pmm.h>
 
 struct madt {
diff --git a/stage2/sys/smp.h b/stage2/sys/smp.h
index 30f26800..4e79c58d 100644
--- a/stage2/sys/smp.h
+++ b/stage2/sys/smp.h
@@ -1,10 +1,10 @@
-#ifndef __LIB__SMP_H__
-#define __LIB__SMP_H__
+#ifndef __SYS__SMP_H__
+#define __SYS__SMP_H__
 
 #include <stdint.h>
 #include <stddef.h>
 #include <stdbool.h>
-#include <mm/vmm64.h>
+#include <mm/vmm.h>
 
 struct smp_information {
     uint32_t acpi_processor_uid;
tab: 248 wrap: offon