Define LIN and PHY address size in config.h

This commit is contained in:
Stanislav Shwartsman 2007-04-14 10:05:30 +00:00
parent 3886e35bcb
commit 6c139a9c8c
4 changed files with 13 additions and 9 deletions

View File

@ -518,6 +518,13 @@ typedef Bit32u bx_address;
typedef Bit32u bx_phy_address;
typedef bx_address bx_lin_address;
#define BX_PHY_ADDRESS_WIDTH 32
#if BX_SUPPORT_X86_64
#define BX_LIN_ADDRESS_WIDTH 48
#else
#define BX_LIN_ADDRESS_WIDTH 32
#endif
// technically, in an 8 bit signed the real minimum is -128, not -127.
// But if you decide to negate -128 you tend to get -128 again, so it's
// better not to use the absolute maximum in the signed range.

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.h,v 1.317 2007-04-09 21:14:59 sshwarts Exp $
// $Id: cpu.h,v 1.318 2007-04-14 10:05:30 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -331,10 +331,8 @@
const char* cpu_mode_string(unsigned cpu_mode);
#define BX_CANONICAL_BITS (48)
#if BX_SUPPORT_X86_64
#define IsCanonical(offset) ((Bit64u)((((Bit64s)(offset)) >> (BX_CANONICAL_BITS-1)) + 1) < 2)
#define IsCanonical(offset) ((Bit64u)((((Bit64s)(offset)) >> (BX_LIN_ADDRESS_WIDTH-1)) + 1) < 2)
#else
#define IsCanonical(offset) (0)
#endif

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpuid.cc,v 1.41 2007-01-29 17:56:03 sshwarts Exp $
// $Id: cpuid.cc,v 1.42 2007-04-14 10:05:30 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -421,7 +421,7 @@ void BX_CPU_C::CPUID(bxInstruction_c *i)
break;
case 0x80000008:
// virtual & phys address size in low 2 bytes.
RAX = 0x00003020; // 48-bit virtual address and 32 bit physical
RAX = BX_PHY_ADDRESS_WIDTH | (BX_LIN_ADDRESS_WIDTH<<8);
RBX = 0;
RCX = 0;
RDX = 0; // Reserved, undefined

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: proc_ctrl.cc,v 1.162 2007-02-23 22:08:43 sshwarts Exp $
// $Id: proc_ctrl.cc,v 1.163 2007-04-14 10:05:30 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -195,8 +195,7 @@ void BX_CPU_C::CLFLUSH(bxInstruction_c *i)
#if BX_SUPPORT_CLFLUSH
// check if we could access the memory
bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[i->seg()];
read_virtual_checks(seg, RMAddr(i), 1);
read_virtual_checks(&BX_CPU_THIS_PTR sregs[i->seg()], RMAddr(i), 1);
#else
BX_INFO(("CLFLUSH: not supported, enable with SSE2"));
UndefinedOpcode(i);