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/src/OS_alloc.c | 4 ++-- arm9/lib/src/OS_arena.c | 4 ++-- arm9/lib/src/OS_protectionRegion.c | 26 ++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 arm9/lib/src/OS_protectionRegion.c (limited to 'arm9/lib/src') diff --git a/arm9/lib/src/OS_alloc.c b/arm9/lib/src/OS_alloc.c index 242c5571..e883656e 100644 --- a/arm9/lib/src/OS_alloc.c +++ b/arm9/lib/src/OS_alloc.c @@ -2,9 +2,9 @@ // Created by mart on 4/23/20. // #include "function_target.h" -#include "os_alloc.h" +#include "OS_alloc.h" #include "consts.h" -#include "os_system.h" +#include "OS_system.h" void* OSiHeapInfo[OS_ARENA_MAX]; diff --git a/arm9/lib/src/OS_arena.c b/arm9/lib/src/OS_arena.c index 58b338f1..eb04e60b 100644 --- a/arm9/lib/src/OS_arena.c +++ b/arm9/lib/src/OS_arena.c @@ -3,8 +3,8 @@ // #include "function_target.h" #include "consts.h" -#include "os_arena.h" -#include "os_protectionRegion.h" +#include "OS_arena.h" +#include "OS_protectionRegion.h" extern u32 OS_GetConsoleType(); extern BOOL OSi_MainExArenaEnabled; diff --git a/arm9/lib/src/OS_protectionRegion.c b/arm9/lib/src/OS_protectionRegion.c new file mode 100644 index 00000000..382310d9 --- /dev/null +++ b/arm9/lib/src/OS_protectionRegion.c @@ -0,0 +1,26 @@ +// +// Created by red031000 on 2020-04-24. +// + +#include "OS_protectionRegion.h" + +asm void OS_SetDPermissionsForProtectionRegion(register u32 setMask, register u32 flags) +{ + mrc p15, 0x0, r2, c5, c0, 0x2 + bic r2, r2, r0 + orr r2, r2, r1 + mcr p15, 0x0, r2, c5, c0, 0x2 + bx lr +} + +asm void OS_SetProtectionRegion1(u32 param) +{ + mcr p15, 0x0, r0, c6, c1, 0x0 + bx lr +} + +asm void OS_SetProtectionRegion2(u32 param) +{ + mcr p15, 0x0, r0, c6, c2, 0x0 + bx lr +} \ No newline at end of file -- cgit v1.2.3 From cfbc21f1c80061a2d211dc5da2e0d0eb0d532c5c Mon Sep 17 00:00:00 2001 From: red031000 Date: Fri, 1 May 2020 17:56:36 +0100 Subject: newline at end of file --- arm9/lib/src/OS_protectionRegion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arm9/lib/src') diff --git a/arm9/lib/src/OS_protectionRegion.c b/arm9/lib/src/OS_protectionRegion.c index 382310d9..230f8403 100644 --- a/arm9/lib/src/OS_protectionRegion.c +++ b/arm9/lib/src/OS_protectionRegion.c @@ -23,4 +23,4 @@ asm void OS_SetProtectionRegion2(u32 param) { mcr p15, 0x0, r0, c6, c2, 0x0 bx lr -} \ No newline at end of file +} -- cgit v1.2.3 From fa332326543d03fe6afdc0dcd04f0a666450955b Mon Sep 17 00:00:00 2001 From: red031000 Date: Fri, 1 May 2020 18:31:26 +0100 Subject: ARM_FUNC --- arm9/lib/src/OS_protectionRegion.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'arm9/lib/src') diff --git a/arm9/lib/src/OS_protectionRegion.c b/arm9/lib/src/OS_protectionRegion.c index 230f8403..4d6cf974 100644 --- a/arm9/lib/src/OS_protectionRegion.c +++ b/arm9/lib/src/OS_protectionRegion.c @@ -2,9 +2,10 @@ // Created by red031000 on 2020-04-24. // +#include "function_target.h" #include "OS_protectionRegion.h" -asm void OS_SetDPermissionsForProtectionRegion(register u32 setMask, register u32 flags) +ARM_FUNC asm void OS_SetDPermissionsForProtectionRegion(register u32 setMask, register u32 flags) { mrc p15, 0x0, r2, c5, c0, 0x2 bic r2, r2, r0 @@ -13,13 +14,13 @@ asm void OS_SetDPermissionsForProtectionRegion(register u32 setMask, register u3 bx lr } -asm void OS_SetProtectionRegion1(u32 param) +ARM_FUNC asm void OS_SetProtectionRegion1(u32 param) { mcr p15, 0x0, r0, c6, c1, 0x0 bx lr } -asm void OS_SetProtectionRegion2(u32 param) +ARM_FUNC asm void OS_SetProtectionRegion2(u32 param) { mcr p15, 0x0, r0, c6, c2, 0x0 bx lr -- cgit v1.2.3