]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ipf/AccessMsr.s
Update the copyright notice format
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ipf / AccessMsr.s
CommitLineData
59e0bb0c 1/// @file\r
2/// IPF specific Machine Specific Registers accessing functions.\r
3///\r
bb817c56
HT
4/// Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>\r
5/// This program and the accompanying materials\r
59e0bb0c 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
15\r
16\r
17//---------------------------------------------------------------------------------\r
18//++\r
19// AsmReadMsr\r
20//\r
21// Reads the current value of a Machine Specific Register (MSR).\r
22//\r
23// Reads and returns the current value of the Machine Specific Register specified by Index. No\r
24// parameter checking is performed on Index, and if the Index value is beyond the implemented MSR\r
25// register range, a Reserved Register/Field fault may occur. The caller must either guarantee that\r
26// Index is valid, or the caller must set up fault handlers to catch the faults. This function is\r
27// only available on IPF.\r
28//\r
29// Arguments :\r
30//\r
31// On Entry : The 8-bit Machine Specific Register index to read.\r
32//\r
33// Return Value: The current value of the Machine Specific Register specified by Index.\r
34//\r
35//--\r
36//----------------------------------------------------------------------------------\r
37.text\r
38.type AsmReadMsr, @function\r
39.proc AsmReadMsr\r
40.regstk 1, 0, 0, 0\r
41\r
42AsmReadMsr::\r
43 mov r8=msr[in0];;\r
44 br.ret.sptk b0;;\r
45.endp AsmReadMsr\r
46\r
47//---------------------------------------------------------------------------------\r
48//++\r
49// AsmWriteMsr\r
50//\r
51// Writes the current value of a Machine Specific Register (MSR).\r
52//\r
53// Writes Value to the Machine Specific Register specified by Index. Value is returned. No\r
54// parameter checking is performed on Index, and if the Index value is beyond the implemented MSR\r
55// register range, a Reserved Register/Field fault may occur. The caller must either guarantee that\r
56// Index is valid, or the caller must set up fault handlers to catch the faults. This function is\r
57// only available on IPF.\r
58//\r
59// Arguments :\r
60//\r
61// On Entry : The 8-bit Machine Specific Register index to write.\r
62// The 64-bit value to write to the Machine Specific Register.\r
63//\r
64// Return Value: The 64-bit value to write to the Machine Specific Register.\r
65//\r
66//--\r
67//----------------------------------------------------------------------------------\r
68.text\r
69.type AsmWriteMsr, @function\r
70.proc AsmWriteMsr\r
71.regstk 2, 0, 0, 0\r
72\r
73AsmWriteMsr::\r
74 mov msr[in0] = in1\r
75 mov r8 = in1;;\r
76 srlz.d;;\r
77 br.ret.sptk b0;;\r
78.endp AsmWriteMsr\r
79\r