diff options
author | Tim Newsome <tim@sifive.com> | 2022-12-13 09:14:05 -0800 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2023-01-06 11:36:18 -0800 |
commit | d244110a591307a648ce8eaa88018f5418524491 (patch) | |
tree | 58cf9e6b96df1103aa342cf0943acef94f5cd8b3 | |
parent | 1753fda262809ce55d09b529cd975f4016bcc2f0 (diff) | |
download | riscv-tests-d244110a591307a648ce8eaa88018f5418524491.zip riscv-tests-d244110a591307a648ce8eaa88018f5418524491.tar.gz riscv-tests-d244110a591307a648ce8eaa88018f5418524491.tar.bz2 |
debug: Tweak interrupt.c, so a test can run to exit()
-rw-r--r-- | debug/programs/interrupt.c | 5 |
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; } |