aboutsummaryrefslogtreecommitdiff
path: root/src/exceptions
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-03-22 13:40:21 -0700
committerChristian Cunningham <cc@localhost>2022-03-22 13:40:21 -0700
commit0e6cb270e73977847ba26b132c6b659040aaa342 (patch)
tree173bfe015691912640bf9ba200cd3f6473c14cf6 /src/exceptions
parente0942a769925bae81c2355e9a98f577cc6763930 (diff)
Multiple semaphore increment
Diffstat (limited to 'src/exceptions')
-rw-r--r--src/exceptions/svc.S17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/exceptions/svc.S b/src/exceptions/svc.S
index 86f61c0..fdfe391 100644
--- a/src/exceptions/svc.S
+++ b/src/exceptions/svc.S
@@ -100,6 +100,22 @@ svc_000007: // Semaphore increase
dmb
cmp r1, #1
bne svc_exit
+ mov r1, #1
+ bl sched_semaphore_resurrect
+ ldmfd sp!, {r0-r12,lr}
+ b schedule
+ b svc_exit
+svc_000008: // Semaphore add #
+ ldr r0, [sp, #0] // struct Semaphore* s
+ ldr r3, [sp, #1] // unsigned long # times to increase
+1: clrex
+ ldrex r2, [r0, #0]
+ add r1, r2, #1
+ strexeq r2, r1, [r0, #0]
+ teq r2, #0
+ bne 1b
+ dmb
+ mov r1, r3
bl sched_semaphore_resurrect
ldmfd sp!, {r0-r12,lr}
b schedule
@@ -116,3 +132,4 @@ svc_table:
.word svc_000005
.word svc_000006
.word svc_000007
+ .word svc_000008