Message ID | 20191115173000.21891-7-alex.bennee@linaro.org |
---|---|
State | Superseded |
Headers | show |
Series | gdbstub re-factor and SVE support | expand |
On 11/15/19 6:29 PM, Alex Bennée wrote: > This is cleaner than poking memory directly and will make later > clean-ups easier. > > Signed-off-by: Alex Bennée <alex.bennee@linaro.org> > --- > target/arm/helper.c | 16 ++++++---------- > 1 file changed, 6 insertions(+), 10 deletions(-) > > diff --git a/target/arm/helper.c b/target/arm/helper.c > index be67e2c66d6..bd821931b3d 100644 > --- a/target/arm/helper.c > +++ b/target/arm/helper.c > @@ -105,21 +105,17 @@ static int aarch64_fpu_gdb_get_reg(CPUARMState *env, uint8_t *buf, int reg) > { > switch (reg) { > case 0 ... 31: > + { > /* 128 bit FP register */ > - { > - uint64_t *q = aa64_vfp_qreg(env, reg); > - stq_le_p(buf, q[0]); > - stq_le_p(buf + 8, q[1]); > - return 16; > - } > + uint64_t *q = aa64_vfp_qreg(env, reg); > + return gdb_get_reg128(buf, q[0], q[1]); The elements of aa64_vfp_qreg are explicitly little-endian. Since you defined gdb_get_reg128 as (buf, hi, lo), these arguments are in the wrong order. r~
diff --git a/target/arm/helper.c b/target/arm/helper.c index be67e2c66d6..bd821931b3d 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -105,21 +105,17 @@ static int aarch64_fpu_gdb_get_reg(CPUARMState *env, uint8_t *buf, int reg) { switch (reg) { case 0 ... 31: + { /* 128 bit FP register */ - { - uint64_t *q = aa64_vfp_qreg(env, reg); - stq_le_p(buf, q[0]); - stq_le_p(buf + 8, q[1]); - return 16; - } + uint64_t *q = aa64_vfp_qreg(env, reg); + return gdb_get_reg128(buf, q[0], q[1]); + } case 32: /* FPSR */ - stl_p(buf, vfp_get_fpsr(env)); - return 4; + return gdb_get_reg32(buf, vfp_get_fpsr(env)); case 33: /* FPCR */ - stl_p(buf, vfp_get_fpcr(env)); - return 4; + return gdb_get_reg32(buf,vfp_get_fpcr(env)); default: return 0; }
This is cleaner than poking memory directly and will make later clean-ups easier. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> --- target/arm/helper.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) -- 2.20.1