diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2017-03-08 12:41:14 +0100 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2017-07-14 12:29:49 +0200 |
commit | 86158a2a2b81f075c84d0b95c6d72b98dbf1dc61 (patch) | |
tree | 7e740216ee2036ebccbdd35315f8e2f36ef727e7 /target | |
parent | 21a106904b5336b6ea60c22a95feb7d61c664d7f (diff) |
s390x/gdb: add gs registers
Let's provide the guarded storage registers via gdb server.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'target')
-rw-r--r-- | target/s390x/gdbstub.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/target/s390x/gdbstub.c b/target/s390x/gdbstub.c index 94ab74d58f..a7efafee9f 100644 --- a/target/s390x/gdbstub.c +++ b/target/s390x/gdbstub.c @@ -286,6 +286,26 @@ static int cpu_write_virt_reg(CPUS390XState *env, uint8_t *mem_buf, int n) } #endif +/* the values represent the positions in s390-gs.xml */ +#define S390_GS_RESERVED_REGNUM 0 +#define S390_GS_GSD_REGNUM 1 +#define S390_GS_GSSM_REGNUM 2 +#define S390_GS_GSEPLA_REGNUM 3 +/* total number of registers in s390-gs.xml */ +#define S390_NUM_GS_REGS 4 + +static int cpu_read_gs_reg(CPUS390XState *env, uint8_t *mem_buf, int n) +{ + return gdb_get_regl(mem_buf, env->gscb[n]); +} + +static int cpu_write_gs_reg(CPUS390XState *env, uint8_t *mem_buf, int n) +{ + env->gscb[n] = ldtul_p(mem_buf); + cpu_synchronize_post_init(ENV_GET_CPU(env)); + return 8; +} + void s390_cpu_gdb_init(CPUState *cs) { gdb_register_coprocessor(cs, cpu_read_ac_reg, @@ -300,6 +320,10 @@ void s390_cpu_gdb_init(CPUState *cs) cpu_write_vreg, S390_NUM_VREGS, "s390-vx.xml", 0); + gdb_register_coprocessor(cs, cpu_read_gs_reg, + cpu_write_gs_reg, + S390_NUM_GS_REGS, "s390-gs.xml", 0); + #ifndef CONFIG_USER_ONLY gdb_register_coprocessor(cs, cpu_read_c_reg, cpu_write_c_reg, |