summaryrefslogtreecommitdiff
path: root/arm9/lib/src
diff options
context:
space:
mode:
authorred031000 <rubenru09@aol.com>2020-05-24 18:20:52 +0100
committerred031000 <rubenru09@aol.com>2020-05-24 18:20:52 +0100
commitf5020bf1a7c5a1fe1fcd35a86d2e33794ba621a4 (patch)
treea34a9c9b40525cfdcb85460e054d897e160a7c9a /arm9/lib/src
parent0dfb0011dd9d7e485ecbc8727f71d2f82b946930 (diff)
cleanup OS
Diffstat (limited to 'arm9/lib/src')
-rw-r--r--arm9/lib/src/OS_arena.c26
-rw-r--r--arm9/lib/src/OS_emulator.c6
-rw-r--r--arm9/lib/src/OS_init.c18
-rw-r--r--arm9/lib/src/OS_interrupt.c2
-rw-r--r--arm9/lib/src/OS_system.c14
-rw-r--r--arm9/lib/src/OS_tcm.c2
-rw-r--r--arm9/lib/src/OS_terminate_proc.c4
7 files changed, 36 insertions, 36 deletions
diff --git a/arm9/lib/src/OS_arena.c b/arm9/lib/src/OS_arena.c
index 31796771..9e7d3223 100644
--- a/arm9/lib/src/OS_arena.c
+++ b/arm9/lib/src/OS_arena.c
@@ -17,7 +17,7 @@ extern void SDK_SECTION_ARENA_DTCM_START(); // TODO: technically this should be
extern void SDK_IRQ_STACKSIZE(); // TODO: technically this should be defined in the lcf
extern void SDK_SYS_STACKSIZE(); // TODO: technically this should be defined in the lcf
-ARM_FUNC void OS_InitArena() {
+ARM_FUNC void OS_InitArena(void) {
if (OSi_Initialized) {
return;
}
@@ -42,7 +42,7 @@ ARM_FUNC void OS_InitArena() {
OS_SetArenaLo(OS_ARENA_WRAM_MAIN, OS_GetInitArenaLo(OS_ARENA_WRAM_MAIN));
}
-ARM_FUNC void OS_InitArenaEx() {
+ARM_FUNC void OS_InitArenaEx(void) {
OS_SetArenaHi(2, OS_GetInitArenaHi(OS_ARENA_MAINEX));
OS_SetArenaLo(2, OS_GetInitArenaLo(OS_ARENA_MAINEX));
@@ -73,22 +73,22 @@ ARM_FUNC void* OS_GetInitArenaHi(OSArenaId id) {
case OS_ARENA_ITCM:
return (void *)HW_ITCM_ARENA_HI_DEFAULT;
case OS_ARENA_DTCM:
- u32 irqStackLo = (u32)HW_DTCM_IRQ_STACK_END - (s32)SDK_IRQ_STACKSIZE;
+ {
+ u32 irqStackLo = (u32) HW_DTCM_IRQ_STACK_END - (s32) SDK_IRQ_STACKSIZE;
u32 sysStackLo;
- if (!(s32)SDK_SYS_STACKSIZE) {
+ if (!(s32) SDK_SYS_STACKSIZE) {
sysStackLo = HW_DTCM;
- if (sysStackLo < (u32)SDK_SECTION_ARENA_DTCM_START) {
- sysStackLo = (u32)SDK_SECTION_ARENA_DTCM_START;
+ if (sysStackLo < (u32) SDK_SECTION_ARENA_DTCM_START) {
+ sysStackLo = (u32) SDK_SECTION_ARENA_DTCM_START;
}
+ } else if ((s32) SDK_SYS_STACKSIZE < 0) {
+ sysStackLo = (u32) SDK_SECTION_ARENA_DTCM_START - (s32) SDK_SYS_STACKSIZE;
+ } else {
+ sysStackLo = irqStackLo - (s32) SDK_SYS_STACKSIZE;
}
- else if ((s32)SDK_SYS_STACKSIZE < 0) {
- sysStackLo = (u32)SDK_SECTION_ARENA_DTCM_START - (s32)SDK_SYS_STACKSIZE;
- }
- else {
- sysStackLo = irqStackLo - (s32)SDK_SYS_STACKSIZE;
- }
- return (void*)sysStackLo;
+ return (void *) sysStackLo;
+ }
case OS_ARENA_SHARED:
return (void *)HW_SHARED_ARENA_HI_DEFAULT;
case OS_ARENA_WRAM_MAIN:
diff --git a/arm9/lib/src/OS_emulator.c b/arm9/lib/src/OS_emulator.c
index c138b2bc..e92a7d9d 100644
--- a/arm9/lib/src/OS_emulator.c
+++ b/arm9/lib/src/OS_emulator.c
@@ -5,13 +5,13 @@
#include "OS_emulator.h"
#include "function_target.h"
-u32 OSi_ConsoleTypeCache = -1u; //todo fix bss
+u32 OSi_ConsoleTypeCache = -1u;
-ARM_FUNC BOOL OS_IsRunOnEmulator() {
+ARM_FUNC BOOL OS_IsRunOnEmulator(void) {
return FALSE;
}
-ARM_FUNC u32 OS_GetConsoleType() {
+ARM_FUNC u32 OS_GetConsoleType(void) {
OSi_ConsoleTypeCache = OS_CONSOLE_NITRO | OS_CONSOLE_DEV_CARD | OS_CONSOLE_SIZE_4MB;
return OSi_ConsoleTypeCache;
diff --git a/arm9/lib/src/OS_init.c b/arm9/lib/src/OS_init.c
index a34196f4..e1c7e63a 100644
--- a/arm9/lib/src/OS_init.c
+++ b/arm9/lib/src/OS_init.c
@@ -5,15 +5,15 @@
#include "function_target.h"
#include "OS_init.h"
-extern void PXI_Init();
-extern void OS_InitException();
-extern void MI_Init();
-extern void OS_InitVAlarm();
-extern void OSi_InitVramExclusive();
-extern void OS_InitThread();
-extern void CTRDG_Init();
-extern void CARD_Init();
-extern void PM_Init();
+extern void PXI_Init(void);
+extern void OS_InitException(void);
+extern void MI_Init(void);
+extern void OS_InitVAlarm(void);
+extern void OSi_InitVramExclusive(void);
+extern void OS_InitThread(void);
+extern void CTRDG_Init(void);
+extern void CARD_Init(void);
+extern void PM_Init(void);
ARM_FUNC void OS_Init(void) {
OS_InitArena();
diff --git a/arm9/lib/src/OS_interrupt.c b/arm9/lib/src/OS_interrupt.c
index 76deb069..4692fd54 100644
--- a/arm9/lib/src/OS_interrupt.c
+++ b/arm9/lib/src/OS_interrupt.c
@@ -11,7 +11,7 @@
extern OSThreadQueue OSi_IrqThreadQueue;
-ARM_FUNC void OS_InitIrqTable() {
+ARM_FUNC void OS_InitIrqTable(void) {
OS_InitThreadQueue(&OSi_IrqThreadQueue);
}
diff --git a/arm9/lib/src/OS_system.c b/arm9/lib/src/OS_system.c
index 5379433b..1d257679 100644
--- a/arm9/lib/src/OS_system.c
+++ b/arm9/lib/src/OS_system.c
@@ -5,7 +5,7 @@
#include "OS_system.h"
#include "syscall.h"
-ARM_FUNC asm OSIntrMode OS_EnableInterrupts() {
+ARM_FUNC asm OSIntrMode OS_EnableInterrupts(void) {
mrs r0, cpsr
bic r1, r0, #HW_PSR_DISABLE_IRQ
msr cpsr_c, r1
@@ -13,7 +13,7 @@ ARM_FUNC asm OSIntrMode OS_EnableInterrupts() {
bx lr
}
-ARM_FUNC asm OSIntrMode OS_DisableInterrupts() {
+ARM_FUNC asm OSIntrMode OS_DisableInterrupts(void) {
mrs r0, cpsr
orr r1, r0, #HW_PSR_DISABLE_IRQ
msr cpsr_c, r1
@@ -30,7 +30,7 @@ ARM_FUNC asm OSIntrMode OS_RestoreInterrupts(OSIntrMode state) {
bx lr
}
-ARM_FUNC asm OSIntrMode OS_DisableInterrupts_IrqAndFiq() {
+ARM_FUNC asm OSIntrMode OS_DisableInterrupts_IrqAndFiq(void) {
mrs r0, cpsr
orr r1, r0, #HW_PSR_DISABLE_IRQ_FIQ
msr cpsr_c, r1
@@ -47,25 +47,25 @@ ARM_FUNC asm OSIntrMode OS_RestoreInterrupts_IrqAndFiq(OSIntrMode state) {
bx lr
}
-ARM_FUNC asm OSIntrMode OS_GetCpsrIrq() {
+ARM_FUNC asm OSIntrMode OS_GetCpsrIrq(void) {
mrs r0, cpsr
and r0, r0, #HW_PSR_DISABLE_IRQ
bx lr
}
-ARM_FUNC asm OSProcMode OS_GetProcMode() {
+ARM_FUNC asm OSProcMode OS_GetProcMode(void) {
mrs r0, cpsr
and r0, r0, #HW_PSR_CPU_MODE_MASK
bx lr
}
-ARM_FUNC asm void OS_SpinWait() {
+ARM_FUNC asm void OS_SpinWait(void) {
subs r0, r0, #0x4
bhs OS_SpinWait
bx lr
}
-ARM_FUNC void OS_WaitVBlankIntr() {
+ARM_FUNC void OS_WaitVBlankIntr(void) {
SVC_WaitByLoop(0x1);
OS_WaitIrq(TRUE, OS_IE_V_BLANK);
}
diff --git a/arm9/lib/src/OS_tcm.c b/arm9/lib/src/OS_tcm.c
index 5a168c58..fa06e345 100644
--- a/arm9/lib/src/OS_tcm.c
+++ b/arm9/lib/src/OS_tcm.c
@@ -5,7 +5,7 @@
#include "OS_tcm.h"
#include "function_target.h"
-ARM_FUNC asm u32 OS_GetDTCMAddress() {
+ARM_FUNC asm u32 OS_GetDTCMAddress(void) {
mrc p15, 0x0, r0, c9, c1, 0x0
ldr r1, =OSi_TCM_REGION_BASE_MASK
and r0, r0, r1
diff --git a/arm9/lib/src/OS_terminate_proc.c b/arm9/lib/src/OS_terminate_proc.c
index eb267c6b..40b015d9 100644
--- a/arm9/lib/src/OS_terminate_proc.c
+++ b/arm9/lib/src/OS_terminate_proc.c
@@ -7,14 +7,14 @@
#include "function_target.h"
#include "OS_system.h"
-ARM_FUNC void OS_Terminate() {
+ARM_FUNC void OS_Terminate(void) {
while (TRUE) {
(void)OS_DisableInterrupts();
OS_Halt();
}
}
-ARM_FUNC asm void OS_Halt() {
+ARM_FUNC asm void OS_Halt(void) {
mov r0, #0x0
mcr p15, 0x0, r0, c7, c0, 0x4
bx lr