linux-user: Move init_main_thread() prototype to user-internals.h

The init_main_thread() prototype is needed only by code internal to
linux-user/, so it doesn't need to be in qemu.h (which is also pulled
in by various files outside linux-user/).

Move the prototype to user-internals.h, and give it a documentation
comment.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Helge Deller <deller@gmx.de>
Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
Peter Maydell
2026-05-26 16:17:56 +01:00
committed by Helge Deller
parent cc39416ec1
commit 9ecb5063c6
2 changed files with 15 additions and 2 deletions

View File

@@ -371,6 +371,4 @@ void *lock_user_string(abi_ulong guest_addr);
/* Clone cpu state */
CPUArchState *cpu_copy(CPUArchState *env);
void init_main_thread(CPUState *cs, struct image_info *info);
#endif /* QEMU_H */

View File

@@ -194,6 +194,21 @@ static inline void begin_parallel_context(CPUState *cs)
}
}
/**
* init_main_thread: Set CPU state for main thread
* @cs: CPU context to set
* @info: information about the image being loaded
*
* This function must be provided by the per-target code. It should
* set the initial CPU state based on the information about the
* starting binary in @image_info. This will be at a minimum setting
* the initial guest program counter and stack pointer; it should
* also set up any other guest register values where the Linux ABI
* defines that they start set to some other value than what the
* guest CPU architecture gives you out of reset.
*/
void init_main_thread(CPUState *cs, struct image_info *info);
/*
* Include target-specific struct and function definitions;
* they may need access to the target-independent structures