#define DCSR_CAUSE_STEPPED 4
#define DCSR_CAUSE_HALT 5
+#define DEBUG_START 0xfffffffffffff000
#define DEBUG_RAM_START 0xfffffffffffffc00 // TODO: 0x400
#define DEBUG_RAM_END (DEBUG_RAM_START + 64)
#define DEBUG_ROM_START 0xfffffffffffff800 // TODO: 0x800
#define DEBUG_ROM_END (DEBUG_ROM_START + debug_rom_raw_len)
+#define DEBUG_END 0xffffffffffffffff
+#define DEBUG_SIZE (DEBUG_END - DEBUG_START + 1)
#endif
(unsigned long)memsz, (unsigned long)memsz0);
/* Copy Debug ROM into the end of the allocated block, because we surely
- * didn't succeed in allocation 0xfffffffff800 bytes. */
+ * didn't succeed in allocating 0xfffffffff800 bytes. */
/* TODO: Once everything uses the new memory map, just put this at the
* address that it actually belongs at. */
- memcpy(mem + memsz - debug_rom_raw_len, debug_rom_raw, debug_rom_raw_len);
+ memcpy(mem + memsz - DEBUG_SIZE + DEBUG_ROM_START - DEBUG_START,
+ debug_rom_raw, debug_rom_raw_len);
debug_mmu = new mmu_t(this, NULL);