diff options
author | Christian Cunningham <cc@localhost> | 2022-03-22 19:50:12 -0700 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2022-03-22 19:50:12 -0700 |
commit | 4481ae56e80a3a425cfcbf81cd75ccc1619cdeaa (patch) | |
tree | dfa856c0f505972bf7ac63f7fdb5dc63730d4f42 | |
parent | 43f236af3a8ac12c005a53d92cc03e87c402b316 (diff) |
Fixed testing
-rw-r--r-- | src/exceptions/svc.S | 11 | ||||
-rw-r--r-- | src/tests/test.c | 25 |
2 files changed, 8 insertions, 28 deletions
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 diff --git a/src/tests/test.c b/src/tests/test.c index c3e5c83..b6ba5d3 100644 --- a/src/tests/test.c +++ b/src/tests/test.c @@ -41,31 +41,6 @@ void test_entry(void) // Test 1: Tracing Time dt = 0; - ti = 0; - tf = 0; - int t1, t2; - for(int i = 0; i < TEST_COUNT; i++) { - sys0_32(SYS_TIME_2, &tf); - sys0_32(SYS_TIME_2, &ti); - dt += tf-ti; - if ((tf-ti) < TEST_BIN_COUNT) { - bins[(tf-ti)]++; - } - } - for (int i = 0; i < TEST_BIN_COUNT; i++) { - draw_hex32(tidx, y+6+i, i); - draw_string(tidx+9, y+6+i, TEST_STR_CLR); - draw_u10(tidx+9, y+6+i, bins[i]); - bins[i] = 0; - } - draw_string(tidx, y+5, " "); - len = draw_u10(tidx, y+5, dt/TEST_COUNT); - draw_u10(tidx+len+1, y+5, dt%TEST_COUNT); - tidx += TEST_RESULT_WIDTH; - draw_hex32(0, y-1, nextpid); - - // Test 1: Tracing Time - dt = 0; for(int i = 0; i < TEST_COUNT; i++) { sys0_32(SYS_TIME_2, &tf); sys0_32(SYS_TIME_2, &ti); |