aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2016-04-28 13:15:46 -0700
committerTim Newsome <tim@sifive.com>2016-05-23 12:12:11 -0700
commitf7f2623753d4bbe776087d4e6f5190a0a92305c5 (patch)
treedcf57143207c13afd61502f2a3db5563cb216c10
parent54bd259cd529294e9c0967bd0e9e20d8fa30dc3b (diff)
downloadspike-f7f2623753d4bbe776087d4e6f5190a0a92305c5.zip
spike-f7f2623753d4bbe776087d4e6f5190a0a92305c5.tar.gz
spike-f7f2623753d4bbe776087d4e6f5190a0a92305c5.tar.bz2
Fix race using fence.
-rwxr-xr-xdebug_rom/debug_rom.S6
-rw-r--r--debug_rom/debug_rom.h31
2 files changed, 16 insertions, 21 deletions
diff --git a/debug_rom/debug_rom.S b/debug_rom/debug_rom.S
index 9825d48..a3339b4 100755
--- a/debug_rom/debug_rom.S
+++ b/debug_rom/debug_rom.S
@@ -32,11 +32,7 @@ resume:
clear_debint:
csrr s1, CSR_MHARTID
sw s1, CLEARDEBINT(zero)
- # TODO: race: what if the debugger sets debug int at this point?
-clear_debint_loop:
- csrr s1, DCSR
- andi s1, s1, (1<<DCSR_DEBUGINT_OFFSET)
- bnez s1, clear_debint_loop
+ fence
# Restore s1.
csrr s1, CSR_MISA
diff --git a/debug_rom/debug_rom.h b/debug_rom/debug_rom.h
index 6fef948..b096c80 100644
--- a/debug_rom/debug_rom.h
+++ b/debug_rom/debug_rom.h
@@ -1,18 +1,17 @@
static const unsigned char debug_rom_raw[] = {
- 0x6f, 0x00, 0x40, 0x05, 0xf3, 0x24, 0x50, 0xf1, 0x23, 0x2c, 0x90, 0xee,
- 0xf3, 0x24, 0x00, 0x79, 0x93, 0xf4, 0x04, 0x40, 0xe3, 0x9c, 0x04, 0xfe,
- 0xf3, 0x24, 0x00, 0xf1, 0x63, 0xc6, 0x04, 0x00, 0x83, 0x24, 0xc0, 0xc3,
- 0x6f, 0x00, 0x80, 0x01, 0x93, 0x94, 0x14, 0x00, 0x63, 0xc6, 0x04, 0x00,
- 0x83, 0x34, 0x80, 0xc3, 0x6f, 0x00, 0x80, 0x00, 0x13, 0x00, 0x00, 0x00,
- 0x73, 0x24, 0x00, 0x79, 0x13, 0x74, 0x84, 0x00, 0x63, 0x04, 0x04, 0x00,
- 0x6f, 0x00, 0x40, 0x05, 0x73, 0x24, 0x20, 0x79, 0x73, 0x00, 0x00, 0x10,
- 0x73, 0x10, 0x24, 0x79, 0x73, 0x24, 0x00, 0x79, 0x13, 0x74, 0x74, 0x00,
- 0x13, 0x04, 0xd4, 0xff, 0x63, 0x16, 0x04, 0x02, 0x73, 0x24, 0x00, 0xf1,
- 0x63, 0x46, 0x04, 0x00, 0x23, 0x2e, 0x90, 0xc2, 0x67, 0x00, 0x00, 0xc0,
- 0x13, 0x14, 0x14, 0x00, 0x63, 0x46, 0x04, 0x00, 0x23, 0x3c, 0x90, 0xc2,
- 0x67, 0x00, 0x00, 0xc0, 0x13, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0xc0,
- 0x73, 0x24, 0x50, 0xf1, 0x23, 0x20, 0x80, 0xf0, 0x73, 0x60, 0x04, 0x79,
- 0x73, 0x24, 0x00, 0x79, 0x13, 0x74, 0x04, 0x40, 0xe3, 0x0c, 0x04, 0xfe,
- 0x6f, 0xf0, 0x1f, 0xfc
+ 0x6f, 0x00, 0xc0, 0x04, 0xf3, 0x24, 0x50, 0xf1, 0x23, 0x2c, 0x90, 0xee,
+ 0x0f, 0x00, 0xf0, 0x0f, 0xf3, 0x24, 0x00, 0xf1, 0x63, 0xc6, 0x04, 0x00,
+ 0x83, 0x24, 0xc0, 0xc3, 0x6f, 0x00, 0x80, 0x01, 0x93, 0x94, 0x14, 0x00,
+ 0x63, 0xc6, 0x04, 0x00, 0x83, 0x34, 0x80, 0xc3, 0x6f, 0x00, 0x80, 0x00,
+ 0x13, 0x00, 0x00, 0x00, 0x73, 0x24, 0x00, 0x79, 0x13, 0x74, 0x84, 0x00,
+ 0x63, 0x04, 0x04, 0x00, 0x6f, 0x00, 0x40, 0x05, 0x73, 0x24, 0x20, 0x79,
+ 0x73, 0x00, 0x00, 0x10, 0x73, 0x10, 0x24, 0x79, 0x73, 0x24, 0x00, 0x79,
+ 0x13, 0x74, 0x74, 0x00, 0x13, 0x04, 0xd4, 0xff, 0x63, 0x16, 0x04, 0x02,
+ 0x73, 0x24, 0x00, 0xf1, 0x63, 0x46, 0x04, 0x00, 0x23, 0x2e, 0x90, 0xc2,
+ 0x67, 0x00, 0x00, 0xc0, 0x13, 0x14, 0x14, 0x00, 0x63, 0x46, 0x04, 0x00,
+ 0x23, 0x3c, 0x90, 0xc2, 0x67, 0x00, 0x00, 0xc0, 0x13, 0x00, 0x00, 0x00,
+ 0x67, 0x00, 0x00, 0xc0, 0x73, 0x24, 0x50, 0xf1, 0x23, 0x20, 0x80, 0xf0,
+ 0x73, 0x60, 0x04, 0x79, 0x73, 0x24, 0x00, 0x79, 0x13, 0x74, 0x04, 0x40,
+ 0xe3, 0x0c, 0x04, 0xfe, 0x6f, 0xf0, 0x1f, 0xfc
};
-static const unsigned int debug_rom_raw_len = 172;
+static const unsigned int debug_rom_raw_len = 164;