fully split aio_pool from BlockDriver
[qemu] / gdbstub.c
index f3eb827..7b32fab 100644 (file)
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -334,7 +334,7 @@ static int get_char(GDBState *s)
 
 static gdb_syscall_complete_cb gdb_current_syscall_cb;
 
-enum {
+static enum {
     GDB_SYS_UNKNOWN,
     GDB_SYS_ENABLED,
     GDB_SYS_DISABLED,
@@ -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)