Moved the mcfg definition to acpi.h and added pcie.c and pcie.h in preparation for pcie support
5 files changed, 62 insertions(+), 14 deletions(-)

M kernel/inc/acpi.h
A => kernel/inc/pcie.h
M kernel/meson.build
M kernel/src/acpi.c
A => kernel/src/pcie.c
M kernel/inc/acpi.h +14 -0
@@ 91,6 91,20 @@ struct madt_apic_addr_override {
 	uint64_t apic_addr;
 } __attribute__((packed));
 
+struct mcfg_entry {
+	uint64_t base_addr;
+	uint16_t segment;
+	uint8_t start_bus;
+	uint8_t end_bus;
+	uint32_t padding;
+} __attribute__((packed));
+
+struct mcfg {
+	struct sdt header;
+	uint64_t padding;
+	struct mcfg_entry entries[];
+} __attribute__((packed));
+
 void acpi_init(EFI_SYSTEM_TABLE* system_table);
 
 uint32_t acpi_timer_get(void);

          
A => kernel/inc/pcie.h +25 -0
@@ 0,0 1,25 @@ 
+/*
+ *  Copyright (C) 2021 Scoopta
+ *  This file is part of NekOS
+ *  NekOS is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    NekOS is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with NekOS.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef PCIE_H
+#define PCIE_H
+
+#include <acpi.h>
+
+void pcie_init(struct mcfg* mcfg);
+
+#endif

          
M kernel/meson.build +1 -0
@@ 27,6 27,7 @@ executable(meson.project_name(),
 'src/oops.S',
 'src/paging.c',
 'src/panic.S',
+'src/pcie.c',
 'src/ppm.c',
 'src/printf.c',
 'src/syscall_entry.S',

          
M kernel/src/acpi.c +0 -14
@@ 178,20 178,6 @@ struct dsdt {
 	uint8_t aml[];
 } __attribute__((packed));
 
-struct mcfg_entry {
-	uint64_t base_addr;
-	uint16_t segment;
-	uint8_t start_bus;
-	uint8_t end_bus;
-	uint32_t padding;
-} __attribute__((packed));
-
-struct mcfg {
-	struct sdt header;
-	uint64_t padding;
-	struct mcfg_entry entries[];
-} __attribute__((packed));
-
 static struct rsdp2* acpi_table;
 static struct xsdt* xsdt;
 static struct fadt* fadt;

          
A => kernel/src/pcie.c +22 -0
@@ 0,0 1,22 @@ 
+/*
+ *  Copyright (C) 2021 Scoopta
+ *  This file is part of NekOS
+ *  NekOS is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    NekOS is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with NekOS.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <pcie.h>
+
+void pcie_init(struct mcfg* mcfg) {
+
+}