summaryrefslogtreecommitdiff
path: root/arm9/lib/src/OS_protectionUnit.c
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2020-05-26 09:42:03 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2020-05-26 09:42:03 -0400
commit8c8a5a07c5e6b1a2d0d0592a30be31ccd140fc1e (patch)
treec23120a706d012bd19c4c2584af5009fd2016ecf /arm9/lib/src/OS_protectionUnit.c
parente643eddc0def8e4851a4195e8ed4de06c847f52d (diff)
parent227da51c377f621f542ffdb52ef56bfb807f29ab (diff)
Merge branch 'master' of github.com:martmists/pokediamond into pikalax_work
Diffstat (limited to 'arm9/lib/src/OS_protectionUnit.c')
-rw-r--r--arm9/lib/src/OS_protectionUnit.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arm9/lib/src/OS_protectionUnit.c b/arm9/lib/src/OS_protectionUnit.c
new file mode 100644
index 00000000..6d3b7952
--- /dev/null
+++ b/arm9/lib/src/OS_protectionUnit.c
@@ -0,0 +1,22 @@
+//
+// 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
+ orr r0, r0, #0x1
+ mcr p15, 0x0, r0, c1, c0, 0x0
+ bx lr
+}
+
+ARM_FUNC asm void OS_DisableProtectionUnit(void)
+{
+ mrc p15, 0x0, r0, c1, c0, 0x0
+ bic r0, r0, #0x1
+ mcr p15, 0x0, r0, c1, c0, 0x0
+ bx lr
+}