From 9c0cb4e1f7df02f24751833b384963917bbf2360 Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Sat, 22 Jan 2022 22:21:24 -0700 Subject: Fixed some stuff --- README.md | 2 +- src/boot.S | 4 ++-- src/cpu/irq.c | 2 +- src/sys/schedule.S | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9d7f1bc..e10b6ca 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ - FIX IRQ Stack LEAK - FIX IRQ Stack LEAK - FIX IRQ Stack LEAK -- Implement Scheduler for IRQ +- Implement Lock for accessing thread information - Fix mutex with scheduler - Implement handlers - Put threads in user mode diff --git a/src/boot.S b/src/boot.S index 2106031..94de57f 100644 --- a/src/boot.S +++ b/src/boot.S @@ -174,10 +174,10 @@ fiq: bne 1f ldmfd sp!, {r0-r12,lr} sub lr, #4 - stmfd sp!, {r0-r12,lr} + push {r3} ldr r3, =irqlr str lr, [r3, #0] - ldmfd sp!, {r0-r12,lr} + pop {r3} cps #0x13 b schedule 1: diff --git a/src/cpu/irq.c b/src/cpu/irq.c index 10f8583..0ddba2b 100644 --- a/src/cpu/irq.c +++ b/src/cpu/irq.c @@ -233,7 +233,7 @@ void localtest(void) { //struct Thread* t = scheduler.rthread_ll->data; uart_string("Running IRQ Task...\n"); - uart_scheduler(); + //uart_scheduler(); //uart_10(t->data.pid); //uart_char('\n'); uart_string("Finished!\n"); diff --git a/src/sys/schedule.S b/src/sys/schedule.S index 6b6ef1c..a4c07c4 100644 --- a/src/sys/schedule.S +++ b/src/sys/schedule.S @@ -6,8 +6,8 @@ .macro preserve_ctx cps #0x1f // Sys mode // Store Usr regs - stmfd sp!, {r0-r12} - stmfd sp!, {lr} + push {r0-r12} + push {lr} ldr r3, =scheduler // struct Scheduler ldr r2, [r3, #0] // struct Thread* rthread str lr, [r2, #0] // svc_lr -> void* pc @@ -23,8 +23,8 @@ cps #0x1f // Sys mode mov sp, r0 // Set stack pointer // Restore Usr regs - ldmfd sp!, {lr} - ldmfd sp!, {r0-r12} + pop {lr} + pop {r0-r12} cps #0x13 // Svc mode .endm -- cgit v1.2.1