aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-03-18 13:21:06 -0700
committerChristian Cunningham <cc@localhost>2022-03-18 13:21:06 -0700
commit74f95c5696335b02d768815fea2940bf089d057f (patch)
tree67910ed837cab2ccd59507b94b0dc204d3279fa4
parent94f2b0b8f48f5715975446c637a078008fb7e941 (diff)
Fixed Mutex Locking bug
-rw-r--r--src/cpu/irq.c1
-rw-r--r--src/sys/schedule.c4
-rw-r--r--src/tests/test.c4
3 files changed, 5 insertions, 4 deletions
diff --git a/src/cpu/irq.c b/src/cpu/irq.c
index 6a5b43f..694742a 100644
--- a/src/cpu/irq.c
+++ b/src/cpu/irq.c
@@ -33,6 +33,7 @@ void c_irq_handler(void)
// Handle the recieved data
// Ctrl+T to toggle timer
if(data == 0x14) {
+ uart_scheduler();
unsigned long timer_status;
asm volatile("mrc p15, 0, %0, c14, c3, 1" : "=r"(timer_status));
if(timer_status == 0) {
diff --git a/src/sys/schedule.c b/src/sys/schedule.c
index 748f7ed..4f8feff 100644
--- a/src/sys/schedule.c
+++ b/src/sys/schedule.c
@@ -454,8 +454,8 @@ void sched_mutex_resurrect(void* m)
// Restore the original priority level
if (op != 0xFF) {
struct Entry* tentry = pop_thread_from_queue(THREAD_READY, p);
- ((struct Thread*)entry->value)->priority = op;
- ((struct Thread*)entry->value)->old_priority = 0xFF;
+ ((struct Thread*)tentry->value)->priority = op;
+ ((struct Thread*)tentry->value)->old_priority = 0xFF;
prepend_thread_to_queue(tentry->value, THREAD_READY, op);
}
}
diff --git a/src/tests/test.c b/src/tests/test.c
index 1bc6c9a..0c3ffb0 100644
--- a/src/tests/test.c
+++ b/src/tests/test.c
@@ -148,6 +148,6 @@ void btest(void)
{
x = 0;
add_thread(ctest1, 0, 3);
- //add_thread(stest1, 0, 6);
- //add_thread(stest2, 0, 7);
+ add_thread(stest1, 0, 6);
+ add_thread(stest2, 0, 7);
}