diff mbox series

[PATCH-for-10.1,1/3] target/mips: Inline qemu_get_betls() and qemu_put_betls()

Message ID 20250323225047.35419-2-philmd@linaro.org
State New
Headers show
Series migration/cpu: Remove qemu_{get, put}_[s]betl[s] macros | expand

Commit Message

Philippe Mathieu-Daudé March 23, 2025, 10:50 p.m. UTC
We only use qemu_get_betls() and qemu_put_betls() once in
the whole code base. Inline them (checking TARGET_MIPS64
instead of TARGET_LONG_BITS == 64) so we can remove them
later as unused.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/mips/system/machine.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Pierrick Bouvier March 24, 2025, 8:53 p.m. UTC | #1
On 3/23/25 15:50, Philippe Mathieu-Daudé wrote:
> We only use qemu_get_betls() and qemu_put_betls() once in
> the whole code base. Inline them (checking TARGET_MIPS64
> instead of TARGET_LONG_BITS == 64) so we can remove them
> later as unused.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/mips/system/machine.c | 12 ++++++++++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/target/mips/system/machine.c b/target/mips/system/machine.c
> index 8af11fd896b..c4c92a9a1ca 100644
> --- a/target/mips/system/machine.c
> +++ b/target/mips/system/machine.c
> @@ -139,7 +139,11 @@ static int get_tlb(QEMUFile *f, void *pv, size_t size,
>       r4k_tlb_t *v = pv;
>       uint16_t flags;
>   
> -    qemu_get_betls(f, &v->VPN);
> +#ifdef TARGET_MIPS64
> +    qemu_get_be64s(f, &v->VPN);
> +#else
> +    qemu_get_be32s(f, &v->VPN);
> +#endif
>       qemu_get_be32s(f, &v->PageMask);
>       qemu_get_be16s(f, &v->ASID);
>       qemu_get_be32s(f, &v->MMID);
> @@ -182,7 +186,11 @@ static int put_tlb(QEMUFile *f, void *pv, size_t size,
>                         (v->D0 << 1) |
>                         (v->D1 << 0));
>   
> -    qemu_put_betls(f, &v->VPN);
> +#ifdef TARGET_MIPS64
> +    qemu_put_be64s(f, &v->VPN);
> +#else
> +    qemu_put_be32s(f, &v->VPN);
> +#endif
>       qemu_put_be32s(f, &v->PageMask);
>       qemu_put_be16s(f, &asid);
>       qemu_put_be32s(f, &mmid);

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
diff mbox series

Patch

diff --git a/target/mips/system/machine.c b/target/mips/system/machine.c
index 8af11fd896b..c4c92a9a1ca 100644
--- a/target/mips/system/machine.c
+++ b/target/mips/system/machine.c
@@ -139,7 +139,11 @@  static int get_tlb(QEMUFile *f, void *pv, size_t size,
     r4k_tlb_t *v = pv;
     uint16_t flags;
 
-    qemu_get_betls(f, &v->VPN);
+#ifdef TARGET_MIPS64
+    qemu_get_be64s(f, &v->VPN);
+#else
+    qemu_get_be32s(f, &v->VPN);
+#endif
     qemu_get_be32s(f, &v->PageMask);
     qemu_get_be16s(f, &v->ASID);
     qemu_get_be32s(f, &v->MMID);
@@ -182,7 +186,11 @@  static int put_tlb(QEMUFile *f, void *pv, size_t size,
                       (v->D0 << 1) |
                       (v->D1 << 0));
 
-    qemu_put_betls(f, &v->VPN);
+#ifdef TARGET_MIPS64
+    qemu_put_be64s(f, &v->VPN);
+#else
+    qemu_put_be32s(f, &v->VPN);
+#endif
     qemu_put_be32s(f, &v->PageMask);
     qemu_put_be16s(f, &asid);
     qemu_put_be32s(f, &mmid);