2 * s390x gdb server stub
4 * Copyright (c) 2003-2005 Fabrice Bellard
5 * Copyright (c) 2013 SUSE LINUX Products GmbH
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
21 static int cpu_gdb_read_register(CPUS390XState *env, uint8_t *mem_buf, int n)
27 case S390_PSWM_REGNUM:
28 cc_op = calc_cc(env, env->cc_op, env->cc_src, env->cc_dst, env->cc_vr);
29 val = deposit64(env->psw.mask, 44, 2, cc_op);
31 case S390_PSWA_REGNUM:
32 GET_REGL(env->psw.addr);
33 case S390_R0_REGNUM ... S390_R15_REGNUM:
34 GET_REGL(env->regs[n-S390_R0_REGNUM]);
35 case S390_A0_REGNUM ... S390_A15_REGNUM:
36 GET_REG32(env->aregs[n-S390_A0_REGNUM]);
39 case S390_F0_REGNUM ... S390_F15_REGNUM:
40 GET_REG64(env->fregs[n-S390_F0_REGNUM].ll);
46 static int cpu_gdb_write_register(CPUS390XState *env, uint8_t *mem_buf, int n)
51 tmpl = ldtul_p(mem_buf);
52 tmp32 = ldl_p(mem_buf);
55 case S390_PSWM_REGNUM:
57 env->cc_op = extract64(tmpl, 44, 2);
59 case S390_PSWA_REGNUM:
62 case S390_R0_REGNUM ... S390_R15_REGNUM:
63 env->regs[n-S390_R0_REGNUM] = tmpl;
65 case S390_A0_REGNUM ... S390_A15_REGNUM:
66 env->aregs[n-S390_A0_REGNUM] = tmp32;
73 case S390_F0_REGNUM ... S390_F15_REGNUM:
74 env->fregs[n-S390_F0_REGNUM].ll = tmpl;