aboutsummaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-01-02 17:35:52 -0800
committerChristian Cunningham <cc@localhost>2022-01-02 17:35:52 -0800
commita4a15ad39d8231c11f74f4e5c4b74b9e5547f22e (patch)
treee3131968eb1fe1a21b9bb29aad5562a2483b19e0 /src/sys
parent58b2bf3128192e3b937d934a81dcdfc7dc199900 (diff)
Don't lock mutex if only written by one interrupt
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/core.c2
-rw-r--r--src/sys/timer.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/src/sys/core.c b/src/sys/core.c
index 636dd64..fbe0536 100644
--- a/src/sys/core.c
+++ b/src/sys/core.c
@@ -49,4 +49,6 @@ void sysinit(void)
// Enable IRQ & FIQ
enableirq();
enablefiq();
+
+ // Start Scheduler
}
diff --git a/src/sys/timer.c b/src/sys/timer.c
index 9419f80..d9c2f6b 100644
--- a/src/sys/timer.c
+++ b/src/sys/timer.c
@@ -24,11 +24,18 @@ void increase_counter(void)
}
}
+inline void hard_increase_counter(void)
+{
+ unsigned long* counter = (unsigned long*)exe_cnt_m.addr;
+ *counter += 1;
+}
+
void c_timer(void)
{
// Reset the counter
write_cntv_tval(cntfrq/CPS);
- increase_counter();
+ hard_increase_counter();
+ //increase_counter();
status();
}