From d244110a591307a648ce8eaa88018f5418524491 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Tue, 13 Dec 2022 09:14:05 -0800 Subject: debug: Tweak interrupt.c, so a test can run to exit() --- debug/programs/interrupt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'debug') 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; } -- cgit v1.1