On 7/3/19 5:52 PM, Alex Bennée wrote: > Now we do all our checking and use a common EXCP_SEMIHOST for > semihosting operations we can make helper code a lot simpler. > > Signed-off-by: Alex Bennée <alex.ben...@linaro.org> > --- > target/arm/helper.c | 84 +++++++++------------------------------------ > 1 file changed, 17 insertions(+), 67 deletions(-) > > diff --git a/target/arm/helper.c b/target/arm/helper.c > index ad29dc4072..5c1f741380 100644 > --- a/target/arm/helper.c > +++ b/target/arm/helper.c > @@ -10364,83 +10364,33 @@ static void arm_cpu_do_interrupt_aarch64(CPUState > *cs) > new_el, env->pc, pstate_read(env)); > } > > -static inline bool check_for_semihosting(CPUState *cs) > +/* > + * Check whether this exception is a semihosting call; if so > + * then handle it and return true; otherwise return false. > + * > + * All the permission and validity checks are done at translate time. > + */ > +static inline bool handle_semihosting(CPUState *cs)
Drop the inline, probably. Since you are renaming away the "check", perhaps hoist > + if (cs->exception_index == EXCP_SEMIHOST) { this check to the caller, change the return to void, > @@ -10476,7 +10426,7 @@ void arm_cpu_do_interrupt(CPUState *cs) > * code that caused the exception, not the target exception level, > * so must be handled here. > */ > - if (check_for_semihosting(cs)) { > + if (handle_semihosting(cs)) { > return; > } so we get if (cs->exception_index == EXCP_SEMIHOST) { handle_semihosting(cs); return; } r~