]>
Commit | Line | Data |
---|---|---|
f1baef62 | 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 | |
35 | AsmReadDcr::\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 | |
59 | AsmWriteDcr::\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 | |
86 | AsmReadItc::\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 | |
110 | AsmWriteItc::\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 | |
135 | AsmReadItm::\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 | |
159 | AsmWriteItm::\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 | |
185 | AsmReadIva::\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 | |
700e6ffd | 207 | .regstk 1, 3, 0, 0\r |
e82e1acc | 208 | \r |
700e6ffd | 209 | alloc loc1=ar.pfs,1,4,0,0 ;;\r |
e82e1acc | 210 | \r |
211 | mov loc2 = psr\r | |
212 | rsm 0x6000 // Make sure interrupts are masked\r | |
f1baef62 | 213 | \r |
214 | AsmWriteIva::\r | |
700e6ffd | 215 | mov cr.iva = in0\r |
e82e1acc | 216 | srlz.i;;\r |
217 | mov psr.l = loc2;;\r | |
218 | srlz.i;;\r | |
219 | srlz.d;;\r | |
700e6ffd | 220 | mov ar.pfs=loc1 ;;\r |
221 | mov r8 = in0;;\r | |
222 | br.ret.dpnt b0;;\r | |
223 | .endp AsmWriteIva\r | |
f1baef62 | 224 | \r |
225 | \r | |
226 | //---------------------------------------------------------------------------------\r | |
227 | //++\r | |
228 | // AsmReadPta\r | |
229 | //\r | |
230 | // This routine is used to read the value of Page Table Address Register (PTA).\r | |
231 | //\r | |
232 | // Arguments :\r | |
233 | //\r | |
234 | // On Entry :\r | |
235 | //\r | |
236 | // Return Value: The current value of PTA.\r | |
237 | //\r | |
238 | //--\r | |
239 | //----------------------------------------------------------------------------------\r | |
240 | .text\r | |
241 | .type AsmReadPta, @function\r | |
242 | .proc AsmReadPta\r | |
243 | \r | |
244 | AsmReadPta::\r | |
245 | mov r8 = cr.pta;;\r | |
246 | br.ret.dpnt b0;;\r | |
247 | .endp AsmReadPta\r | |
248 | \r | |
249 | //---------------------------------------------------------------------------------\r | |
250 | //++\r | |
251 | // AsmWritePta\r | |
252 | //\r | |
253 | // This routine is used to write the value to Page Table Address Register (PTA)).\r | |
254 | //\r | |
255 | // Arguments :\r | |
256 | //\r | |
257 | // On Entry : The value need to be written to PTA\r | |
258 | //\r | |
259 | // Return Value: The value written to PTA.\r | |
260 | //\r | |
261 | //--\r | |
262 | //----------------------------------------------------------------------------------\r | |
263 | .text\r | |
264 | .type AsmWritePta, @function\r | |
265 | .proc AsmWritePta\r | |
266 | .regstk 1, 0, 0, 0\r | |
267 | \r | |
268 | AsmWritePta::\r | |
269 | mov cr.pta = in0\r | |
270 | mov r8 = in0;;\r | |
271 | srlz.i;;\r | |
272 | srlz.d;;\r | |
273 | br.ret.dpnt b0;;\r | |
274 | .endp AsmWritePta |