aboutsummaryrefslogtreecommitdiff
path: root/kernel/sys
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-03-24 18:59:26 -0700
committerChristian Cunningham <cc@localhost>2022-03-24 18:59:45 -0700
commit180dfed61505cfe944755f7078d7b29063ea7734 (patch)
treec676af11f12f94121c763e55e2b10fc8017ec669 /kernel/sys
parent7753da66d7d72f441dadd76f357fd5ceb50e7c8f (diff)
Allow access to CNTPCT from user mode
Diffstat (limited to 'kernel/sys')
-rw-r--r--kernel/sys/kernel.S5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/sys/kernel.S b/kernel/sys/kernel.S
index 71b22a1..df55cc1 100644
--- a/kernel/sys/kernel.S
+++ b/kernel/sys/kernel.S
@@ -19,6 +19,11 @@ kernel_main:
mov r0, #0x80000000
mcr p15, 0, r0, c9, c12, 1
+ // Allow access to CNTKCTL from PL0
+ mrc p15, 0, r0, c14, c1, 0
+ orr r0, #1
+ mcr p15, 0, r0, c14, c1, 0
+
// Intentional undefined instruction
// .word 0xf7f0a000
cpsie ai, #0x10