From 69153fc5325dd85bbcdc1c364c004fb995dd7c64 Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Sat, 3 Jan 2009 20:04:03 +0000 Subject: [PATCH] added enum for memory types --- bochs/cpu/cpu.h | 12 +++++++++++- bochs/cpu/msr.cc | 12 ++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/bochs/cpu/cpu.h b/bochs/cpu/cpu.h index 4738f53c7..1b76eac2f 100644 --- a/bochs/cpu/cpu.h +++ b/bochs/cpu/cpu.h @@ -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 diff --git a/bochs/cpu/msr.cc b/bochs/cpu/msr.cc index ed983439e..4c267bd0e 100755 --- a/bochs/cpu/msr.cc +++ b/bochs/cpu/msr.cc @@ -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;