summaryrefslogtreecommitdiff
path: root/arm9/lib/src
diff options
context:
space:
mode:
Diffstat (limited to 'arm9/lib/src')
-rw-r--r--arm9/lib/src/OS_protectionRegion.c12
-rw-r--r--arm9/lib/src/OS_protectionUnit.c12
-rw-r--r--arm9/lib/src/OS_tcm.c6
-rw-r--r--arm9/lib/src/OS_terminate_proc.c2
4 files changed, 10 insertions, 22 deletions
diff --git a/arm9/lib/src/OS_protectionRegion.c b/arm9/lib/src/OS_protectionRegion.c
index 4d6cf974..4b8d8297 100644
--- a/arm9/lib/src/OS_protectionRegion.c
+++ b/arm9/lib/src/OS_protectionRegion.c
@@ -1,27 +1,23 @@
-//
-// Created by red031000 on 2020-04-24.
-//
-
#include "function_target.h"
#include "OS_protectionRegion.h"
ARM_FUNC asm void OS_SetDPermissionsForProtectionRegion(register u32 setMask, register u32 flags)
{
- mrc p15, 0x0, r2, c5, c0, 0x2
+ mrc p15, 0x0, r2, c5, c0, 0x2 //Extended Access Permission Data Protection Region
bic r2, r2, r0
orr r2, r2, r1
- mcr p15, 0x0, r2, c5, c0, 0x2
+ mcr p15, 0x0, r2, c5, c0, 0x2 //Extended Access Permission Data Protection Region
bx lr
}
ARM_FUNC asm void OS_SetProtectionRegion1(u32 param)
{
- mcr p15, 0x0, r0, c6, c1, 0x0
+ mcr p15, 0x0, r0, c6, c1, 0x0 //Protection Unit Data Region 1
bx lr
}
ARM_FUNC asm void OS_SetProtectionRegion2(u32 param)
{
- mcr p15, 0x0, r0, c6, c2, 0x0
+ mcr p15, 0x0, r0, c6, c2, 0x0 //Protection Unit Data Region 2
bx lr
}
diff --git a/arm9/lib/src/OS_protectionUnit.c b/arm9/lib/src/OS_protectionUnit.c
index 6d3b7952..66811a1e 100644
--- a/arm9/lib/src/OS_protectionUnit.c
+++ b/arm9/lib/src/OS_protectionUnit.c
@@ -1,22 +1,18 @@
-//
-// Created by red031000 on 2020-05-24.
-//
-
#include "function_target.h"
#include "OS_protectionUnit.h"
ARM_FUNC asm void OS_EnableProtectionUnit(void)
{
- mrc p15, 0x0, r0, c1, c0, 0x0
+ mrc p15, 0x0, r0, c1, c0, 0x0 //Control Register
orr r0, r0, #0x1
- mcr p15, 0x0, r0, c1, c0, 0x0
+ mcr p15, 0x0, r0, c1, c0, 0x0 //Control Register
bx lr
}
ARM_FUNC asm void OS_DisableProtectionUnit(void)
{
- mrc p15, 0x0, r0, c1, c0, 0x0
+ mrc p15, 0x0, r0, c1, c0, 0x0 //Control Register
bic r0, r0, #0x1
- mcr p15, 0x0, r0, c1, c0, 0x0
+ mcr p15, 0x0, r0, c1, c0, 0x0 //Control Register
bx lr
}
diff --git a/arm9/lib/src/OS_tcm.c b/arm9/lib/src/OS_tcm.c
index fa06e345..5b6ab552 100644
--- a/arm9/lib/src/OS_tcm.c
+++ b/arm9/lib/src/OS_tcm.c
@@ -1,12 +1,8 @@
-//
-// Created by red031000 on 2020-05-05.
-//
-
#include "OS_tcm.h"
#include "function_target.h"
ARM_FUNC asm u32 OS_GetDTCMAddress(void) {
- mrc p15, 0x0, r0, c9, c1, 0x0
+ mrc p15, 0x0, r0, c9, c1, 0x0 //Data TCM Base
ldr r1, =OSi_TCM_REGION_BASE_MASK
and r0, r0, r1
bx lr
diff --git a/arm9/lib/src/OS_terminate_proc.c b/arm9/lib/src/OS_terminate_proc.c
index c86b85ab..2e5f3fb2 100644
--- a/arm9/lib/src/OS_terminate_proc.c
+++ b/arm9/lib/src/OS_terminate_proc.c
@@ -11,6 +11,6 @@ ARM_FUNC void OS_Terminate(void) {
ARM_FUNC asm void OS_Halt(void) {
mov r0, #0x0
- mcr p15, 0x0, r0, c7, c0, 0x4
+ mcr p15, 0x0, r0, c7, c0, 0x4 //Wait For Interrupt (Halt)
bx lr
}