aboutsummaryrefslogtreecommitdiff
path: root/src/exceptions
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-03-10 20:01:25 -0800
committerChristian Cunningham <cc@localhost>2022-03-10 20:01:25 -0800
commitad9e577e8b2f6431d48a6a64fd95aff432e48441 (patch)
tree598ade41d70d616cf0891855732c0957835cd465 /src/exceptions
parent0d80865f669c2314c905f94a4117300a33338792 (diff)
More Deterministic
Diffstat (limited to 'src/exceptions')
-rw-r--r--src/exceptions/svc.S18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/exceptions/svc.S b/src/exceptions/svc.S
index c23df82..1b0cc1f 100644
--- a/src/exceptions/svc.S
+++ b/src/exceptions/svc.S
@@ -33,22 +33,14 @@ svc_000001: // Get time
svc_000002: // Run Schedule
ldmfd sp!, {r0-r12,lr}
b schedule
-svc_000003: // Clean task stack
+svc_000003: // Free Thread in Table
ldr r3, =scheduler
ldr r2, [r3, #0] // struct Thread* rthread
- ldr r1, [r2, #8] // sp_base
- cmp r1, #-1
- beq svc_exit
- ldr r3, =stacks_table
+ ldr r1, [r2, #0x1c] // thread offset
mov r0, #0
- strb r0, [r3, r1]
- // Free the thread after freeing the stack
- mov r0, r2
- bl kfree
- ldr r3, =sched_stack_count
- ldr r2, [r3]
- sub r2, #1
- str r2, [r3]
+ ldr r2, =thread_table
+ add r2, r1
+ str r0, [r2]
b svc_exit
svc_000004: // Lock Lock (usr_r0 = struct Lock*)
ldr r3, =scheduler