summaryrefslogtreecommitdiff
path: root/arm9/lib/include/os_system.h
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2020-04-30 20:13:36 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2020-04-30 20:13:36 -0400
commit6c3731902319116e8e73b14e2b75d5fd8c9642ff (patch)
tree72b3ac0553ea193e69c70325bcdb5579d263e211 /arm9/lib/include/os_system.h
parent70dcdeff9aaeae583be70cdd7371b6b8a5fe6076 (diff)
parent081bd6efce613ed078407ab8fd24765275385f9f (diff)
Merge branch 'master' of https://github.com/martmists/pokediamond into pikalax_work
Diffstat (limited to 'arm9/lib/include/os_system.h')
-rw-r--r--arm9/lib/include/os_system.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/arm9/lib/include/os_system.h b/arm9/lib/include/os_system.h
new file mode 100644
index 00000000..fc6a2f81
--- /dev/null
+++ b/arm9/lib/include/os_system.h
@@ -0,0 +1,44 @@
+//
+// Created by mart on 4/23/20.
+//
+
+#ifndef POKEDIAMOND_OS_SYSTEM_H
+#define POKEDIAMOND_OS_SYSTEM_H
+
+#include "consts.h"
+
+typedef enum {
+ OS_PROCMODE_USER=16,
+ OS_PROCMODE_FIQ=17,
+ OS_PROCMODE_IRQ=18,
+ OS_PROCMODE_SVC=19,
+ OS_PROCMODE_ABORT=23,
+ OS_PROCMODE_UNDEF=27,
+ OS_PROCMODE_SYS=31
+} OSProcMode;
+
+typedef enum {
+ OS_INTRMODE_IRQ_DISABLE = HW_PSR_IRQ_DISABLE,
+ OS_INTRMODE_IRQ_ENABLE = 0
+} OSIntrMode_Irq;
+
+typedef enum {
+ OS_INTRMODE_FIQ_DISABLE = HW_PSR_FIQ_DISABLE,
+ OS_INTRMODE_FIQ_ENABLE = 0
+} OSIntrMode_Fiq;
+
+typedef union {
+ OSIntrMode_Fiq mode_fiq;
+ OSIntrMode_Irq mode_irq;
+} OSIntrMode;
+
+OSIntrMode OS_EnableInterrupts();
+OSIntrMode OS_DisableInterrupts();
+OSIntrMode OS_RestoreInterrupts(OSIntrMode state);
+OSIntrMode OS_DisableInterrupts_IrqAndFiq();
+OSIntrMode OS_RestoreInterrupts_IrqAndFiq(OSIntrMode state);
+OSIntrMode_Irq OS_GetCpsrIrq();
+OSProcMode OS_GetProcMode();
+
+
+#endif //POKEDIAMOND_OS_SYSTEM_H