Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: mon_hw_assem.s | |
5 | * Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved | |
6 | * 4150 Network Circle, Santa Clara, California 95054, U.S.A. | |
7 | * | |
8 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
9 | * | |
10 | * This program is free software; you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License as published by | |
12 | * the Free Software Foundation; version 2 of the License. | |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, | |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | * GNU General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with this program; if not, write to the Free Software | |
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
22 | * | |
23 | * For the avoidance of doubt, and except that if any non-GPL license | |
24 | * choice is available it will apply instead, Sun elects to use only | |
25 | * the General Public License version 2 (GPLv2) at this time for any | |
26 | * software where a choice of GPL license versions is made | |
27 | * available with the language indicating that GPLv2 or any later version | |
28 | * may be used, or where a choice of which version of the GPL is applied is | |
29 | * otherwise unspecified. | |
30 | * | |
31 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
32 | * CA 95054 USA or visit www.sun.com if you need additional information or | |
33 | * have any questions. | |
34 | * | |
35 | * | |
36 | * ========== Copyright Header End ============================================ | |
37 | */ | |
38 | #ident "@(#) mon_hw_assem.s 1.11 05/06/28 20:56:27" | |
39 | #ifdef ISS_VERSION | |
40 | #define _ASM | |
41 | #endif | |
42 | ||
43 | #include <sys/asm_linkage.h> | |
44 | #include <sys/stack.h> | |
45 | #include <v9/sys/privregs.h> | |
46 | ||
47 | ||
48 | ||
49 | ENTRY( caller ) | |
50 | retl | |
51 | mov %i7, %o0 | |
52 | SET_SIZE(caller) | |
53 | ||
54 | ENTRY( callee ) | |
55 | retl | |
56 | mov %o7, %o0 | |
57 | SET_SIZE(callee) | |
58 | ||
59 | ENTRY(getfp) | |
60 | retl | |
61 | mov %fp, %o0 | |
62 | SET_SIZE(getfp) | |
63 | ||
64 | ENTRY(getsp) | |
65 | retl | |
66 | mov %sp, %o0 | |
67 | SET_SIZE(getsp) | |
68 | ||
69 | ENTRY(getpc) | |
70 | retl | |
71 | mov %o7, %o0 | |
72 | SET_SIZE(getpc) | |
73 | ||
74 | ENTRY(geti6) | |
75 | retl | |
76 | mov %i6, %o0 | |
77 | SET_SIZE(geti6) | |
78 | ||
79 | ENTRY(geto6) | |
80 | retl | |
81 | mov %o6, %o0 | |
82 | SET_SIZE(geto6) | |
83 | ||
84 | ENTRY(geti7) | |
85 | retl | |
86 | mov %i7, %o0 | |
87 | SET_SIZE(geti7) | |
88 | ||
89 | ENTRY(geto7) | |
90 | retl | |
91 | mov %o7, %o0 | |
92 | SET_SIZE(geto7) | |
93 | ||
94 | ENTRY(getpstate) | |
95 | retl | |
96 | rdpr %pstate, %o0 | |
97 | SET_SIZE(getpstate) | |
98 | ||
99 | ENTRY(getcwp) | |
100 | rdpr %cwp, %o0 | |
101 | nop | |
102 | retl | |
103 | nop | |
104 | SET_SIZE(getcwp) | |
105 | ||
106 | ENTRY(getcansave) | |
107 | rdpr %cansave, %o0 | |
108 | nop | |
109 | retl | |
110 | nop | |
111 | SET_SIZE(getcansave) | |
112 | ||
113 | ENTRY(getcanrestore) | |
114 | rdpr %canrestore, %o0 | |
115 | nop | |
116 | retl | |
117 | nop | |
118 | SET_SIZE(getcanrestore) | |
119 | ||
120 | ENTRY(getotherwin) | |
121 | rdpr %otherwin, %o0 | |
122 | nop | |
123 | retl | |
124 | nop | |
125 | SET_SIZE(getotherwin) | |
126 | ||
127 | ENTRY(getcleanwin) | |
128 | rdpr %cleanwin, %o0 | |
129 | nop | |
130 | retl | |
131 | nop | |
132 | SET_SIZE(getcleanwin) | |
133 | /* | |
134 | ENTRY(membar_sync) | |
135 | membar #Sync | |
136 | retl | |
137 | nop | |
138 | SET_SIZE(membar_sync) | |
139 | */ | |
140 | ENTRY(flushwindows) | |
141 | save %sp, -MINFRAME, %sp | |
142 | flushw | |
143 | ret | |
144 | restore | |
145 | SET_SIZE(flushwindows) | |
146 | ||
147 | ENTRY(gettba) | |
148 | rdpr %tba, %o0 | |
149 | retl | |
150 | nop | |
151 | SET_SIZE(gettba) | |
152 | ||
153 | ENTRY(settba) | |
154 | wrpr %o0, %tba | |
155 | retl | |
156 | nop | |
157 | SET_SIZE(settba) | |
158 | ||
159 | ENTRY(gettl) | |
160 | rdpr %tl, %o0 | |
161 | retl | |
162 | nop | |
163 | SET_SIZE(gettl) | |
164 | ||
165 | ENTRY(disable_interrupts) | |
166 | rdpr %pstate, %o0 | |
167 | andn %o0, PSTATE_IE | PSTATE_AM, %o0 | |
168 | wrpr %o0, %pstate | |
169 | retl | |
170 | nop | |
171 | SET_SIZE(disable_interrupts) | |
172 | ||
173 | ENTRY(flushi) | |
174 | iflush %i6 | |
175 | nop | |
176 | nop | |
177 | retl | |
178 | nop | |
179 | SET_SIZE(flushi) | |
180 | ||
181 | /* | |
182 | * ensure fp is on in pstate and fprs | |
183 | */ | |
184 | ||
185 | ENTRY(getfsr) | |
186 | rdpr %pstate, %o5 | |
187 | or %o5, PSTATE_PEF, %o1 | |
188 | wrpr %o1, %pstate | |
189 | ||
190 | rd %fprs, %o4 | |
191 | or %o4, FPRS_FEF, %o1 | |
192 | wr %g0,%o1, %fprs | |
193 | ||
194 | stx %fsr, [ %sp + STACK_BIAS - 32] | |
195 | ||
196 | ! Restore %fprs | |
197 | ||
198 | wr %g0,%o4, %fprs | |
199 | ||
200 | ! restore pstate | |
201 | ||
202 | wrpr %o5, %pstate | |
203 | retl | |
204 | ldx [%sp + STACK_BIAS - 32], %o0 | |
205 | SET_SIZE(getfsr) | |
206 | ||
207 | ENTRY(getfprs) | |
208 | retl | |
209 | rd %fprs, %o0 | |
210 | SET_SIZE(getfprs) | |
211 | ||
212 | ||
213 | ENTRY(gettick) | |
214 | retl | |
215 | rd %tick, %o0 | |
216 | SET_SIZE(gettick) | |
217 | ||
218 | ENTRY(getsys_tick) | |
219 | retl | |
220 | #if defined(BW_CPU) || defined(N2_CPU) | |
221 | mov %g0, %o0 | |
222 | ! rdasr %stick_reg, %o0 | |
223 | #else | |
224 | rd %sys_tick, %o0 | |
225 | #endif | |
226 | SET_SIZE(getsys_tick) | |
227 | ||
228 | ||
229 | ||
230 | ||
231 | ||
232 | ||
233 | ||
234 | /* end of assem.s */ | |
235 | ||
236 | ||
237 | ||
238 | ||
239 |