All of lore.kernel.org
 help / color / mirror / Atom feed
From: Helge Deller <deller@kernel.org>
To: qemu-devel@nongnu.org
Cc: "Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
	qemu-s390x@nongnu.org,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Eric Farman" <farman@linux.ibm.com>,
	"Matthew Rosato" <mjrosato@linux.ibm.com>,
	"Helge Deller" <deller@gmx.de>,
	"Aleksandar Rikalo" <arikalo@gmail.com>,
	"David Hildenbrand" <david@kernel.org>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Cornelia Huck" <cohuck@redhat.com>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	"Yoshinori Sato" <yoshinori.sato@nifty.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Ilya Leoshkevich" <iii@linux.ibm.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>
Subject: [PULL 11/12] linux-user: Move init_main_thread() prototype to user-internals.h
Date: Tue, 26 May 2026 22:02:06 +0200	[thread overview]
Message-ID: <20260526200207.79738-12-deller@kernel.org> (raw)
In-Reply-To: <20260526200207.79738-1-deller@kernel.org>

From: Peter Maydell <peter.maydell@linaro.org>

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>
---
 linux-user/qemu.h           |  2 --
 linux-user/user-internals.h | 15 +++++++++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index 7f98fb2607..474489f046 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -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 */
diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h
index 21daf422b7..fbfd12237f 100644
--- a/linux-user/user-internals.h
+++ b/linux-user/user-internals.h
@@ -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
-- 
2.54.0



  parent reply	other threads:[~2026-05-26 20:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26 20:01 [PULL 00/12] Linux user next patches Helge Deller
2026-05-26 20:01 ` [PULL 01/12] linux-user/ppc: restore fp_status from FPSCR on sigreturn Helge Deller
2026-05-26 20:01 ` [PULL 02/12] linux-user/mips: save/restore FCSR across signal delivery Helge Deller
2026-05-26 20:01 ` [PULL 03/12] linux-user/alpha: add coredump support Helge Deller
2026-05-27 16:26   ` Richard Henderson
2026-05-26 20:01 ` [PULL 04/12] linux-user/sh4: preserve T/M/Q bits across signal delivery Helge Deller
2026-05-26 20:02 ` [PULL 05/12] linux-user/sh4: restore FP rounding mode on sigreturn Helge Deller
2026-05-26 20:02 ` [PULL 06/12] target/sh4: sync fp_status when gdb writes FPSCR Helge Deller
2026-05-26 20:02 ` [PULL 07/12] linux-user/s390x: restore fpu_status rounding mode from FPC on sigreturn Helge Deller
2026-05-26 20:02 ` [PULL 08/12] linux-user: Implement finer grained madivse() syscall Helge Deller
2026-05-26 20:02 ` [PULL 09/12] linux-user: Fix typo in function documentation for pgb_addr_set() Helge Deller
2026-05-26 20:02 ` [PULL 10/12] linux-user: Fix loading static ARM cortex-m55 binaries Helge Deller
2026-05-26 20:02 ` Helge Deller [this message]
2026-05-26 20:02 ` [PULL 12/12] linux-user: Move cpu_copy() to user-internals.h Helge Deller
2026-05-27 11:41 ` [PULL 00/12] Linux user next patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260526200207.79738-12-deller@kernel.org \
    --to=deller@kernel.org \
    --cc=arikalo@gmail.com \
    --cc=aurelien@aurel32.net \
    --cc=cohuck@redhat.com \
    --cc=david@kernel.org \
    --cc=deller@gmx.de \
    --cc=farman@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=laurent@vivier.eu \
    --cc=mjrosato@linux.ibm.com \
    --cc=philmd@linaro.org \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=yoshinori.sato@nifty.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.