]> Git Repo - qemu.git/blobdiff - target-s390x/gdbstub.c
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
[qemu.git] / target-s390x / gdbstub.c
index c966143a9d9aeb3673320d07e2a1f6844ed72a5c..a129742e2fcc78d74aa2da73c2237057bf369fc3 100644 (file)
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
+#include "config.h"
+#include "qemu-common.h"
+#include "exec/gdbstub.h"
+#include "qemu/bitops.h"
 
-static int cpu_gdb_read_register(CPUS390XState *env, uint8_t *mem_buf, int n)
+int s390_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
 {
+    S390CPU *cpu = S390_CPU(cs);
+    CPUS390XState *env = &cpu->env;
     uint64_t val;
     int cc_op;
 
@@ -27,24 +33,26 @@ static int cpu_gdb_read_register(CPUS390XState *env, uint8_t *mem_buf, int n)
     case S390_PSWM_REGNUM:
         cc_op = calc_cc(env, env->cc_op, env->cc_src, env->cc_dst, env->cc_vr);
         val = deposit64(env->psw.mask, 44, 2, cc_op);
-        GET_REGL(val);
+        return gdb_get_regl(mem_buf, val);
     case S390_PSWA_REGNUM:
-        GET_REGL(env->psw.addr);
+        return gdb_get_regl(mem_buf, env->psw.addr);
     case S390_R0_REGNUM ... S390_R15_REGNUM:
-        GET_REGL(env->regs[n-S390_R0_REGNUM]);
+        return gdb_get_regl(mem_buf, env->regs[n-S390_R0_REGNUM]);
     case S390_A0_REGNUM ... S390_A15_REGNUM:
-        GET_REG32(env->aregs[n-S390_A0_REGNUM]);
+        return gdb_get_reg32(mem_buf, env->aregs[n-S390_A0_REGNUM]);
     case S390_FPC_REGNUM:
-        GET_REG32(env->fpc);
+        return gdb_get_reg32(mem_buf, env->fpc);
     case S390_F0_REGNUM ... S390_F15_REGNUM:
-        GET_REG64(env->fregs[n-S390_F0_REGNUM].ll);
+        return gdb_get_reg64(mem_buf, env->fregs[n-S390_F0_REGNUM].ll);
     }
 
     return 0;
 }
 
-static int cpu_gdb_write_register(CPUS390XState *env, uint8_t *mem_buf, int n)
+int s390_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
 {
+    S390CPU *cpu = S390_CPU(cs);
+    CPUS390XState *env = &cpu->env;
     target_ulong tmpl;
     uint32_t tmp32;
     int r = 8;
This page took 0.025836 seconds and 4 git commands to generate.