added enum for memory types

This commit is contained in:
Stanislav Shwartsman 2009-01-03 20:04:03 +00:00
parent 4757acfeaf
commit 69153fc532
2 changed files with 17 additions and 7 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.h,v 1.546 2009-01-02 13:21:48 sshwarts Exp $
// $Id: cpu.h,v 1.547 2009-01-03 20:04:02 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -333,6 +333,16 @@
#define BX_MSR_MTRR_DEFTYPE 0x2ff
#endif
enum {
BX_MEMTYPE_UC = 0,
BX_MEMTYPE_WC,
BX_MEMTYPE_RESERVED2,
BX_MEMTYPE_RESERVED3,
BX_MEMTYPE_WT,
BX_MEMTYPE_WP,
BX_MEMTYPE_WB
};
#if BX_SUPPORT_X86_64
#define BX_MSR_EFER 0xc0000080
#define BX_MSR_STAR 0xc0000081

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: msr.cc,v 1.6 2008-12-30 18:16:30 sshwarts Exp $
// $Id: msr.cc,v 1.7 2009-01-03 20:04:03 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2008 Stanislav Shwartsman
@ -219,11 +219,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::RDMSR(bxInstruction_c *i)
BX_CPP_INLINE bx_bool isMemTypeValidMTTR(Bit8u memtype)
{
switch(memtype) {
case 0x00: // UC
case 0x01: // WC
case 0x04: // WT
case 0x05: // WP
case 0x06: // WB
case BX_MEMTYPE_UC:
case BX_MEMTYPE_WC:
case BX_MEMTYPE_WT:
case BX_MEMTYPE_WP:
case BX_MEMTYPE_WB:
return 1;
default:
return 0;