From 4481ae56e80a3a425cfcbf81cd75ccc1619cdeaa Mon Sep 17 00:00:00 2001
From: Christian Cunningham <cc@localhost>
Date: Tue, 22 Mar 2022 19:50:12 -0700
Subject: Fixed testing

---
 src/exceptions/svc.S | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

(limited to 'src/exceptions')

diff --git a/src/exceptions/svc.S b/src/exceptions/svc.S
index f833b5b..ce3e556 100644
--- a/src/exceptions/svc.S
+++ b/src/exceptions/svc.S
@@ -6,11 +6,15 @@ svc:
 	// Get the SVC Exception #
 	ldr r0, [lr, #-4]
 	bic r0, #0xFF000000
-	cmp r0, #9
 	// Check it is within our defined SVC
+	cmp r0, #7
+	adrle r3, svc_table_1
+	ldrle pc, [r3, r0, LSL #2]
+	sub r0, #8
+	cmp r0, #7
 	bgt svc_exit
 	//// Jump to the appropriate Call
-	adr r3, svc_table
+	adr r3, svc_table_2
 	ldr pc, [r3, r0, LSL #2]
 svc_000000: // SYS_YIELD
 	bl yield
@@ -127,7 +131,7 @@ svc_000009: // SYS_TIME_2
 svc_exit:
 	ldmfd sp!, {r0-r12,pc}^
 
-svc_table:
+svc_table_1:
 	.word svc_000000
 	.word svc_000001
 	.word svc_000002
@@ -136,5 +140,6 @@ svc_table:
 	.word svc_000005
 	.word svc_000006
 	.word svc_000007
+svc_table_2:
 	.word svc_000008
 	.word svc_000009
-- 
cgit v1.2.1