layout boot-stage framework for aa64
[lunaix-os.git] / lunaix-os / arch / aarch64 / includes / sys / cpu.h
diff --git a/lunaix-os/arch/aarch64/includes/sys/cpu.h b/lunaix-os/arch/aarch64/includes/sys/cpu.h
new file mode 100644 (file)
index 0000000..8ed9849
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef __LUNAIX_AA64_CPU_H
+#define __LUNAIX_AA64_CPU_H
+
+#include <sys/msrs.h>
+
+void
+cpu_trap_sched();
+
+static inline void
+cpu_enable_interrupt()
+{
+    set_sysreg(ALLINT_EL1, 0);
+}
+
+static inline void
+cpu_disable_interrupt()
+{
+    set_sysreg(ALLINT_EL1, 1 << 12);
+}
+
+#endif /* __LUNAIX_AA64_CPU_H */