On 17 March 2014 03:19, Peter Crosthwaite <peter.crosthwa...@xilinx.com> wrote: > On Fri, Mar 7, 2014 at 5:32 AM, Peter Maydell <peter.mayd...@linaro.org> > wrote: >> -static void gen_exception(int excp) >> +static void gen_exception_internal(int excp) >> { >> - TCGv_i32 tmp = tcg_temp_new_i32(); >> - tcg_gen_movi_i32(tmp, excp); >> - gen_helper_exception(cpu_env, tmp); >> - tcg_temp_free_i32(tmp); >> + TCGv_i32 tcg_excp = tcg_const_i32(excp); >> + >> + assert(excp_is_internal(excp)); >> + gen_helper_exception_internal(cpu_env, tcg_excp); >> + tcg_temp_free_i32(tcg_excp); >> +} >> + > > AFAICT this is identical to gen_exception_internal in translate-a64.c. > Can they be de-static'd and prototyped in internals.h?
This is true, but it would break the current situation we have where translate.c and translate-a64.c are entirely independent and you never have to worry about breaking one if you make changes to the other, which is why I didn't do it. Maybe that's not very important, but it didn't seem worth going against for the sake of a couple of helpers just a few lines long. (If we do make them common then translate.h would be the right place for the prototypes.) thanks -- PMM