linux-user: introduce preexit_cleanup

To avoid repeating ourselves move our preexit clean-up code into a
helper function. I figured the continuing effort to split of the
syscalls made it worthwhile creating a new file for it now.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
Alex Bennée 2018-06-22 17:09:10 +01:00
parent fe8bf5f629
commit 708b6a643c
4 changed files with 39 additions and 9 deletions

View file

@ -623,6 +623,14 @@ static inline int is_error(abi_long ret)
return (abi_ulong)ret >= (abi_ulong)(-4096);
}
/**
* preexit_cleanup: housekeeping before the guest exits
*
* env: the CPU state
* code: the exit code
*/
void preexit_cleanup(CPUArchState *env, int code);
/* Include target-specific struct and function definitions;
* they may need access to the target-independent structures
* above, so include them last.