]> git.proxmox.com Git - mirror_edk2.git/blob - OldMdePkg/Library/BaseLib/Ipf/AccessGcr.s
54b3a30a6d16689066423b8a7482d4a875b74ff4
[mirror_edk2.git] / OldMdePkg / Library / BaseLib / Ipf / AccessGcr.s
1 /// @file
2 /// IPF specific Global Control 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: AccessGcr.s
14 ///
15 ///
16
17 //---------------------------------------------------------------------------------
18 //++
19 // AsmReadDcr
20 //
21 // This routine is used to Read the value of Default Control Register (DCR).
22 //
23 // Arguments :
24 //
25 // On Entry :
26 //
27 // Return Value: The current value of DCR.
28 //
29 //--
30 //----------------------------------------------------------------------------------
31 .text
32 .type AsmReadDcr, @function
33 .proc AsmReadDcr
34
35 AsmReadDcr::
36 mov r8 = cr.dcr;;
37 br.ret.dpnt b0;;
38 .endp AsmReadDcr
39
40 //---------------------------------------------------------------------------------
41 //++
42 // AsmWriteDcr
43 //
44 // This routine is used to write the value to Default Control Register (DCR).
45 //
46 // Arguments :
47 //
48 // On Entry : The value need to be written to DCR
49 //
50 // Return Value: The value written to DCR.
51 //
52 //--
53 //----------------------------------------------------------------------------------
54 .text
55 .type AsmWriteDcr, @function
56 .proc AsmWriteDcr
57 .regstk 1, 0, 0, 0
58
59 AsmWriteDcr::
60 mov cr.dcr = in0
61 mov r8 = in0;;
62 srlz.i;;
63 srlz.d;;
64 br.ret.dpnt b0;;
65 .endp AsmWriteDcr
66
67
68 //---------------------------------------------------------------------------------
69 //++
70 // AsmReadItc
71 //
72 // This routine is used to Read the value of Interval Timer Counter Register (ITC).
73 //
74 // Arguments :
75 //
76 // On Entry :
77 //
78 // Return Value: The current value of ITC.
79 //
80 //--
81 //----------------------------------------------------------------------------------
82 .text
83 .type AsmReadItc, @function
84 .proc AsmReadItc
85
86 AsmReadItc::
87 mov r8 = ar.itc;;
88 br.ret.dpnt b0;;
89 .endp AsmReadItc
90
91 //---------------------------------------------------------------------------------
92 //++
93 // AsmWriteItc
94 //
95 // This routine is used to write the value to Interval Timer Counter Register (ITC).
96 //
97 // Arguments :
98 //
99 // On Entry : The value need to be written to the ITC
100 //
101 // Return Value: The value written to the ITC.
102 //
103 //--
104 //----------------------------------------------------------------------------------
105 .text
106 .type AsmWriteItc, @function
107 .proc AsmWriteItc
108 .regstk 1, 0, 0, 0
109
110 AsmWriteItc::
111 mov ar.itc = in0
112 mov r8 = in0;;
113 br.ret.dpnt b0;;
114 .endp AsmWriteItc
115
116
117 //---------------------------------------------------------------------------------
118 //++
119 // AsmReadItm
120 //
121 // This routine is used to Read the value of Interval Timer Match Register (ITM).
122 //
123 // Arguments :
124 //
125 // On Entry :
126 //
127 // Return Value: The current value of ITM.
128 //
129 //--
130 //----------------------------------------------------------------------------------
131 .text
132 .type AsmReadItm, @function
133 .proc AsmReadItm
134
135 AsmReadItm::
136 mov r8 = cr.itm;;
137 br.ret.dpnt b0;;
138 .endp AsmReadItm
139
140 //---------------------------------------------------------------------------------
141 //++
142 // AsmWriteItm
143 //
144 // This routine is used to write the value to Interval Timer Match Register (ITM).
145 //
146 // Arguments :
147 //
148 // On Entry : The value need to be written to ITM
149 //
150 // Return Value: The value written to ITM.
151 //
152 //--
153 //----------------------------------------------------------------------------------
154 .text
155 .type AsmWriteItm, @function
156 .proc AsmWriteItm
157 .regstk 1, 0, 0, 0
158
159 AsmWriteItm::
160 mov cr.itm = in0
161 mov r8 = in0;;
162 srlz.d;
163 br.ret.dpnt b0;;
164 .endp AsmWriteItm
165
166
167 //---------------------------------------------------------------------------------
168 //++
169 // AsmReadIva
170 //
171 // This routine is used to read the value of Interruption Vector Address Register (IVA).
172 //
173 // Arguments :
174 //
175 // On Entry :
176 //
177 // Return Value: The current value of IVA.
178 //
179 //--
180 //----------------------------------------------------------------------------------
181 .text
182 .type AsmReadIva, @function
183 .proc AsmReadIva
184
185 AsmReadIva::
186 mov r8 = cr.iva;;
187 br.ret.dpnt b0;;
188 .endp AsmReadIva
189
190 //---------------------------------------------------------------------------------
191 //++
192 // AsmWriteIva
193 //
194 // This routine is used to write the value to Interruption Vector Address Register (IVA).
195 //
196 // Arguments :
197 //
198 // On Entry : The value need to be written to IVA
199 //
200 // Return Value: The value written to IVA.
201 //
202 //--
203 //----------------------------------------------------------------------------------
204 .text
205 .type AsmWriteIva, @function
206 .proc AsmWriteIva
207 .regstk 1, 0, 0, 0
208
209 AsmWriteIva::
210 mov cr.iva = in0
211 mov r8 = in0;;
212 br.ret.dpnt b0;;
213 .endp AsmWriteIva
214
215
216 //---------------------------------------------------------------------------------
217 //++
218 // AsmReadPta
219 //
220 // This routine is used to read the value of Page Table Address Register (PTA).
221 //
222 // Arguments :
223 //
224 // On Entry :
225 //
226 // Return Value: The current value of PTA.
227 //
228 //--
229 //----------------------------------------------------------------------------------
230 .text
231 .type AsmReadPta, @function
232 .proc AsmReadPta
233
234 AsmReadPta::
235 mov r8 = cr.pta;;
236 br.ret.dpnt b0;;
237 .endp AsmReadPta
238
239 //---------------------------------------------------------------------------------
240 //++
241 // AsmWritePta
242 //
243 // This routine is used to write the value to Page Table Address Register (PTA)).
244 //
245 // Arguments :
246 //
247 // On Entry : The value need to be written to PTA
248 //
249 // Return Value: The value written to PTA.
250 //
251 //--
252 //----------------------------------------------------------------------------------
253 .text
254 .type AsmWritePta, @function
255 .proc AsmWritePta
256 .regstk 1, 0, 0, 0
257
258 AsmWritePta::
259 mov cr.pta = in0
260 mov r8 = in0;;
261 srlz.i;;
262 srlz.d;;
263 br.ret.dpnt b0;;
264 .endp AsmWritePta