On 14 September 2015 at 23:43, Richard Henderson <r...@twiddle.net> wrote: > Signed-off-by: Richard Henderson <r...@twiddle.net> > ---
> +static void do_exch(CPUTLGState *env, bool quad, bool cmp) > +{ > + target_ulong addr; > + target_long val, sprval; > + > + start_exclusive(); > + > + addr = env->atomic_srca; > + if (quad ? get_user_s64(val, addr) : get_user_s32(val, addr)) { > + goto sigsegv_mapper; > + } > + > + if (cmp) { > + if (quad) { > + sprval = env->spregs[TILEGX_SPR_CMPEXCH]; > + } else { > + sprval = sextract64(env->spregs[TILEGX_SPR_CMPEXCH], 0, 32); > + } > + } > + > + if (!cmp || val == sprval) { > + target_long valb = env->atomic_srcb; > + if (quad ? put_user_u64(valb, addr) : put_user_u32(valb, addr)) { > + goto sigsegv_mapper; > + } > + } > + > + set_regval(env, env->atomic_dstr, val); > + end_exclusive(); > + return; > + > + sigsegv_mapper: This label (and the one in do_fetch) should be "sigsegv_maperr" > + end_exclusive(); > + gen_sigsegv_mapper(env, addr); (and I just noticed this function has a typo in its name too). Otherwise Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> thanks -- PMM