summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdgar E. Iglesias <edgar.iglesias@gmail.com>2009-05-20 20:16:31 +0200
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2009-05-26 21:11:04 +0200
commitd74d6a99a05e07771acc5f6b91db04be4c1f007f (patch)
tree492d0b158a1f91f2bf5ecea0f9ea7d140dddab34
parent6a8b1ae2020bf06d438f6bfd05a0e8fc2abe10d1 (diff)
downloadqemu-d74d6a99a05e07771acc5f6b91db04be4c1f007f.tar.gz
qemu-d74d6a99a05e07771acc5f6b91db04be4c1f007f.tar.bz2
qemu-d74d6a99a05e07771acc5f6b91db04be4c1f007f.zip
microblaze: Add GDB stub support.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
-rw-r--r--gdbstub.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gdbstub.c b/gdbstub.c
index 3c34741f97..7b32fab589 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1156,6 +1156,36 @@ static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)
return 4;
}
+#elif defined (TARGET_MICROBLAZE)
+
+#define NUM_CORE_REGS (32 + 5)
+
+static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)
+{
+ if (n < 32) {
+ GET_REG32(env->regs[n]);
+ } else {
+ GET_REG32(env->sregs[n - 32]);
+ }
+ return 0;
+}
+
+static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)
+{
+ uint32_t tmp;
+
+ if (n > NUM_CORE_REGS)
+ return 0;
+
+ tmp = ldl_p(mem_buf);
+
+ if (n < 32) {
+ env->regs[n] = tmp;
+ } else {
+ env->sregs[n - 32] = tmp;
+ }
+ return 4;
+}
#elif defined (TARGET_CRIS)
#define NUM_CORE_REGS 49
@@ -1528,6 +1558,8 @@ static void gdb_set_cpu_pc(GDBState *s, target_ulong pc)
s->c_cpu->pc = pc;
#elif defined (TARGET_MIPS)
s->c_cpu->active_tc.PC = pc;
+#elif defined (TARGET_MICROBLAZE)
+ s->c_cpu->sregs[SR_PC] = pc;
#elif defined (TARGET_CRIS)
s->c_cpu->pc = pc;
#elif defined (TARGET_ALPHA)