aboutsummaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-02-24 23:38:38 -0700
committerChristian Cunningham <cc@localhost>2022-02-24 23:38:38 -0700
commit9169796632fcdeb5e8e74ed60c6cbe31081e51f2 (patch)
treef9076beb2cbdd4f8cb2677b9be64fa145b0fc3d1 /src/cpu
parenta9e89946ad7f6918b954d7416c755a90c0eace9d (diff)
MMU and working on hardware
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/irq.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/cpu/irq.c b/src/cpu/irq.c
index 125c3a6..cfa9d7d 100644
--- a/src/cpu/irq.c
+++ b/src/cpu/irq.c
@@ -5,11 +5,13 @@
#include <symbols.h>
#include <sys/core.h>
#include <sys/schedule.h>
-#include <sys/timer.h>
#include <tests/test.h>
#include <util/mutex.h>
+#include <util/status.h>
#include <util/time.h>
+#define CPS 1000
+
void handle_data(unsigned char);
void c_irq_handler(void)
@@ -59,7 +61,7 @@ void c_irq_handler(void)
}
// Add task to handle the data
else {
- add_thread(handle_data, (void*)data, 1);
+ //add_thread(handle_data, (void*)data, 1);
}
return;
}
@@ -75,7 +77,6 @@ void c_irq_handler(void)
}
// Check if CNTV triggered the interrupt
else if (source & (1 << 3)) {
- c_timer();
return;
}
return;
@@ -87,14 +88,15 @@ unsigned long c_fiq_handler(void)
unsigned long source = load32(CORE0_FIQ_SOURCE);
// Check if CNTV triggered the interrupt
if (source & (1 << 3)) {
- c_timer();
+ // Reset the counter
+ write_cntv_tval(cntfrq/CPS);
counter++;
- if (counter % 0x6000 == 0) {
+ if (counter % 0x6000 == 0)
counter = 0;
- }
- if (counter % 0x30 == 0) {
+ if (counter % 0x10 == 0)
+ status();
+ if (counter % 0x40 == 0)
return 1;
- }
return 0;
}
return 0;