From f04501a417999dddd7ec5963b90ab2e152ac3477 Mon Sep 17 00:00:00 2001 From: red031000 Date: Fri, 1 May 2020 17:54:04 +0100 Subject: match OS_protectionRegion --- arm9/lib/include/OS_system.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 arm9/lib/include/OS_system.h (limited to 'arm9/lib/include/OS_system.h') diff --git a/arm9/lib/include/OS_system.h b/arm9/lib/include/OS_system.h new file mode 100644 index 00000000..c7f121bd --- /dev/null +++ b/arm9/lib/include/OS_system.h @@ -0,0 +1,33 @@ +// +// 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_DISABLE = HW_PSR_IRQ_DISABLE, + OS_INTRMODE_ENABLE = 0 +} OSIntrMode; + +OSIntrMode OS_EnableInterrupts(); +OSIntrMode OS_DisableInterrupts(); +OSIntrMode OS_RestoreInterrupts(OSIntrMode state); +OSIntrMode OS_DisableInterrupts_IrqAndFiq(); +OSIntrMode OS_RestoreInterrupts_IrqAndFiq(OSIntrMode state); +OSProcMode OS_GetProcMode(); + + +#endif //POKEDIAMOND_OS_SYSTEM_H -- cgit v1.2.3 From 7b3404b932a8fadddb44774407b22127b0f02115 Mon Sep 17 00:00:00 2001 From: red031000 Date: Fri, 1 May 2020 20:10:48 +0100 Subject: remove include/nitro and shift everything to arm9/lib --- arm9/lib/include/OS_system.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'arm9/lib/include/OS_system.h') diff --git a/arm9/lib/include/OS_system.h b/arm9/lib/include/OS_system.h index c7f121bd..20228cbf 100644 --- a/arm9/lib/include/OS_system.h +++ b/arm9/lib/include/OS_system.h @@ -17,17 +17,22 @@ typedef enum { OS_PROCMODE_SYS=31 } OSProcMode; +#pragma enumsalwaysint on typedef enum { - OS_INTRMODE_DISABLE = HW_PSR_IRQ_DISABLE, + OS_INTRMODE_DISABLE_IRQ = HW_PSR_DISABLE_IRQ, + OS_INTRMODE_DISABLE_FIQ = HW_PSR_DISABLE_FIQ, OS_INTRMODE_ENABLE = 0 } OSIntrMode; +#pragma enumsalwaysint reset OSIntrMode OS_EnableInterrupts(); OSIntrMode OS_DisableInterrupts(); -OSIntrMode OS_RestoreInterrupts(OSIntrMode state); +OSIntrMode OS_RestoreInterrupts(register OSIntrMode state); OSIntrMode OS_DisableInterrupts_IrqAndFiq(); -OSIntrMode OS_RestoreInterrupts_IrqAndFiq(OSIntrMode state); +OSIntrMode OS_RestoreInterrupts_IrqAndFiq(register OSIntrMode state); +OSIntrMode OS_GetCpsrIrq(); OSProcMode OS_GetProcMode(); - +void OS_SpinWait(); +void OS_WaitVBlankIntr(); #endif //POKEDIAMOND_OS_SYSTEM_H -- cgit v1.2.3 From 527b257015fa32ac4007b1d7e9198ac37d8e1542 Mon Sep 17 00:00:00 2001 From: red031000 Date: Fri, 1 May 2020 20:38:36 +0100 Subject: macro and register --- arm9/lib/include/OS_system.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'arm9/lib/include/OS_system.h') diff --git a/arm9/lib/include/OS_system.h b/arm9/lib/include/OS_system.h index 20228cbf..93903315 100644 --- a/arm9/lib/include/OS_system.h +++ b/arm9/lib/include/OS_system.h @@ -17,19 +17,19 @@ typedef enum { OS_PROCMODE_SYS=31 } OSProcMode; -#pragma enumsalwaysint on +ENUMS_ALWAYS_INT_ON typedef enum { OS_INTRMODE_DISABLE_IRQ = HW_PSR_DISABLE_IRQ, OS_INTRMODE_DISABLE_FIQ = HW_PSR_DISABLE_FIQ, OS_INTRMODE_ENABLE = 0 } OSIntrMode; -#pragma enumsalwaysint reset +ENUMS_ALWAYS_INT_RESET OSIntrMode OS_EnableInterrupts(); OSIntrMode OS_DisableInterrupts(); -OSIntrMode OS_RestoreInterrupts(register OSIntrMode state); +OSIntrMode OS_RestoreInterrupts(OSIntrMode state); OSIntrMode OS_DisableInterrupts_IrqAndFiq(); -OSIntrMode OS_RestoreInterrupts_IrqAndFiq(register OSIntrMode state); +OSIntrMode OS_RestoreInterrupts_IrqAndFiq(OSIntrMode state); OSIntrMode OS_GetCpsrIrq(); OSProcMode OS_GetProcMode(); void OS_SpinWait(); -- cgit v1.2.3