2003-04-23 00:21:34 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2011-02-25 00:54:04 +03:00
|
|
|
// $Id$
|
2005-03-19 23:44:01 +03:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2001-04-10 05:04:59 +04:00
|
|
|
//
|
2011-07-07 00:01:18 +04:00
|
|
|
// Copyright (c) 2004-2011 Stanislav Shwartsman
|
2007-10-16 02:07:52 +04:00
|
|
|
// Written by Stanislav Shwartsman [sshwarts at sourceforge net]
|
2001-04-10 05:04:59 +04:00
|
|
|
//
|
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
|
|
|
// version 2 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
2009-01-16 21:18:59 +03:00
|
|
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA B 02110-1301 USA
|
2004-04-09 19:34:59 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2008-04-03 22:13:26 +04:00
|
|
|
#define NEED_CPU_REG_SHORTCUTS 1
|
2003-12-27 16:50:06 +03:00
|
|
|
#include "bochs.h"
|
2006-03-07 01:03:16 +03:00
|
|
|
#include "cpu.h"
|
2003-12-27 16:50:06 +03:00
|
|
|
#define LOG_THIS BX_CPU_THIS_PTR
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2004-04-09 19:34:59 +04:00
|
|
|
/* 9B */
|
2011-07-07 00:01:18 +04:00
|
|
|
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::FWAIT(bxInstruction_c *i)
|
2003-12-27 16:50:06 +03:00
|
|
|
{
|
|
|
|
#if BX_SUPPORT_FPU
|
2007-07-09 19:16:14 +04:00
|
|
|
if (BX_CPU_THIS_PTR cr0.get_TS() && BX_CPU_THIS_PTR cr0.get_MP())
|
2010-03-14 18:51:27 +03:00
|
|
|
exception(BX_NM_EXCEPTION, 0);
|
2003-12-27 16:50:06 +03:00
|
|
|
|
2004-02-13 00:34:28 +03:00
|
|
|
BX_CPU_THIS_PTR FPU_check_pending_exceptions();
|
2011-07-07 00:01:18 +04:00
|
|
|
|
|
|
|
BX_NEXT_INSTR(i);
|
2003-12-27 16:50:06 +03:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2004-04-09 19:34:59 +04:00
|
|
|
/* relevant only when FPU support is disabled */
|
|
|
|
#if BX_SUPPORT_FPU == 0
|
2011-07-07 00:01:18 +04:00
|
|
|
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::FPU_ESC(bxInstruction_c *i)
|
2003-12-27 16:50:06 +03:00
|
|
|
{
|
2007-07-09 19:16:14 +04:00
|
|
|
if (BX_CPU_THIS_PTR cr0.get_EM() || BX_CPU_THIS_PTR cr0.get_TS())
|
2010-03-14 18:51:27 +03:00
|
|
|
exception(BX_NM_EXCEPTION, 0);
|
2011-07-07 00:01:18 +04:00
|
|
|
|
|
|
|
BX_NEXT_INSTR(i);
|
2003-12-27 16:50:06 +03:00
|
|
|
}
|
|
|
|
#endif
|