summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-12-07 11:22:32 +0200
committerAvi Kivity <avi@redhat.com>2009-12-07 11:22:32 +0200
commitd95f05082bb2b6a695784f006f21d14547177786 (patch)
treeac8653f87582c7328a65e3edef6a8e05e6bfef43 /gdbstub.c
parentMerge commit 'f3304eea9338b7e694843fa1a6db5540e8783d1d' into upstream-merge (diff)
parentAdd S390 maintainer information (diff)
downloadqemu-kvm-d95f05082bb2b6a695784f006f21d14547177786.tar.gz
qemu-kvm-d95f05082bb2b6a695784f006f21d14547177786.tar.bz2
qemu-kvm-d95f05082bb2b6a695784f006f21d14547177786.zip
Merge commit '749717a0ea2f60d33d01c1e37fa24dfa7250dfc0' into upstream-merge
* commit '749717a0ea2f60d33d01c1e37fa24dfa7250dfc0': Add S390 maintainer information Set default console to virtio on S390x S390 GDB stub Add S390x virtio machine description Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'gdbstub.c')
-rw-r--r--gdbstub.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/gdbstub.c b/gdbstub.c
index b1c55d8a4..0a738bf99 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1349,6 +1349,55 @@ static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)
return 8;
}
+#elif defined (TARGET_S390X)
+
+#define NUM_CORE_REGS S390_NUM_TOTAL_REGS
+
+static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)
+{
+ switch (n) {
+ case S390_PSWM_REGNUM: GET_REGL(env->psw.mask); break;
+ case S390_PSWA_REGNUM: GET_REGL(env->psw.addr); break;
+ case S390_R0_REGNUM ... S390_R15_REGNUM:
+ GET_REGL(env->regs[n-S390_R0_REGNUM]); break;
+ case S390_A0_REGNUM ... S390_A15_REGNUM:
+ GET_REG32(env->aregs[n-S390_A0_REGNUM]); break;
+ case S390_FPC_REGNUM: GET_REG32(env->fpc); break;
+ case S390_F0_REGNUM ... S390_F15_REGNUM:
+ /* XXX */
+ break;
+ case S390_PC_REGNUM: GET_REGL(env->psw.addr); break;
+ case S390_CC_REGNUM: GET_REG32(env->cc); break;
+ }
+
+ return 0;
+}
+
+static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)
+{
+ target_ulong tmpl;
+ uint32_t tmp32;
+ int r = 8;
+ tmpl = ldtul_p(mem_buf);
+ tmp32 = ldl_p(mem_buf);
+
+ switch (n) {
+ case S390_PSWM_REGNUM: env->psw.mask = tmpl; break;
+ case S390_PSWA_REGNUM: env->psw.addr = tmpl; break;
+ case S390_R0_REGNUM ... S390_R15_REGNUM:
+ env->regs[n-S390_R0_REGNUM] = tmpl; break;
+ case S390_A0_REGNUM ... S390_A15_REGNUM:
+ env->aregs[n-S390_A0_REGNUM] = tmp32; r=4; break;
+ case S390_FPC_REGNUM: env->fpc = tmp32; r=4; break;
+ case S390_F0_REGNUM ... S390_F15_REGNUM:
+ /* XXX */
+ break;
+ case S390_PC_REGNUM: env->psw.addr = tmpl; break;
+ case S390_CC_REGNUM: env->cc = tmp32; r=4; break;
+ }
+
+ return r;
+}
#else
#define NUM_CORE_REGS 0
@@ -1617,6 +1666,9 @@ static void gdb_set_cpu_pc(GDBState *s, target_ulong pc)
s->c_cpu->pc = pc;
#elif defined (TARGET_ALPHA)
s->c_cpu->pc = pc;
+#elif defined (TARGET_S390X)
+ cpu_synchronize_state(s->c_cpu);
+ s->c_cpu->psw.addr = pc;
#endif
}