diff mbox series

[03/17] bsd-user: Make cpu_model and cpu_type file scope

Message ID 20240802235617.7971-4-imp@bsdimp.com (mailing list archive)
State New, archived
Headers show
Series For 9.2: A bunch of cleanups and work towards variable pagesize support | expand

Commit Message

Warner Losh Aug. 2, 2024, 11:56 p.m. UTC
linux-user already does this since 2278b93941d4. That same commit just
added them with main() scope to bsd-user. We need the cpu_type, like
linux-user does, to create new CPUs outside of main to support
threading. Move both cpu_model and cpu_type to mirror linux-user/main.c.

Signed-off-by: Warner Losh <imp@bsdimp.com>
---
 bsd-user/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Richard Henderson Aug. 4, 2024, 7:22 a.m. UTC | #1
On 8/3/24 09:56, Warner Losh wrote:
> linux-user already does this since 2278b93941d4. That same commit just
> added them with main() scope to bsd-user. We need the cpu_type, like
> linux-user does, to create new CPUs outside of main to support
> threading. Move both cpu_model and cpu_type to mirror linux-user/main.c.
> 
> Signed-off-by: Warner Losh<imp@bsdimp.com>
> ---
>   bsd-user/main.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/bsd-user/main.c b/bsd-user/main.c
index 4d29e13a8f5..1533fd51168 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -62,6 +62,8 @@  intptr_t qemu_host_page_mask;
 static bool opt_one_insn_per_tb;
 uintptr_t guest_base;
 bool have_guest_base;
+static const char *cpu_model;
+static const char *cpu_type;
 /*
  * When running 32-on-64 we should make sure we can fit all of the possible
  * guest address space into a contiguous chunk of virtual host memory.
@@ -251,8 +253,6 @@  adjust_ssize(void)
 int main(int argc, char **argv)
 {
     const char *filename;
-    const char *cpu_model;
-    const char *cpu_type;
     const char *log_file = NULL;
     const char *log_mask = NULL;
     const char *seed_optarg = NULL;