aboutsummaryrefslogtreecommitdiff
path: root/debug/programs/interrupt.c
diff options
context:
space:
mode:
Diffstat (limited to 'debug/programs/interrupt.c')
-rw-r--r--debug/programs/interrupt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/debug/programs/interrupt.c b/debug/programs/interrupt.c
index 8378576..847644c 100644
--- a/debug/programs/interrupt.c
+++ b/debug/programs/interrupt.c
@@ -3,6 +3,7 @@
static volatile unsigned interrupt_count;
static volatile unsigned local;
+static volatile unsigned keep_running;
static unsigned delta = 0x100;
void *increment_count(unsigned hartid, unsigned mcause, void *mepc, void *sp)
@@ -20,13 +21,15 @@ int main()
{
interrupt_count = 0;
local = 0;
+ keep_running = 1;
unsigned hartid = read_csr(mhartid);
set_trap_handler(increment_count);
MTIMECMP[hartid] = MTIME - 1;
enable_timer_interrupts();
- while (1) {
+ while (keep_running) {
local++;
}
+ return 10;
}