On 9 April 2015 at 18:23, Christopher Covington <christopher.coving...@linaro.org> wrote: > On Fri, Mar 27, 2015 at 12:40 PM, Peter Maydell > <peter.mayd...@linaro.org> wrote: >> You need to have the semihosting_enabled check here rather >> than in the do_interrupt code, because otherwise we won't >> behave correctly in the disabled case. > > Do you have suggestions for getting semihosting_enabled defined in > translate-a64.c? I'm likely doing something dumb, but while #include > "sysemu/sysemu.h" at first seemed like the obvious approach, and > appears to work for -softmmu, I'm getting errors with that when > building -linux-user.
sysemu.h is an ugly grab-bag of things that are specific to the system emulator config. Semihosting is always enabled for linux-user, so it doesn't have an equivalent switch. Let's clean this up a bit, by creating a new include/exec/semihost.h, with contents something like: #ifdef CONFIG_SOFTMMU bool semihosting_enabled(void); #else /* In -user configurations semihosting is always enabled */ bool semihosting_enabled(void) { return true; } #endif [plus license header, ifdef guards, etc] and then in vl.c have a static bool semihosting_allowed; and bool semihosting_enabled(void) { return semihosting_allowed; } and change the places that set semihosting_enabled to set this private flag instead. [This is following the pattern of the existing defaults_enabled/usb_enabled functions.] And change all the tests of semihosting_enabled to calls to semihosting_enabled(), and delete the semihosting_enabled variable completely. Then we have a place to put future semihosting related config things, and a small self-contained header you can include in translate-a64.c without dragging in a lot of rubbish. This should all go in a preliminary patch at the start of your series. thanks -- PMM