/** @file\r
AsmWriteMsr64 function\r
\r
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
-\r
-\r
+#include <Library/RegisterFilterLib.h>\r
\r
/**\r
Writes a 64-bit value to a Machine Specific Register(MSR), and returns the\r
IN UINT64 Value\r
)\r
{\r
- _asm {\r
- mov edx, dword ptr [Value + 4]\r
- mov eax, dword ptr [Value + 0]\r
- mov ecx, Index\r
- wrmsr\r
+ BOOLEAN Flag;\r
+\r
+ Flag = FilterBeforeMsrWrite (Index, &Value);\r
+ if (Flag) {\r
+ _asm {\r
+ mov edx, dword ptr [Value + 4]\r
+ mov eax, dword ptr [Value + 0]\r
+ mov ecx, Index\r
+ wrmsr\r
+ }\r
}\r
-}\r
\r
+ FilterAfterMsrWrite (Index, &Value);\r
+\r
+ return Value;\r
+}\r