Patchwork [1/5] target-alpha/machine.c: use VMSTATE_UINT64* instead of VMSTATE_UINTTL*

login
register
mail settings
Submitter Mitsyanko Igor
Date Feb. 22, 2012, 10:15 a.m.
Message ID <1329905754-11873-2-git-send-email-i.mitsyanko@samsung.com>
Download mbox | patch
Permalink /patch/142445/
State New
Headers show

Comments

Mitsyanko Igor - Feb. 22, 2012, 10:15 a.m.
Do not use VMSTATE_UINTTL* macro for variables that are actually defined as uint64_t
in CPUAlphaState.

Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
---
 target-alpha/machine.c |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)
Peter Maydell - Feb. 22, 2012, 11:19 a.m.
Looks plausible but cc'ing the Alpha maintainer...

-- PMM

On 22 February 2012 10:15, Igor Mitsyanko <i.mitsyanko@samsung.com> wrote:
> Do not use VMSTATE_UINTTL* macro for variables that are actually defined as uint64_t
> in CPUAlphaState.
>
> Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
> ---
>  target-alpha/machine.c |   34 +++++++++++++++++-----------------
>  1 files changed, 17 insertions(+), 17 deletions(-)
>
> diff --git a/target-alpha/machine.c b/target-alpha/machine.c
> index 76d70d9..f1eef3d 100644
> --- a/target-alpha/machine.c
> +++ b/target-alpha/machine.c
> @@ -21,8 +21,8 @@ static const VMStateInfo vmstate_fpcr = {
>  };
>
>  static VMStateField vmstate_cpu_fields[] = {
> -    VMSTATE_UINTTL_ARRAY(ir, CPUState, 31),
> -    VMSTATE_UINTTL_ARRAY(fir, CPUState, 31),
> +    VMSTATE_UINT64_ARRAY(ir, CPUState, 31),
> +    VMSTATE_UINT64_ARRAY(fir, CPUState, 31),
>     /* Save the architecture value of the fpcr, not the internally
>        expanded version.  Since this architecture value does not
>        exist in memory to be stored, this requires a but of hoop
> @@ -37,10 +37,10 @@ static VMStateField vmstate_cpu_fields[] = {
>         .flags = VMS_SINGLE,
>         .offset = 0
>     },
> -    VMSTATE_UINTTL(pc, CPUState),
> -    VMSTATE_UINTTL(unique, CPUState),
> -    VMSTATE_UINTTL(lock_addr, CPUState),
> -    VMSTATE_UINTTL(lock_value, CPUState),
> +    VMSTATE_UINT64(pc, CPUState),
> +    VMSTATE_UINT64(unique, CPUState),
> +    VMSTATE_UINT64(lock_addr, CPUState),
> +    VMSTATE_UINT64(lock_value, CPUState),
>     /* Note that lock_st_addr is not saved; it is a temporary
>        used during the execution of the st[lq]_c insns.  */
>
> @@ -51,19 +51,19 @@ static VMStateField vmstate_cpu_fields[] = {
>
>     VMSTATE_UINT32(pcc_ofs, CPUState),
>
> -    VMSTATE_UINTTL(trap_arg0, CPUState),
> -    VMSTATE_UINTTL(trap_arg1, CPUState),
> -    VMSTATE_UINTTL(trap_arg2, CPUState),
> +    VMSTATE_UINT64(trap_arg0, CPUState),
> +    VMSTATE_UINT64(trap_arg1, CPUState),
> +    VMSTATE_UINT64(trap_arg2, CPUState),
>
> -    VMSTATE_UINTTL(exc_addr, CPUState),
> -    VMSTATE_UINTTL(palbr, CPUState),
> -    VMSTATE_UINTTL(ptbr, CPUState),
> -    VMSTATE_UINTTL(vptptr, CPUState),
> -    VMSTATE_UINTTL(sysval, CPUState),
> -    VMSTATE_UINTTL(usp, CPUState),
> +    VMSTATE_UINT64(exc_addr, CPUState),
> +    VMSTATE_UINT64(palbr, CPUState),
> +    VMSTATE_UINT64(ptbr, CPUState),
> +    VMSTATE_UINT64(vptptr, CPUState),
> +    VMSTATE_UINT64(sysval, CPUState),
> +    VMSTATE_UINT64(usp, CPUState),
>
> -    VMSTATE_UINTTL_ARRAY(shadow, CPUState, 8),
> -    VMSTATE_UINTTL_ARRAY(scratch, CPUState, 24),
> +    VMSTATE_UINT64_ARRAY(shadow, CPUState, 8),
> +    VMSTATE_UINT64_ARRAY(scratch, CPUState, 24),
>
>     VMSTATE_END_OF_LIST()
>  };
> --
> 1.7.4.1
>
Juan Quintela - Feb. 22, 2012, 1:49 p.m.
Igor Mitsyanko <i.mitsyanko@samsung.com> wrote:
> Do not use VMSTATE_UINTTL* macro for variables that are actually defined as uint64_t
> in CPUAlphaState.

Old code is wrong (TM).  I think that your changes are ok.

Patch

diff --git a/target-alpha/machine.c b/target-alpha/machine.c
index 76d70d9..f1eef3d 100644
--- a/target-alpha/machine.c
+++ b/target-alpha/machine.c
@@ -21,8 +21,8 @@  static const VMStateInfo vmstate_fpcr = {
 };
 
 static VMStateField vmstate_cpu_fields[] = {
-    VMSTATE_UINTTL_ARRAY(ir, CPUState, 31),
-    VMSTATE_UINTTL_ARRAY(fir, CPUState, 31),
+    VMSTATE_UINT64_ARRAY(ir, CPUState, 31),
+    VMSTATE_UINT64_ARRAY(fir, CPUState, 31),
     /* Save the architecture value of the fpcr, not the internally
        expanded version.  Since this architecture value does not
        exist in memory to be stored, this requires a but of hoop
@@ -37,10 +37,10 @@  static VMStateField vmstate_cpu_fields[] = {
         .flags = VMS_SINGLE,
         .offset = 0
     },
-    VMSTATE_UINTTL(pc, CPUState),
-    VMSTATE_UINTTL(unique, CPUState),
-    VMSTATE_UINTTL(lock_addr, CPUState),
-    VMSTATE_UINTTL(lock_value, CPUState),
+    VMSTATE_UINT64(pc, CPUState),
+    VMSTATE_UINT64(unique, CPUState),
+    VMSTATE_UINT64(lock_addr, CPUState),
+    VMSTATE_UINT64(lock_value, CPUState),
     /* Note that lock_st_addr is not saved; it is a temporary
        used during the execution of the st[lq]_c insns.  */
 
@@ -51,19 +51,19 @@  static VMStateField vmstate_cpu_fields[] = {
 
     VMSTATE_UINT32(pcc_ofs, CPUState),
 
-    VMSTATE_UINTTL(trap_arg0, CPUState),
-    VMSTATE_UINTTL(trap_arg1, CPUState),
-    VMSTATE_UINTTL(trap_arg2, CPUState),
+    VMSTATE_UINT64(trap_arg0, CPUState),
+    VMSTATE_UINT64(trap_arg1, CPUState),
+    VMSTATE_UINT64(trap_arg2, CPUState),
 
-    VMSTATE_UINTTL(exc_addr, CPUState),
-    VMSTATE_UINTTL(palbr, CPUState),
-    VMSTATE_UINTTL(ptbr, CPUState),
-    VMSTATE_UINTTL(vptptr, CPUState),
-    VMSTATE_UINTTL(sysval, CPUState),
-    VMSTATE_UINTTL(usp, CPUState),
+    VMSTATE_UINT64(exc_addr, CPUState),
+    VMSTATE_UINT64(palbr, CPUState),
+    VMSTATE_UINT64(ptbr, CPUState),
+    VMSTATE_UINT64(vptptr, CPUState),
+    VMSTATE_UINT64(sysval, CPUState),
+    VMSTATE_UINT64(usp, CPUState),
 
-    VMSTATE_UINTTL_ARRAY(shadow, CPUState, 8),
-    VMSTATE_UINTTL_ARRAY(scratch, CPUState, 24),
+    VMSTATE_UINT64_ARRAY(shadow, CPUState, 8),
+    VMSTATE_UINT64_ARRAY(scratch, CPUState, 24),
 
     VMSTATE_END_OF_LIST()
 };