Patchwork [31/49] x86: fpuc is uint16_t not unsigned int

login
register
mail settings
Submitter Juan Quintela
Date Sept. 29, 2009, 8:48 p.m.
Message ID <91715d5552b6e206befc449ef4d969a99f1c3030.1254255997.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/34482/
State Superseded
Headers show

Comments

Juan Quintela - Sept. 29, 2009, 8:48 p.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 target-i386/cpu.h     |    2 +-
 target-i386/machine.c |   10 ++++------
 2 files changed, 5 insertions(+), 7 deletions(-)

Patch

diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 53f5a3d..4969dd1 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -593,7 +593,7 @@  typedef struct CPUX86State {
     /* FPU state */
     unsigned int fpstt; /* top of stack index */
     unsigned int fpus;
-    unsigned int fpuc;
+    uint16_t fpuc;
     uint8_t fptags[8];   /* 0 = valid, 1 = empty */
     union {
 #ifdef USE_X86LDOUBLE
diff --git a/target-i386/machine.c b/target-i386/machine.c
index 3603a59..852eeb7 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -26,7 +26,7 @@  static void cpu_get_seg(QEMUFile *f, SegmentCache *dt)
 void cpu_save(QEMUFile *f, void *opaque)
 {
     CPUState *env = opaque;
-    uint16_t fptag, fpus, fpuc, fpregs_format;
+    uint16_t fptag, fpus, fpregs_format;
     int32_t pending_irq;
     int i, bit;

@@ -39,14 +39,13 @@  void cpu_save(QEMUFile *f, void *opaque)
     qemu_put_be32s(f, &env->hflags);

     /* FPU */
-    fpuc = env->fpuc;
     fpus = (env->fpus & ~0x3800) | (env->fpstt & 0x7) << 11;
     fptag = 0;
     for(i = 0; i < 8; i++) {
         fptag |= ((!env->fptags[i]) << i);
     }

-    qemu_put_be16s(f, &fpuc);
+    qemu_put_be16s(f, &env->fpuc);
     qemu_put_be16s(f, &fpus);
     qemu_put_be16s(f, &fptag);

@@ -197,7 +196,7 @@  int cpu_load(QEMUFile *f, void *opaque, int version_id)
 {
     CPUState *env = opaque;
     int i, guess_mmx;
-    uint16_t fpus, fpuc, fptag, fpregs_format;
+    uint16_t fpus, fptag, fpregs_format;
     int32_t pending_irq;

     cpu_synchronize_state(env);
@@ -209,7 +208,7 @@  int cpu_load(QEMUFile *f, void *opaque, int version_id)
     qemu_get_betls(f, &env->eflags);
     qemu_get_be32s(f, &env->hflags);

-    qemu_get_be16s(f, &fpuc);
+    qemu_get_be16s(f, &env->fpuc);
     qemu_get_be16s(f, &fpus);
     qemu_get_be16s(f, &fptag);
     qemu_get_be16s(f, &fpregs_format);
@@ -259,7 +258,6 @@  int cpu_load(QEMUFile *f, void *opaque, int version_id)
         }
     }

-    env->fpuc = fpuc;
     /* XXX: restore FPU round state */
     env->fpstt = (fpus >> 11) & 7;
     env->fpus = fpus & ~0x3800;