@samitouri / QOSamiQemu / commits / 9ecb5063c6

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>

Peter Maydell committed May 26, 2026 at 16:17 UTC 9ecb5063c6f90f35ef3559af63543521a1bdbb85
2 files changed +15 -2
linux-user/qemu.h
-2
@@ -371,6 +371,4 @@ void *lock_user_string(abi_ulong guest_addr);
371 /* Clone cpu state */
372 CPUArchState *cpu_copy(CPUArchState *env);
373
374 -void init_main_thread(CPUState *cs, struct image_info *info);
375 -
374 #endif /* QEMU_H */
linux-user/user-internals.h
+15
@@ -194,6 +194,21 @@ static inline void begin_parallel_context(CPUState *cs)
194 }
195 }
196
197 +/**
198 + * init_main_thread: Set CPU state for main thread
199 + * @cs: CPU context to set
200 + * @info: information about the image being loaded
201 + *
202 + * This function must be provided by the per-target code. It should
203 + * set the initial CPU state based on the information about the
204 + * starting binary in @image_info. This will be at a minimum setting
205 + * the initial guest program counter and stack pointer; it should
206 + * also set up any other guest register values where the Linux ABI
207 + * defines that they start set to some other value than what the
208 + * guest CPU architecture gives you out of reset.
209 + */
210 +void init_main_thread(CPUState *cs, struct image_info *info);
211 +
212 /*
213 * Include target-specific struct and function definitions;
214 * they may need access to the target-independent structures