From 45f420a338ea02225bb8a98c9aca5eed8d6a23ae Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Sun, 2 Jun 2024 00:26:57 +0200 Subject: Initial commit --- kernel/cpu.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 kernel/cpu.h (limited to 'kernel/cpu.h') 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]; +} -- cgit