msr.hh (8582:dd79a696b91c) | msr.hh (9875:5cfad3486991) |
---|---|
1/* 2 * Copyright (c) 2011 Google 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 18 unchanged lines hidden (view full) --- 27 * 28 * Authors: Gabe Black 29 */ 30 31#ifndef __ARCH_X86_REG_MSR_HH__ 32#define __ARCH_X86_REG_MSR_HH__ 33 34#include "arch/x86/regs/misc.hh" | 1/* 2 * Copyright (c) 2011 Google 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 18 unchanged lines hidden (view full) --- 27 * 28 * Authors: Gabe Black 29 */ 30 31#ifndef __ARCH_X86_REG_MSR_HH__ 32#define __ARCH_X86_REG_MSR_HH__ 33 34#include "arch/x86/regs/misc.hh" |
35#include "base/hashmap.hh" |
|
35#include "base/types.hh" 36 37namespace X86ISA 38{ 39 | 36#include "base/types.hh" 37 38namespace X86ISA 39{ 40 |
41typedef m5::hash_map<Addr, MiscRegIndex> MsrMap; 42 43/** 44 * Map between MSR addresses and their corresponding misc registers. 45 * 46 * @note This map is usually only used when enumeration of supported 47 * MSRs is needed (e.g., in virtualized CPUs). Code that needs to 48 * look-up specific MSRs should use msrAddrToIndex(). 49 */ 50extern const MsrMap msrMap; 51 52/** 53 * Find and return the misc reg corresponding to an MSR address. 54 * 55 * Look for an MSR (addr) in #msrMap and return the 56 * corresponding misc reg in regNum. The value of regNum is undefined 57 * if the MSR was not found. 58 * 59 * @param regNum misc reg index (out). 60 * @param addr MSR address 61 * @return True if the MSR was found, false otherwise. 62 */ |
|
40bool msrAddrToIndex(MiscRegIndex ®Num, Addr addr); 41 42} // namespace X86ISA 43 44#endif // __ARCH_X86_REG_MSR_HH__ | 63bool msrAddrToIndex(MiscRegIndex ®Num, Addr addr); 64 65} // namespace X86ISA 66 67#endif // __ARCH_X86_REG_MSR_HH__ |