00001 #ifndef ARCH_HOOKS_XBOX_H 00002 #define ARCH_HOOKS_XBOX_H 00003 00004 #include "ArchHooks.h" 00005 class RageMutex; 00006 00007 class ArchHooks_Xbox: public ArchHooks 00008 { 00009 public: 00010 ArchHooks_Xbox(); 00011 ~ArchHooks_Xbox(); 00012 }; 00013 00014 // Read a 64 bit MSR register 00015 inline void READMSRREG( UINT32 reg, LARGE_INTEGER *val ) 00016 { 00017 UINT32 lowPart, highPart; 00018 __asm 00019 { 00020 mov ecx, reg 00021 rdmsr 00022 mov lowPart, eax 00023 mov highPart, edx 00024 }; 00025 00026 val->LowPart = lowPart; 00027 val->HighPart = highPart; 00028 } 00029 00030 // Write a 64 bit MSR register 00031 inline void WRITEMSRREG( UINT32 reg, LARGE_INTEGER val ) 00032 { 00033 __asm 00034 { 00035 mov ecx, reg 00036 mov eax, val.LowPart 00037 mov edx, val.HighPart 00038 wrmsr 00039 }; 00040 } 00041 00042 #undef ARCH_HOOKS 00043 #define ARCH_HOOKS ArchHooks_Xbox 00044 00045 #endif 00046 /* 00047 * (c) 2002-2004 Glenn Maynard, Chris Danford 00048 * All rights reserved. 00049 * 00050 * Permission is hereby granted, free of charge, to any person obtaining a 00051 * copy of this software and associated documentation files (the 00052 * "Software"), to deal in the Software without restriction, including 00053 * without limitation the rights to use, copy, modify, merge, publish, 00054 * distribute, and/or sell copies of the Software, and to permit persons to 00055 * whom the Software is furnished to do so, provided that the above 00056 * copyright notice(s) and this permission notice appear in all copies of 00057 * the Software and that both the above copyright notice(s) and this 00058 * permission notice appear in supporting documentation. 00059 * 00060 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00061 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00062 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00063 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00064 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00065 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00066 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00067 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00068 * PERFORMANCE OF THIS SOFTWARE. 00069 */