jal(ZERO, debug_abstract_start - DEBUG_ROM_WHERETO));
memset(debug_abstract, 0, sizeof(debug_abstract));
-
+
}
void debug_module_t::reset()
memcpy(bytes, dmdata + addr - debug_data_start, len);
return true;
}
-
+
if (addr >= debug_progbuf_start && ((addr + len) <= (debug_progbuf_start + sizeof(program_buffer)))) {
memcpy(bytes, program_buffer + addr - debug_progbuf_start, len);
return true;
}
addr = DEBUG_START + addr;
-
+
if (addr >= debug_data_start && (addr + len) <= (debug_data_start + sizeof(dmdata))) {
memcpy(dmdata + addr - debug_data_start, bytes, len);
return true;
}
-
+
if (addr >= debug_progbuf_start && ((addr + len) <= (debug_progbuf_start + sizeof(program_buffer)))) {
fprintf(stderr, "Successful write to program buffer %d bytes at %x\n", (int) len, (int) addr);
memcpy(program_buffer + addr - debug_progbuf_start, bytes, len);
-
+
return true;
}
} else {
dmstatus.allresumeack = false;
}
-
+
result = set_field(result, DMI_DMSTATUS_ALLNONEXISTENT, dmstatus.allnonexistant);
result = set_field(result, DMI_DMSTATUS_ALLUNAVAIL, dmstatus.allunavail);
result = set_field(result, DMI_DMSTATUS_ALLRUNNING, dmstatus.allrunning);
//NOP
write32(debug_abstract, 0, addi(ZERO, ZERO, 0));
}
-
+
if (get_field(command, AC_ACCESS_REGISTER_POSTEXEC)) {
// Since the next instruction is what we will use, just use nother NOP
// to get there.
}
debug_rom_flags[dmcontrol.hartsel] |= 1 << DEBUG_ROM_FLAG_GO;
-
+
abstractcs.busy = true;
} else {
abstractcs.cmderr = CMDERR_NOTSUP;
} else if (address >= DMI_PROGBUF0 && address < DMI_PROGBUF0 + progsize) {
unsigned i = address - DMI_PROGBUF0;
-
+
if (!abstractcs.busy)
write32(program_buffer, i, value);
perform_abstract_command();
}
return true;
-
+
} else {
switch (address) {
case DMI_DMCONTROL:
return true;
case DMI_ABSTRACTAUTO:
- abstractauto.autoexecprogbuf = get_field(value, DMI_ABSTRACTAUTO_AUTOEXECPROGBUF);
- abstractauto.autoexecdata = get_field(value, DMI_ABSTRACTAUTO_AUTOEXECDATA);
- break;
+ abstractauto.autoexecprogbuf = get_field(value,
+ DMI_ABSTRACTAUTO_AUTOEXECPROGBUF);
+ abstractauto.autoexecdata = get_field(value,
+ DMI_ABSTRACTAUTO_AUTOEXECDATA);
+ return true;
}
}
return false;