aboutsummaryrefslogtreecommitdiff
path: root/target-i386
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-09-29 22:48:50 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-05 09:32:40 -0500
commiteb831623114b6b74172629f9f6db7b7eb979d90b (patch)
tree35dea7fa1adbb22ad892a4d8d0a6120801575f0d /target-i386
parent5ee0ffaa42b02e04d8047c7fc32687b348719294 (diff)
downloadqemu-eb831623114b6b74172629f9f6db7b7eb979d90b.zip
qemu-eb831623114b6b74172629f9f6db7b7eb979d90b.tar.gz
qemu-eb831623114b6b74172629f9f6db7b7eb979d90b.tar.bz2
x86: fpuc is uint16_t not unsigned int
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/cpu.h2
-rw-r--r--target-i386/machine.c10
2 files changed, 5 insertions, 7 deletions
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index a4acf86..3e0dbd4 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -594,7 +594,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 23c01ee..912c74d 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);
@@ -198,7 +197,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);
@@ -210,7 +209,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);
@@ -260,7 +259,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;