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.h | 17 ----------------- arm9/lib/include/OS_init.h | 17 +++++++++++++++++ arm9/lib/include/OS_system.h | 13 +++++++++---- arm9/lib/include/consts.h | 8 +++++--- arm9/lib/include/nitro.h | 2 +- 5 files changed, 32 insertions(+), 25 deletions(-) delete mode 100644 arm9/lib/include/OS.h create mode 100644 arm9/lib/include/OS_init.h (limited to 'arm9/lib/include') diff --git a/arm9/lib/include/OS.h b/arm9/lib/include/OS.h deleted file mode 100644 index b152dfb8..00000000 --- a/arm9/lib/include/OS.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// Created by mart on 4/12/20. -// - -#ifndef POKEDIAMOND_OS_H -#define POKEDIAMOND_OS_H - -#include "types.h" -#include "consts.h" -#include "OS_protectionRegion.h" -#include "OS_arena.h" -#include "OS_alloc.h" -#include "OS_system.h" - -void OS_Init(); - -#endif //POKEDIAMOND_OS_H diff --git a/arm9/lib/include/OS_init.h b/arm9/lib/include/OS_init.h new file mode 100644 index 00000000..c556253a --- /dev/null +++ b/arm9/lib/include/OS_init.h @@ -0,0 +1,17 @@ +// +// Created by mart on 4/12/20. +// + +#ifndef POKEDIAMOND_OS_INIT_H +#define POKEDIAMOND_OS_INIT_H + +#include "types.h" +#include "consts.h" +#include "OS_protectionRegion.h" +#include "OS_arena.h" +#include "OS_alloc.h" +#include "OS_system.h" + +void OS_Init(); + +#endif //POKEDIAMOND_OS_INIT_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 diff --git a/arm9/lib/include/consts.h b/arm9/lib/include/consts.h index 6fc71be2..930f9af5 100644 --- a/arm9/lib/include/consts.h +++ b/arm9/lib/include/consts.h @@ -9,9 +9,9 @@ #define HW_PSR_CPU_MODE_MASK 0x1f // CPU mode -#define HW_PSR_FIQ_DISABLE 0x40 // Disable FIQ -#define HW_PSR_IRQ_DISABLE 0x80 // Disable IRQ -#define HW_PSR_IRQ_FIQ_DISABLE 0xc0 // Disable FIQ and IRQ +#define HW_PSR_DISABLE_FIQ 0x40 // Disable FIQ +#define HW_PSR_DISABLE_IRQ 0x80 // Disable IRQ +#define HW_PSR_DISABLE_IRQ_FIQ 0xc0 // Disable FIQ and IRQ #define HW_C6_PR_4KB 0x16 #define HW_C6_PR_8KB 0x18 @@ -42,4 +42,6 @@ #define OSi_TRUNC(n, a) (((u32) (n)) & ~((a) - 1)) #define OSi_ROUND(n, a) (((u32) (n) + (a) - 1) & ~((a) - 1)) +#define OS_IE_V_BLANK (1UL << 0) + #endif //POKEDIAMOND_CONSTS_H diff --git a/arm9/lib/include/nitro.h b/arm9/lib/include/nitro.h index 8d875653..f7397fb0 100644 --- a/arm9/lib/include/nitro.h +++ b/arm9/lib/include/nitro.h @@ -8,7 +8,7 @@ extern "C" { // Include all nitro files #include "types.h" #include "consts.h" -#include "OS.h" +#include "OS_init.h" #include "mmap.h" #ifdef __cplusplus -- 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') 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