qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: [PATCH v2 1/2] tcg: Remove argument to tcg_prologue_init
Date: Fri, 29 Sep 2023 20:11:13 -0700	[thread overview]
Message-ID: <20230930031114.1042913-2-richard.henderson@linaro.org> (raw)
In-Reply-To: <20230930031114.1042913-1-richard.henderson@linaro.org>

We can load tcg_ctx just as easily within the callee.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 include/tcg/tcg.h   | 2 +-
 accel/tcg/tcg-all.c | 2 +-
 bsd-user/main.c     | 2 +-
 linux-user/main.c   | 2 +-
 tcg/tcg.c           | 3 ++-
 5 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index c9c6d770d0..44aced2ddd 100644
--- a/include/tcg/tcg.h
+++ b/include/tcg/tcg.h
@@ -785,7 +785,7 @@ static inline void *tcg_malloc(int size)
 
 void tcg_init(size_t tb_size, int splitwx, unsigned max_cpus);
 void tcg_register_thread(void);
-void tcg_prologue_init(TCGContext *s);
+void tcg_prologue_init(void);
 void tcg_func_start(TCGContext *s);
 
 int tcg_gen_code(TCGContext *s, TranslationBlock *tb, uint64_t pc_start);
diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c
index 03dfd67e9e..d9d8dde202 100644
--- a/accel/tcg/tcg-all.c
+++ b/accel/tcg/tcg-all.c
@@ -121,7 +121,7 @@ static int tcg_init_machine(MachineState *ms)
      * There's no guest base to take into account, so go ahead and
      * initialize the prologue now.
      */
-    tcg_prologue_init(tcg_ctx);
+    tcg_prologue_init();
 #endif
 
     return 0;
diff --git a/bsd-user/main.c b/bsd-user/main.c
index f913cb55a7..dcdaf059bc 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -586,7 +586,7 @@ int main(int argc, char **argv)
      * generating the prologue until now so that the prologue can take
      * the real value of GUEST_BASE into account.
      */
-    tcg_prologue_init(tcg_ctx);
+    tcg_prologue_init();
 
     target_cpu_init(env, regs);
 
diff --git a/linux-user/main.c b/linux-user/main.c
index 96be354897..66962e1d4a 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -994,7 +994,7 @@ int main(int argc, char **argv, char **envp)
     /* Now that we've loaded the binary, GUEST_BASE is fixed.  Delay
        generating the prologue until now so that the prologue can take
        the real value of GUEST_BASE into account.  */
-    tcg_prologue_init(tcg_ctx);
+    tcg_prologue_init();
 
     target_cpu_copy_regs(env, regs);
 
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 604fa9bf3e..4ec4f34b93 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1387,8 +1387,9 @@ TranslationBlock *tcg_tb_alloc(TCGContext *s)
     return tb;
 }
 
-void tcg_prologue_init(TCGContext *s)
+void tcg_prologue_init(void)
 {
+    TCGContext *s = tcg_ctx;
     size_t prologue_size;
 
     s->code_ptr = s->code_gen_ptr;
-- 
2.34.1



  reply	other threads:[~2023-09-30  3:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-30  3:11 [PATCH v2 0/2] Split out tcg init functions to tcg/startup.h Richard Henderson
2023-09-30  3:11 ` Richard Henderson [this message]
2023-09-30  3:11 ` [PATCH v2 2/2] tcg: " Richard Henderson
2023-10-02 12:51 ` [PATCH v2 0/2] " Philippe Mathieu-Daudé

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=20230930031114.1042913-2-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).