From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49239) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQOTf-0007Y6-8H for qemu-devel@nongnu.org; Sat, 06 Sep 2014 18:29:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XQOTV-0005mT-L2 for qemu-devel@nongnu.org; Sat, 06 Sep 2014 18:29:03 -0400 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:50572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQOTV-0005mI-D8 for qemu-devel@nongnu.org; Sat, 06 Sep 2014 18:28:53 -0400 Received: by mail-wi0-f180.google.com with SMTP id ex7so964674wid.7 for ; Sat, 06 Sep 2014 15:28:52 -0700 (PDT) From: Jaume Marti Farriol Date: Sun, 7 Sep 2014 00:31:58 +0200 Message-Id: <1410042720-17750-2-git-send-email-jaume.martif@gmail.com> In-Reply-To: <1410042720-17750-1-git-send-email-jaume.martif@gmail.com> References: <1410042720-17750-1-git-send-email-jaume.martif@gmail.com> Subject: [Qemu-devel] [PATCH v3 1/3] target-i386: x87 exception pointers using TCG. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jaume Marti Farriol , "Michael S. Tsirkin" , Marcelo Tosatti , Vadim Rozenfeld , Paolo Bonzini , Laszlo Ersek , =?UTF-8?q?Andreas=20F=C3=A4rber?= This adds new fields in the CPUX86State struct to store the x87 exception pointers. Also it adds a new enum type that encodes the operand size and the processor operating mode (protected and real mode). Signed-off-by: jaume.martif@gmail.com --- target-i386/cpu.h | 23 +++++++++++++++++++++-- target-i386/machine.c | 2 +- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 3460b12..a749c43 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -690,6 +690,24 @@ typedef enum { CC_OP_NB, } CCOp; +typedef enum { + B8 = 0, + B16 = 1, + B32 = 2, + B64 = 3, + BSIZE = 3, /* Mask for the above. */ + + RM = 4, + PM = 8, + + PM32 = PM | B32, + PM16 = PM | B16, + RM32 = RM | B32, + RM16 = RM | B16, +} OMode; + +#define TO_OMODE(bsize, is_pm) ((bsize & BSIZE) | (1 << (is_pm ? 3 : 2))) + typedef struct SegmentCache { uint32_t selector; target_ulong base; @@ -821,10 +839,11 @@ typedef struct CPUX86State { uint16_t fpuc; uint8_t fptags[8]; /* 0 = valid, 1 = empty */ FPReg fpregs[8]; - /* KVM-only so far */ - uint16_t fpop; + uint32_t fpop; uint64_t fpip; uint64_t fpdp; + uint32_t fpcs; + uint32_t fpds; /* emulator internal variables */ float_status fp_status; diff --git a/target-i386/machine.c b/target-i386/machine.c index fb89065..0557100 100644 --- a/target-i386/machine.c +++ b/target-i386/machine.c @@ -397,7 +397,7 @@ static const VMStateDescription vmstate_fpop_ip_dp = { .version_id = 1, .minimum_version_id = 1, .fields = (VMStateField[]) { - VMSTATE_UINT16(env.fpop, X86CPU), + VMSTATE_UINT32(env.fpop, X86CPU), VMSTATE_UINT64(env.fpip, X86CPU), VMSTATE_UINT64(env.fpdp, X86CPU), VMSTATE_END_OF_LIST() -- 2.1.0