aboutsummaryrefslogtreecommitdiff
path: root/debug
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2022-12-13 09:14:05 -0800
committerTim Newsome <tim@sifive.com>2023-01-06 11:36:18 -0800
commitd244110a591307a648ce8eaa88018f5418524491 (patch)
tree58cf9e6b96df1103aa342cf0943acef94f5cd8b3 /debug
parent1753fda262809ce55d09b529cd975f4016bcc2f0 (diff)
downloadriscv-tests-d244110a591307a648ce8eaa88018f5418524491.zip
riscv-tests-d244110a591307a648ce8eaa88018f5418524491.tar.gz
riscv-tests-d244110a591307a648ce8eaa88018f5418524491.tar.bz2
debug: Tweak interrupt.c, so a test can run to exit()
Diffstat (limited to 'debug')
-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;
}