BarryServer : Git

All the code for all my projects
// BarryServer : Git / Nucleus / commit / acd091571545e40dc85fc691d9d0b12cf4d363ee / include

// Related

Nucleus

Barry Initialise ACPI later acd0915 (3 years, 3 months ago)
diff --git a/include/io.h b/include/io.h
index ec0abcf..e0204fd 100644
--- a/include/io.h
+++ b/include/io.h
@@ -1,5 +1,5 @@
-#ifndef KERNEL_IO_H
-#define KERNEL_IO_H
+#ifndef _IO_H
+#define _IO_H
 
 #include <stdint.h>
 #include <stddef.h>
diff --git a/include/nucleus/cpu.h b/include/nucleus/cpu.h
index 8ed1f43..88c7506 100644
--- a/include/nucleus/cpu.h
+++ b/include/nucleus/cpu.h
@@ -13,12 +13,14 @@ struct InterruptFrame {
 typedef void (*exc_handler_t)(struct InterruptFrame *, uint32_t);
 typedef void (*int_handler_t)(struct InterruptFrame *);
 
+extern int apic;
+
 extern uintptr_t lapicPtr, ioapicPtr;
 #define LAPIC(off)  (*((uint32_t *) ((uint32_t)  lapicPtr + (off))))
 #define IOAPIC(off) (*((uint32_t *) ((uint32_t) ioapicPtr + (off))))
 
 extern cpu_t lapicNums[];
-#define CPUID lapicNums[(cpu_t) (LAPIC(0x20) >> 24)]
+#define CPUID (apic ? lapicNums[(cpu_t) (LAPIC(0x20) >> 24)] : 0)
 #define MAX_CPUS 2
 
 /* Push/pop interrupts */