diff options
author | Martmists <mail@martmists.com> | 2020-05-01 19:44:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-01 19:44:04 +0200 |
commit | e370125c3e2e34936152768c40bd932b88690baa (patch) | |
tree | 85e8314866f65fb95e62a66b029ab5eeca55e994 /arm9/lib/src/OS_protectionRegion.c | |
parent | 10b569f131fc58959d7c50dd4b07f01a52b5e162 (diff) | |
parent | fa332326543d03fe6afdc0dcd04f0a666450955b (diff) |
Merge pull request #51 from red031000/master
match OS_protectionRegion
Diffstat (limited to 'arm9/lib/src/OS_protectionRegion.c')
-rw-r--r-- | arm9/lib/src/OS_protectionRegion.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arm9/lib/src/OS_protectionRegion.c b/arm9/lib/src/OS_protectionRegion.c new file mode 100644 index 00000000..4d6cf974 --- /dev/null +++ b/arm9/lib/src/OS_protectionRegion.c @@ -0,0 +1,27 @@ +// +// 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 + bic r2, r2, r0 + orr r2, r2, r1 + mcr p15, 0x0, r2, c5, c0, 0x2 + bx lr +} + +ARM_FUNC asm void OS_SetProtectionRegion1(u32 param) +{ + mcr p15, 0x0, r0, c6, c1, 0x0 + bx lr +} + +ARM_FUNC asm void OS_SetProtectionRegion2(u32 param) +{ + mcr p15, 0x0, r0, c6, c2, 0x0 + bx lr +} |