summaryrefslogtreecommitdiff
path: root/kernel/cpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/cpu.h')
-rw-r--r--kernel/cpu.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/kernel/cpu.h b/kernel/cpu.h
new file mode 100644
index 0000000..10acf76
--- /dev/null
+++ b/kernel/cpu.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#include "kernel/lib.h"
+
+#define MAX_CPU 16
+
+struct Cpu
+{
+ uint32_t id;
+
+ uint32_t intr_off_count;
+ bool intr_enabled_before_off;
+};
+typedef struct Cpu Cpu;
+
+extern Cpu cpus[MAX_CPU];
+
+static inline Cpu* current_cpu()
+{
+ // @Todo current_cpu, better
+ return &cpus[0];
+}