aboutsummaryrefslogtreecommitdiff
path: root/src/exceptions
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-02-01 19:39:36 -0700
committerChristian Cunningham <cc@localhost>2022-02-01 19:39:36 -0700
commit98793badc1c1d3e4bfd735fdecd3d2d731701ab3 (patch)
tree3406220e55b0e7cce3895817796f75bf754da6d9 /src/exceptions
parent33e35caf1104cdf5b8e1470112677f78b5e8dc59 (diff)
Syscall to get timer value
Diffstat (limited to 'src/exceptions')
-rw-r--r--src/exceptions/svc.S6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/exceptions/svc.S b/src/exceptions/svc.S
index d1fcbc0..51c6479 100644
--- a/src/exceptions/svc.S
+++ b/src/exceptions/svc.S
@@ -18,6 +18,12 @@ svc_000000:
cps #0x13
b svc_exit
svc_000001:
+ mov r2, #0x3004
+ movt r2, #0x3F00
+ ldr r0, [r2, #4] // <- SYS_TIMER_CLO
+ ldr r1, [r2, #0] // <- SYS_TIMER_CHI
+ str r0, [sp] // Return value
+ str r1, [sp, #4] // Return value hi
b svc_exit
svc_000002:
ldmfd sp!, {r0-r12,lr}