]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ipf/AccessPmr.s
1. Port X64, IPF and EBC arch for BaseLib
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ipf / AccessPmr.s
1 /// @file
2 /// IPF specific Performance Monitor Configuration/Data Registers accessing functions
3 ///
4 /// Copyright (c) 2006, Intel Corporation
5 /// All rights reserved. This program and the accompanying materials
6 /// are licensed and made available under the terms and conditions of the BSD License
7 /// which accompanies this distribution. The full text of the license may be found at
8 /// http://opensource.org/licenses/bsd-license.php
9 ///
10 /// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 /// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 ///
13 /// Module Name: AccessPmr.s
14 ///
15 ///
16
17 //---------------------------------------------------------------------------------
18 //++
19 // AsmReadPmc
20 //
21 // This routine is used to Reads the current value of Performance Monitor Configuration Register (PMC).
22 //
23 // Arguments :
24 //
25 // On Entry : The 8-bit PMC index.
26 //
27 // Return Value: The current value of PMC by Index.
28 //
29 //--
30 //----------------------------------------------------------------------------------
31 .text
32 .type AsmReadPmc, @function
33 .proc AsmReadPmc
34 .regstk 1, 0, 0, 0
35
36 AsmReadPmc::
37 srlz.i;;
38 srlz.d;;
39 mov r8 = pmc[in0];;
40 br.ret.dpnt b0;;
41 .endp AsmReadPmc
42
43 //---------------------------------------------------------------------------------
44 //++
45 // AsmWritePmc
46 //
47 // This routine is used to write the current value to a Performance Monitor Configuration Register (PMC).
48 //
49 // Arguments :
50 //
51 // On Entry : The 8-bit PMC index.
52 // The value should be written to PMC
53 //
54 // Return Value: The value written to PMC.
55 //
56 //--
57 //----------------------------------------------------------------------------------
58 .text
59 .type AsmWritePmc, @function
60 .proc AsmWritePmc
61 .regstk 2, 0, 0, 0
62
63 AsmWritePmc::
64 mov pmc[in0] = in1
65 mov r8 = in1;;
66 srlz.i;;
67 srlz.d;;
68 br.ret.dpnt b0;;
69 .endp AsmWritePmc
70
71
72 //---------------------------------------------------------------------------------
73 //++
74 // AsmReadPmd
75 //
76 // This routine is used to Reads the current value of Performance Monitor Data Register (PMD).
77 //
78 // Arguments :
79 //
80 // On Entry : The 8-bit PMD index.
81 //
82 // Return Value: The current value of PMD by Index.
83 //
84 //--
85 //----------------------------------------------------------------------------------
86 .text
87 .type AsmReadPmd, @function
88 .proc AsmReadPmd
89 .regstk 1, 0, 0, 0
90
91 AsmReadPmd::
92 srlz.i;;
93 srlz.d;;
94 mov r8 = pmd[in0];;
95 br.ret.dpnt b0;;
96 .endp AsmReadPmd
97
98 //---------------------------------------------------------------------------------
99 //++
100 // AsmWritePmd
101 //
102 // This routine is used to write the current value to Performance Monitor Data Register (PMD).
103 //
104 // Arguments :
105 //
106 // On Entry : The 8-bit PMD index.
107 // The value should be written to PMD
108 //
109 // Return Value: The value written to PMD.
110 //
111 //--
112 //----------------------------------------------------------------------------------
113 .text
114 .type AsmWritePmd, @function
115 .proc AsmWritePmd
116 .regstk 2, 0, 0, 0
117
118 AsmWritePmd::
119 mov pmd[in0] = in1
120 mov r8 = in1;;
121 srlz.i;;
122 srlz.d;;
123 br.ret.dpnt b0;;
124 .endp AsmWritePmd