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