1/// @file
2///  IPF specific AsmReadKrX() and AsmWriteKrX() functions, 'X' is from '0' to '6'
3///
4/// Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
5/// 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: AccessKr.s
14///
15///
16
17//---------------------------------------------------------------------------------
18//++
19// AsmReadKr0
20//
21// This routine is used to get KR0.
22//
23// Arguments :
24//
25// On Entry :  None.
26//
27// Return Value: The value store in KR0.
28//
29//--
30//----------------------------------------------------------------------------------
31.text
32.type   AsmReadKr0, @function
33.proc   AsmReadKr0
34
35AsmReadKr0::
36        mov             r8 = ar.k0;;
37        br.ret.dpnt     b0;;
38.endp   AsmReadKr0
39
40//---------------------------------------------------------------------------------
41//++
42// AsmWriteKr0
43//
44// This routine is used to Write KR0.
45//
46// Arguments :
47//
48// On Entry :  None.
49//
50// Return Value: The value written to the KR0.
51//
52//--
53//----------------------------------------------------------------------------------
54
55.text
56.type   AsmWriteKr0, @function
57.proc   AsmWriteKr0
58.regstk 1, 3, 0, 0
59
60AsmWriteKr0::
61        alloc loc1=ar.pfs,1,4,0,0 ;;
62        mov             loc2 = psr;;
63        rsm             0x6000;;                      // Masking interrupts
64        mov             ar.k0 = in0
65        srlz.i;;
66        mov             psr.l = loc2;;
67        srlz.i;;
68        srlz.d;;
69        mov             r8 = in0;;
70        mov ar.pfs=loc1 ;;
71        br.ret.dpnt     b0;;
72.endp   AsmWriteKr0
73
74
75//---------------------------------------------------------------------------------
76//++
77// AsmReadKr1
78//
79// This routine is used to get KR1.
80//
81// Arguments :
82//
83// On Entry :  None.
84//
85// Return Value: The value store in KR1.
86//
87//--
88//----------------------------------------------------------------------------------
89.text
90.type   AsmReadKr1, @function
91.proc   AsmReadKr1
92
93AsmReadKr1::
94        mov             r8 = ar.k1;;
95        br.ret.dpnt     b0;;
96.endp   AsmReadKr1
97
98//---------------------------------------------------------------------------------
99//++
100// AsmWriteKr1
101//
102// This routine is used to Write KR1.
103//
104// Arguments :
105//
106// On Entry :  None.
107//
108// Return Value: The value written to the KR1.
109//
110//--
111//----------------------------------------------------------------------------------
112.text
113.type   AsmWriteKr1, @function
114.proc   AsmWriteKr1
115
116AsmWriteKr1::
117        mov             ar.k1 = in0
118        mov             r8 = in0;;
119        br.ret.dpnt     b0;;
120.endp   AsmWriteKr1
121
122
123//---------------------------------------------------------------------------------
124//++
125// AsmReadKr2
126//
127// This routine is used to get KR2.
128//
129// Arguments :
130//
131// On Entry :  None.
132//
133// Return Value: The value store in KR2.
134//
135//--
136//----------------------------------------------------------------------------------
137.text
138.type   AsmReadKr2, @function
139.proc   AsmReadKr2
140
141AsmReadKr2::
142        mov             r8 = ar.k2;;
143        br.ret.dpnt     b0;;
144.endp   AsmReadKr2
145
146//---------------------------------------------------------------------------------
147//++
148// AsmWriteKr2
149//
150// This routine is used to Write KR2.
151//
152// Arguments :
153//
154// On Entry :  None.
155//
156// Return Value: The value written to the KR2.
157//
158//--
159//----------------------------------------------------------------------------------
160.text
161.type   AsmWriteKr2, @function
162.proc   AsmWriteKr2
163
164AsmWriteKr2::
165        mov             ar.k2 = in0
166        mov             r8 = in0;;
167        br.ret.dpnt     b0;;
168.endp   AsmWriteKr2
169
170
171//---------------------------------------------------------------------------------
172//++
173// AsmReadKr3
174//
175// This routine is used to get KR3.
176//
177// Arguments :
178//
179// On Entry :  None.
180//
181// Return Value: The value store in KR3.
182//
183//--
184//----------------------------------------------------------------------------------
185.text
186.type   AsmReadKr3, @function
187.proc   AsmReadKr3
188
189AsmReadKr3::
190        mov             r8 = ar.k3;;
191        br.ret.dpnt     b0;;
192.endp   AsmReadKr3
193
194//---------------------------------------------------------------------------------
195//++
196// AsmWriteKr3
197//
198// This routine is used to Write KR3.
199//
200// Arguments :
201//
202// On Entry :  None.
203//
204// Return Value: The value written to the KR3.
205//
206//--
207//----------------------------------------------------------------------------------
208.text
209.type   AsmWriteKr3, @function
210.proc   AsmWriteKr3
211
212AsmWriteKr3::
213        mov             ar.k3 = in0
214        mov             r8 = in0;;
215        br.ret.dpnt     b0;;
216.endp   AsmWriteKr3
217
218
219//---------------------------------------------------------------------------------
220//++
221// AsmReadKr4
222//
223// This routine is used to get KR4.
224//
225// Arguments :
226//
227// On Entry :  None.
228//
229// Return Value: The value store in KR4.
230//
231//--
232//----------------------------------------------------------------------------------
233.text
234.type   AsmReadKr4, @function
235.proc   AsmReadKr4
236
237AsmReadKr4::
238        mov             r8 = ar.k4;;
239        br.ret.dpnt     b0;;
240.endp   AsmReadKr4
241
242//---------------------------------------------------------------------------------
243//++
244// AsmWriteKr4
245//
246// This routine is used to Write KR4.
247//
248// Arguments :
249//
250// On Entry :  None.
251//
252// Return Value: The value written to the KR4.
253//
254//--
255//----------------------------------------------------------------------------------
256.text
257.type   AsmWriteKr4, @function
258.proc   AsmWriteKr4
259
260AsmWriteKr4::
261        mov             ar.k4 = in0
262        mov             r8 = in0;;
263        br.ret.dpnt     b0;;
264.endp   AsmWriteKr4
265
266
267//---------------------------------------------------------------------------------
268//++
269// AsmReadKr5
270//
271// This routine is used to get KR5.
272//
273// Arguments :
274//
275// On Entry :  None.
276//
277// Return Value: The value store in KR5.
278//
279//--
280//----------------------------------------------------------------------------------
281.text
282.type   AsmReadKr5, @function
283.proc   AsmReadKr5
284
285AsmReadKr5::
286        mov             r8 = ar.k5;;
287        br.ret.dpnt     b0;;
288.endp   AsmReadKr5
289
290//---------------------------------------------------------------------------------
291//++
292// AsmWriteKr5
293//
294// This routine is used to Write KR5.
295//
296// Arguments :
297//
298// On Entry :  None.
299//
300// Return Value: The value written to the KR5.
301//
302//--
303//----------------------------------------------------------------------------------
304.text
305.type   AsmWriteKr5, @function
306.proc   AsmWriteKr5
307
308AsmWriteKr5::
309        mov             ar.k5 = in0
310        mov             r8 = in0;;
311        br.ret.dpnt     b0;;
312.endp   AsmWriteKr5
313
314
315//---------------------------------------------------------------------------------
316//++
317// AsmReadKr6
318//
319// This routine is used to get KR6.
320//
321// Arguments :
322//
323// On Entry :  None.
324//
325// Return Value: The value store in KR6.
326//
327//--
328//----------------------------------------------------------------------------------
329.text
330.type   AsmReadKr6, @function
331.proc   AsmReadKr6
332
333AsmReadKr6::
334        mov             r8 = ar.k6;;
335        br.ret.dpnt     b0;;
336.endp   AsmReadKr6
337
338//---------------------------------------------------------------------------------
339//++
340// AsmWriteKr6
341//
342// This routine is used to write KR6.
343//
344// Arguments :
345//
346// On Entry :  None.
347//
348// Return Value: The value written to the KR6.
349//
350//--
351//----------------------------------------------------------------------------------
352.text
353.type   AsmWriteKr6, @function
354.proc   AsmWriteKr6
355
356AsmWriteKr6::
357        mov             ar.k6 = in0
358        mov             r8 = in0;;
359        br.ret.dpnt     b0;;
360.endp   AsmWriteKr6
361