]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ia32/WriteMsr64.c
remove unnecessary comments introduced by tools from MdePkg. The regular express...
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / WriteMsr64.c
CommitLineData
e1f414b6 1/** @file\r
2 AsmWriteMsr64 function\r
3\r
4 Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
1efcc4ae 15\r
f734a10a 16\r
e1f414b6 17\r
42eedea9 18/**\r
19 Writes a 64-bit value to a Machine Specific Register(MSR), and returns the\r
20 value.\r
21\r
22 Writes the 64-bit value specified by Value to the MSR specified by Index. The\r
23 64-bit value written to the MSR is returned. No parameter checking is\r
24 performed on Index or Value, and some of these may cause CPU exceptions. The\r
25 caller must either guarantee that Index and Value are valid, or the caller\r
26 must establish proper exception handlers. This function is only available on\r
27 IA-32 and X64.\r
28\r
29 @param Index The 32-bit MSR index to write.\r
30 @param Value The 64-bit value to write to the MSR.\r
31\r
32 @return Value\r
33\r
34**/\r
e1f414b6 35UINT64\r
36EFIAPI\r
37AsmWriteMsr64 (\r
38 IN UINT32 Index,\r
39 IN UINT64 Value\r
40 )\r
41{\r
42 _asm {\r
43 mov edx, dword ptr [Value + 4]\r
44 mov eax, dword ptr [Value + 0]\r
45 mov ecx, Index\r
46 wrmsr\r
47 }\r
48}\r
49\r