On 12/12/24 10:53, Philippe Mathieu-Daudé wrote:
> Declare cpu_loop() once in "user/cpu_loop.h".
> bsd-user gets the G_NORETURN attribute.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> bsd-user/qemu.h | 2 +-
> include/user/cpu_loop.h | 2 ++
> linux-user/user-internals.h | 1 -
> 3 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
> index 04faee459df..3eaa14f3f56 100644
> --- a/bsd-user/qemu.h
> +++ b/bsd-user/qemu.h
> @@ -26,6 +26,7 @@
> #include "exec/exec-all.h"
>
> #include "user/abitypes.h"
> +#include "user/cpu_loop.h"
> #include "user/page-protection.h"
>
> extern char **environ;
> @@ -187,7 +188,6 @@ abi_long do_openbsd_syscall(void *cpu_env, int num, abi_long arg1,
> abi_long arg5, abi_long arg6);
> void gemu_log(const char *fmt, ...) G_GNUC_PRINTF(1, 2);
> extern __thread CPUState *thread_cpu;
> -void cpu_loop(CPUArchState *env);
> char *target_strerror(int err);
> int get_osversion(void);
> void fork_start(void);
> diff --git a/include/user/cpu_loop.h b/include/user/cpu_loop.h
> index 8e2df232758..b0d4704018d 100644
> --- a/include/user/cpu_loop.h
> +++ b/include/user/cpu_loop.h
> @@ -23,6 +23,8 @@
> #include "exec/log.h"
> #include "special-errno.h"
>
> +G_NORETURN void cpu_loop(CPUArchState *env);
> +
> void target_exception_dump(CPUArchState *env, const char *fmt, int code);
> #define EXCP_DUMP(env, fmt, code) \
> target_exception_dump(env, fmt, code)
> diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h
> index 46ffc093f40..b9b05c1d11f 100644
> --- a/linux-user/user-internals.h
> +++ b/linux-user/user-internals.h
> @@ -65,7 +65,6 @@ abi_long do_syscall(CPUArchState *cpu_env, int num, abi_long arg1,
> abi_long arg5, abi_long arg6, abi_long arg7,
> abi_long arg8);
> extern __thread CPUState *thread_cpu;
> -G_NORETURN void cpu_loop(CPUArchState *env);
> abi_long get_errno(abi_long ret);
> const char *target_strerror(int err);
> int get_osversion(void);
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>