blob: afbaba52d2f16cb30daf092f5cd3986e7ca9c299 [file] [log] [blame]
David S. Miller6eda3a72008-04-28 00:47:20 -07001 /* %o0: devhandle
2 * %o1: devino
3 *
4 * returns %o0: sysino
5 */
David S. Miller687124d2008-09-01 03:13:17 -07006ENTRY(sun4v_devino_to_sysino)
David S. Miller6eda3a72008-04-28 00:47:20 -07007 mov HV_FAST_INTR_DEVINO2SYSINO, %o5
8 ta HV_FAST_TRAP
9 retl
10 mov %o1, %o0
David S. Miller687124d2008-09-01 03:13:17 -070011ENDPROC(sun4v_devino_to_sysino)
David S. Miller6eda3a72008-04-28 00:47:20 -070012
13 /* %o0: sysino
14 *
15 * returns %o0: intr_enabled (HV_INTR_{DISABLED,ENABLED})
16 */
David S. Miller687124d2008-09-01 03:13:17 -070017ENTRY(sun4v_intr_getenabled)
David S. Miller6eda3a72008-04-28 00:47:20 -070018 mov HV_FAST_INTR_GETENABLED, %o5
19 ta HV_FAST_TRAP
20 retl
21 mov %o1, %o0
David S. Miller687124d2008-09-01 03:13:17 -070022ENDPROC(sun4v_intr_getenabled)
David S. Miller6eda3a72008-04-28 00:47:20 -070023
24 /* %o0: sysino
25 * %o1: intr_enabled (HV_INTR_{DISABLED,ENABLED})
26 */
David S. Miller687124d2008-09-01 03:13:17 -070027ENTRY(sun4v_intr_setenabled)
David S. Miller6eda3a72008-04-28 00:47:20 -070028 mov HV_FAST_INTR_SETENABLED, %o5
29 ta HV_FAST_TRAP
30 retl
31 nop
David S. Miller687124d2008-09-01 03:13:17 -070032ENDPROC(sun4v_intr_setenabled)
David S. Miller6eda3a72008-04-28 00:47:20 -070033
34 /* %o0: sysino
35 *
36 * returns %o0: intr_state (HV_INTR_STATE_*)
37 */
David S. Miller687124d2008-09-01 03:13:17 -070038ENTRY(sun4v_intr_getstate)
David S. Miller6eda3a72008-04-28 00:47:20 -070039 mov HV_FAST_INTR_GETSTATE, %o5
40 ta HV_FAST_TRAP
41 retl
42 mov %o1, %o0
David S. Miller687124d2008-09-01 03:13:17 -070043ENDPROC(sun4v_intr_getstate)
David S. Miller6eda3a72008-04-28 00:47:20 -070044
45 /* %o0: sysino
46 * %o1: intr_state (HV_INTR_STATE_*)
47 */
David S. Miller687124d2008-09-01 03:13:17 -070048ENTRY(sun4v_intr_setstate)
David S. Miller6eda3a72008-04-28 00:47:20 -070049 mov HV_FAST_INTR_SETSTATE, %o5
50 ta HV_FAST_TRAP
51 retl
52 nop
David S. Miller687124d2008-09-01 03:13:17 -070053ENDPROC(sun4v_intr_setstate)
David S. Miller6eda3a72008-04-28 00:47:20 -070054
55 /* %o0: sysino
56 *
57 * returns %o0: cpuid
58 */
David S. Miller687124d2008-09-01 03:13:17 -070059ENTRY(sun4v_intr_gettarget)
David S. Miller6eda3a72008-04-28 00:47:20 -070060 mov HV_FAST_INTR_GETTARGET, %o5
61 ta HV_FAST_TRAP
62 retl
63 mov %o1, %o0
David S. Miller687124d2008-09-01 03:13:17 -070064ENDPROC(sun4v_intr_gettarget)
David S. Miller6eda3a72008-04-28 00:47:20 -070065
66 /* %o0: sysino
67 * %o1: cpuid
68 */
David S. Miller687124d2008-09-01 03:13:17 -070069ENTRY(sun4v_intr_settarget)
David S. Miller6eda3a72008-04-28 00:47:20 -070070 mov HV_FAST_INTR_SETTARGET, %o5
71 ta HV_FAST_TRAP
72 retl
73 nop
David S. Miller687124d2008-09-01 03:13:17 -070074ENDPROC(sun4v_intr_settarget)
David S. Miller6eda3a72008-04-28 00:47:20 -070075
76 /* %o0: cpuid
77 * %o1: pc
78 * %o2: rtba
79 * %o3: arg0
80 *
81 * returns %o0: status
82 */
David S. Miller687124d2008-09-01 03:13:17 -070083ENTRY(sun4v_cpu_start)
David S. Miller6eda3a72008-04-28 00:47:20 -070084 mov HV_FAST_CPU_START, %o5
85 ta HV_FAST_TRAP
86 retl
87 nop
David S. Miller687124d2008-09-01 03:13:17 -070088ENDPROC(sun4v_cpu_start)
David S. Miller6eda3a72008-04-28 00:47:20 -070089
90 /* %o0: cpuid
91 *
92 * returns %o0: status
93 */
David S. Miller687124d2008-09-01 03:13:17 -070094ENTRY(sun4v_cpu_stop)
David S. Miller6eda3a72008-04-28 00:47:20 -070095 mov HV_FAST_CPU_STOP, %o5
96 ta HV_FAST_TRAP
97 retl
98 nop
David S. Miller687124d2008-09-01 03:13:17 -070099ENDPROC(sun4v_cpu_stop)
David S. Miller6eda3a72008-04-28 00:47:20 -0700100
101 /* returns %o0: status */
David S. Miller687124d2008-09-01 03:13:17 -0700102ENTRY(sun4v_cpu_yield)
David S. Miller6eda3a72008-04-28 00:47:20 -0700103 mov HV_FAST_CPU_YIELD, %o5
104 ta HV_FAST_TRAP
105 retl
106 nop
David S. Miller687124d2008-09-01 03:13:17 -0700107ENDPROC(sun4v_cpu_yield)
David S. Miller6eda3a72008-04-28 00:47:20 -0700108
109 /* %o0: type
110 * %o1: queue paddr
111 * %o2: num queue entries
112 *
113 * returns %o0: status
114 */
David S. Miller687124d2008-09-01 03:13:17 -0700115ENTRY(sun4v_cpu_qconf)
David S. Miller6eda3a72008-04-28 00:47:20 -0700116 mov HV_FAST_CPU_QCONF, %o5
117 ta HV_FAST_TRAP
118 retl
119 nop
David S. Miller687124d2008-09-01 03:13:17 -0700120ENDPROC(sun4v_cpu_qconf)
David S. Miller6eda3a72008-04-28 00:47:20 -0700121
122 /* %o0: num cpus in cpu list
123 * %o1: cpu list paddr
124 * %o2: mondo block paddr
125 *
126 * returns %o0: status
127 */
David S. Miller687124d2008-09-01 03:13:17 -0700128ENTRY(sun4v_cpu_mondo_send)
David S. Miller6eda3a72008-04-28 00:47:20 -0700129 mov HV_FAST_CPU_MONDO_SEND, %o5
130 ta HV_FAST_TRAP
131 retl
132 nop
David S. Miller687124d2008-09-01 03:13:17 -0700133ENDPROC(sun4v_cpu_mondo_send)
David S. Miller6eda3a72008-04-28 00:47:20 -0700134
135 /* %o0: CPU ID
136 *
137 * returns %o0: -status if status non-zero, else
138 * %o0: cpu state as HV_CPU_STATE_*
139 */
David S. Miller687124d2008-09-01 03:13:17 -0700140ENTRY(sun4v_cpu_state)
David S. Miller6eda3a72008-04-28 00:47:20 -0700141 mov HV_FAST_CPU_STATE, %o5
142 ta HV_FAST_TRAP
143 brnz,pn %o0, 1f
144 sub %g0, %o0, %o0
145 mov %o1, %o0
1461: retl
147 nop
David S. Miller687124d2008-09-01 03:13:17 -0700148ENDPROC(sun4v_cpu_state)
David S. Miller6eda3a72008-04-28 00:47:20 -0700149
150 /* %o0: virtual address
151 * %o1: must be zero
152 * %o2: TTE
153 * %o3: HV_MMU_* flags
154 *
155 * returns %o0: status
156 */
David S. Miller687124d2008-09-01 03:13:17 -0700157ENTRY(sun4v_mmu_map_perm_addr)
David S. Miller6eda3a72008-04-28 00:47:20 -0700158 mov HV_FAST_MMU_MAP_PERM_ADDR, %o5
159 ta HV_FAST_TRAP
160 retl
161 nop
David S. Miller687124d2008-09-01 03:13:17 -0700162ENDPROC(sun4v_mmu_map_perm_addr)
David S. Miller6eda3a72008-04-28 00:47:20 -0700163
164 /* %o0: number of TSB descriptions
165 * %o1: TSB descriptions real address
166 *
167 * returns %o0: status
168 */
David S. Miller687124d2008-09-01 03:13:17 -0700169ENTRY(sun4v_mmu_tsb_ctx0)
David S. Miller6eda3a72008-04-28 00:47:20 -0700170 mov HV_FAST_MMU_TSB_CTX0, %o5
171 ta HV_FAST_TRAP
172 retl
173 nop
David S. Miller687124d2008-09-01 03:13:17 -0700174ENDPROC(sun4v_mmu_tsb_ctx0)
David S. Miller6eda3a72008-04-28 00:47:20 -0700175
176 /* %o0: API group number
177 * %o1: pointer to unsigned long major number storage
178 * %o2: pointer to unsigned long minor number storage
179 *
180 * returns %o0: status
181 */
David S. Miller687124d2008-09-01 03:13:17 -0700182ENTRY(sun4v_get_version)
David S. Miller6eda3a72008-04-28 00:47:20 -0700183 mov HV_CORE_GET_VER, %o5
184 mov %o1, %o3
185 mov %o2, %o4
186 ta HV_CORE_TRAP
187 stx %o1, [%o3]
188 retl
189 stx %o2, [%o4]
David S. Miller687124d2008-09-01 03:13:17 -0700190ENDPROC(sun4v_get_version)
David S. Miller6eda3a72008-04-28 00:47:20 -0700191
192 /* %o0: API group number
193 * %o1: desired major number
194 * %o2: desired minor number
195 * %o3: pointer to unsigned long actual minor number storage
196 *
197 * returns %o0: status
198 */
David S. Miller687124d2008-09-01 03:13:17 -0700199ENTRY(sun4v_set_version)
David S. Miller6eda3a72008-04-28 00:47:20 -0700200 mov HV_CORE_SET_VER, %o5
201 mov %o3, %o4
202 ta HV_CORE_TRAP
203 retl
204 stx %o1, [%o4]
David S. Miller687124d2008-09-01 03:13:17 -0700205ENDPROC(sun4v_set_version)
David S. Miller6eda3a72008-04-28 00:47:20 -0700206
207 /* %o0: pointer to unsigned long time
208 *
209 * returns %o0: status
210 */
David S. Miller687124d2008-09-01 03:13:17 -0700211ENTRY(sun4v_tod_get)
David S. Miller6eda3a72008-04-28 00:47:20 -0700212 mov %o0, %o4
213 mov HV_FAST_TOD_GET, %o5
214 ta HV_FAST_TRAP
215 stx %o1, [%o4]
216 retl
217 nop
David S. Miller687124d2008-09-01 03:13:17 -0700218ENDPROC(sun4v_tod_get)
David S. Miller6eda3a72008-04-28 00:47:20 -0700219
220 /* %o0: time
221 *
222 * returns %o0: status
223 */
David S. Miller687124d2008-09-01 03:13:17 -0700224ENTRY(sun4v_tod_set)
David S. Miller6eda3a72008-04-28 00:47:20 -0700225 mov HV_FAST_TOD_SET, %o5
226 ta HV_FAST_TRAP
227 retl
228 nop
David S. Miller687124d2008-09-01 03:13:17 -0700229ENDPROC(sun4v_tod_set)
David S. Miller6eda3a72008-04-28 00:47:20 -0700230
231 /* %o0: pointer to unsigned long status
232 *
233 * returns %o0: signed character
234 */
David S. Miller687124d2008-09-01 03:13:17 -0700235ENTRY(sun4v_con_getchar)
David S. Miller6eda3a72008-04-28 00:47:20 -0700236 mov %o0, %o4
237 mov HV_FAST_CONS_GETCHAR, %o5
238 clr %o0
239 clr %o1
240 ta HV_FAST_TRAP
241 stx %o0, [%o4]
242 retl
243 sra %o1, 0, %o0
David S. Miller687124d2008-09-01 03:13:17 -0700244ENDPROC(sun4v_con_getchar)
David S. Miller6eda3a72008-04-28 00:47:20 -0700245
246 /* %o0: signed long character
247 *
248 * returns %o0: status
249 */
David S. Miller687124d2008-09-01 03:13:17 -0700250ENTRY(sun4v_con_putchar)
David S. Miller6eda3a72008-04-28 00:47:20 -0700251 mov HV_FAST_CONS_PUTCHAR, %o5
252 ta HV_FAST_TRAP
253 retl
254 sra %o0, 0, %o0
David S. Miller687124d2008-09-01 03:13:17 -0700255ENDPROC(sun4v_con_putchar)
David S. Miller6eda3a72008-04-28 00:47:20 -0700256
257 /* %o0: buffer real address
258 * %o1: buffer size
259 * %o2: pointer to unsigned long bytes_read
260 *
261 * returns %o0: status
262 */
David S. Miller687124d2008-09-01 03:13:17 -0700263ENTRY(sun4v_con_read)
David S. Miller6eda3a72008-04-28 00:47:20 -0700264 mov %o2, %o4
265 mov HV_FAST_CONS_READ, %o5
266 ta HV_FAST_TRAP
267 brnz %o0, 1f
268 cmp %o1, -1 /* break */
269 be,a,pn %icc, 1f
270 mov %o1, %o0
271 cmp %o1, -2 /* hup */
272 be,a,pn %icc, 1f
273 mov %o1, %o0
274 stx %o1, [%o4]
2751: retl
276 nop
David S. Miller687124d2008-09-01 03:13:17 -0700277ENDPROC(sun4v_con_read)
David S. Miller6eda3a72008-04-28 00:47:20 -0700278
279 /* %o0: buffer real address
280 * %o1: buffer size
281 * %o2: pointer to unsigned long bytes_written
282 *
283 * returns %o0: status
284 */
David S. Miller687124d2008-09-01 03:13:17 -0700285ENTRY(sun4v_con_write)
David S. Miller6eda3a72008-04-28 00:47:20 -0700286 mov %o2, %o4
287 mov HV_FAST_CONS_WRITE, %o5
288 ta HV_FAST_TRAP
289 stx %o1, [%o4]
290 retl
291 nop
David S. Miller687124d2008-09-01 03:13:17 -0700292ENDPROC(sun4v_con_write)
David S. Miller6eda3a72008-04-28 00:47:20 -0700293
294 /* %o0: soft state
295 * %o1: address of description string
296 *
297 * returns %o0: status
298 */
David S. Miller687124d2008-09-01 03:13:17 -0700299ENTRY(sun4v_mach_set_soft_state)
David S. Miller6eda3a72008-04-28 00:47:20 -0700300 mov HV_FAST_MACH_SET_SOFT_STATE, %o5
301 ta HV_FAST_TRAP
302 retl
303 nop
David S. Miller687124d2008-09-01 03:13:17 -0700304ENDPROC(sun4v_mach_set_soft_state)
David S. Miller6eda3a72008-04-28 00:47:20 -0700305
306 /* %o0: exit code
307 *
308 * Does not return.
309 */
David S. Miller687124d2008-09-01 03:13:17 -0700310ENTRY(sun4v_mach_exit)
David S. Miller6eda3a72008-04-28 00:47:20 -0700311 mov HV_FAST_MACH_EXIT, %o5
312 ta HV_FAST_TRAP
313 retl
314 nop
David S. Miller687124d2008-09-01 03:13:17 -0700315ENDPROC(sun4v_mach_exit)
David S. Miller6eda3a72008-04-28 00:47:20 -0700316
317 /* %o0: buffer real address
318 * %o1: buffer length
319 * %o2: pointer to unsigned long real_buf_len
320 *
321 * returns %o0: status
322 */
David S. Miller687124d2008-09-01 03:13:17 -0700323ENTRY(sun4v_mach_desc)
David S. Miller6eda3a72008-04-28 00:47:20 -0700324 mov %o2, %o4
325 mov HV_FAST_MACH_DESC, %o5
326 ta HV_FAST_TRAP
327 stx %o1, [%o4]
328 retl
329 nop
David S. Miller687124d2008-09-01 03:13:17 -0700330ENDPROC(sun4v_mach_desc)
David S. Miller6eda3a72008-04-28 00:47:20 -0700331
332 /* %o0: new timeout in milliseconds
333 * %o1: pointer to unsigned long orig_timeout
334 *
335 * returns %o0: status
336 */
David S. Miller687124d2008-09-01 03:13:17 -0700337ENTRY(sun4v_mach_set_watchdog)
David S. Miller6eda3a72008-04-28 00:47:20 -0700338 mov %o1, %o4
339 mov HV_FAST_MACH_SET_WATCHDOG, %o5
340 ta HV_FAST_TRAP
341 stx %o1, [%o4]
342 retl
343 nop
David S. Miller687124d2008-09-01 03:13:17 -0700344ENDPROC(sun4v_mach_set_watchdog)
David S. Miller6eda3a72008-04-28 00:47:20 -0700345
346 /* No inputs and does not return. */
David S. Miller687124d2008-09-01 03:13:17 -0700347ENTRY(sun4v_mach_sir)
David S. Miller6eda3a72008-04-28 00:47:20 -0700348 mov %o1, %o4
349 mov HV_FAST_MACH_SIR, %o5
350 ta HV_FAST_TRAP
351 stx %o1, [%o4]
352 retl
353 nop
David S. Miller687124d2008-09-01 03:13:17 -0700354ENDPROC(sun4v_mach_sir)
David S. Miller6eda3a72008-04-28 00:47:20 -0700355
356 /* %o0: channel
357 * %o1: ra
358 * %o2: num_entries
359 *
360 * returns %o0: status
361 */
David S. Miller687124d2008-09-01 03:13:17 -0700362ENTRY(sun4v_ldc_tx_qconf)
David S. Miller6eda3a72008-04-28 00:47:20 -0700363 mov HV_FAST_LDC_TX_QCONF, %o5
364 ta HV_FAST_TRAP
365 retl
366 nop
David S. Miller687124d2008-09-01 03:13:17 -0700367ENDPROC(sun4v_ldc_tx_qconf)
David S. Miller6eda3a72008-04-28 00:47:20 -0700368
369 /* %o0: channel
370 * %o1: pointer to unsigned long ra
371 * %o2: pointer to unsigned long num_entries
372 *
373 * returns %o0: status
374 */
David S. Miller687124d2008-09-01 03:13:17 -0700375ENTRY(sun4v_ldc_tx_qinfo)
David S. Miller6eda3a72008-04-28 00:47:20 -0700376 mov %o1, %g1
377 mov %o2, %g2
378 mov HV_FAST_LDC_TX_QINFO, %o5
379 ta HV_FAST_TRAP
380 stx %o1, [%g1]
381 stx %o2, [%g2]
382 retl
383 nop
David S. Miller687124d2008-09-01 03:13:17 -0700384ENDPROC(sun4v_ldc_tx_qinfo)
David S. Miller6eda3a72008-04-28 00:47:20 -0700385
386 /* %o0: channel
387 * %o1: pointer to unsigned long head_off
388 * %o2: pointer to unsigned long tail_off
389 * %o2: pointer to unsigned long chan_state
390 *
391 * returns %o0: status
392 */
David S. Miller687124d2008-09-01 03:13:17 -0700393ENTRY(sun4v_ldc_tx_get_state)
David S. Miller6eda3a72008-04-28 00:47:20 -0700394 mov %o1, %g1
395 mov %o2, %g2
396 mov %o3, %g3
397 mov HV_FAST_LDC_TX_GET_STATE, %o5
398 ta HV_FAST_TRAP
399 stx %o1, [%g1]
400 stx %o2, [%g2]
401 stx %o3, [%g3]
402 retl
403 nop
David S. Miller687124d2008-09-01 03:13:17 -0700404ENDPROC(sun4v_ldc_tx_get_state)
David S. Miller6eda3a72008-04-28 00:47:20 -0700405
406 /* %o0: channel
407 * %o1: tail_off
408 *
409 * returns %o0: status
410 */
David S. Miller687124d2008-09-01 03:13:17 -0700411ENTRY(sun4v_ldc_tx_set_qtail)
David S. Miller6eda3a72008-04-28 00:47:20 -0700412 mov HV_FAST_LDC_TX_SET_QTAIL, %o5
413 ta HV_FAST_TRAP
414 retl
415 nop
David S. Miller687124d2008-09-01 03:13:17 -0700416ENDPROC(sun4v_ldc_tx_set_qtail)
David S. Miller6eda3a72008-04-28 00:47:20 -0700417
418 /* %o0: channel
419 * %o1: ra
420 * %o2: num_entries
421 *
422 * returns %o0: status
423 */
David S. Miller687124d2008-09-01 03:13:17 -0700424ENTRY(sun4v_ldc_rx_qconf)
David S. Miller6eda3a72008-04-28 00:47:20 -0700425 mov HV_FAST_LDC_RX_QCONF, %o5
426 ta HV_FAST_TRAP
427 retl
428 nop
David S. Miller687124d2008-09-01 03:13:17 -0700429ENDPROC(sun4v_ldc_rx_qconf)
David S. Miller6eda3a72008-04-28 00:47:20 -0700430
431 /* %o0: channel
432 * %o1: pointer to unsigned long ra
433 * %o2: pointer to unsigned long num_entries
434 *
435 * returns %o0: status
436 */
David S. Miller687124d2008-09-01 03:13:17 -0700437ENTRY(sun4v_ldc_rx_qinfo)
David S. Miller6eda3a72008-04-28 00:47:20 -0700438 mov %o1, %g1
439 mov %o2, %g2
440 mov HV_FAST_LDC_RX_QINFO, %o5
441 ta HV_FAST_TRAP
442 stx %o1, [%g1]
443 stx %o2, [%g2]
444 retl
445 nop
David S. Miller687124d2008-09-01 03:13:17 -0700446ENDPROC(sun4v_ldc_rx_qinfo)
David S. Miller6eda3a72008-04-28 00:47:20 -0700447
448 /* %o0: channel
449 * %o1: pointer to unsigned long head_off
450 * %o2: pointer to unsigned long tail_off
451 * %o2: pointer to unsigned long chan_state
452 *
453 * returns %o0: status
454 */
David S. Miller687124d2008-09-01 03:13:17 -0700455ENTRY(sun4v_ldc_rx_get_state)
David S. Miller6eda3a72008-04-28 00:47:20 -0700456 mov %o1, %g1
457 mov %o2, %g2
458 mov %o3, %g3
459 mov HV_FAST_LDC_RX_GET_STATE, %o5
460 ta HV_FAST_TRAP
461 stx %o1, [%g1]
462 stx %o2, [%g2]
463 stx %o3, [%g3]
464 retl
465 nop
David S. Miller687124d2008-09-01 03:13:17 -0700466ENDPROC(sun4v_ldc_rx_get_state)
David S. Miller6eda3a72008-04-28 00:47:20 -0700467
468 /* %o0: channel
469 * %o1: head_off
470 *
471 * returns %o0: status
472 */
David S. Miller687124d2008-09-01 03:13:17 -0700473ENTRY(sun4v_ldc_rx_set_qhead)
David S. Miller6eda3a72008-04-28 00:47:20 -0700474 mov HV_FAST_LDC_RX_SET_QHEAD, %o5
475 ta HV_FAST_TRAP
476 retl
477 nop
David S. Miller687124d2008-09-01 03:13:17 -0700478ENDPROC(sun4v_ldc_rx_set_qhead)
David S. Miller6eda3a72008-04-28 00:47:20 -0700479
480 /* %o0: channel
481 * %o1: ra
482 * %o2: num_entries
483 *
484 * returns %o0: status
485 */
David S. Miller687124d2008-09-01 03:13:17 -0700486ENTRY(sun4v_ldc_set_map_table)
David S. Miller6eda3a72008-04-28 00:47:20 -0700487 mov HV_FAST_LDC_SET_MAP_TABLE, %o5
488 ta HV_FAST_TRAP
489 retl
490 nop
David S. Miller687124d2008-09-01 03:13:17 -0700491ENDPROC(sun4v_ldc_set_map_table)
David S. Miller6eda3a72008-04-28 00:47:20 -0700492
493 /* %o0: channel
494 * %o1: pointer to unsigned long ra
495 * %o2: pointer to unsigned long num_entries
496 *
497 * returns %o0: status
498 */
David S. Miller687124d2008-09-01 03:13:17 -0700499ENTRY(sun4v_ldc_get_map_table)
David S. Miller6eda3a72008-04-28 00:47:20 -0700500 mov %o1, %g1
501 mov %o2, %g2
502 mov HV_FAST_LDC_GET_MAP_TABLE, %o5
503 ta HV_FAST_TRAP
504 stx %o1, [%g1]
505 stx %o2, [%g2]
506 retl
507 nop
David S. Miller687124d2008-09-01 03:13:17 -0700508ENDPROC(sun4v_ldc_get_map_table)
David S. Miller6eda3a72008-04-28 00:47:20 -0700509
510 /* %o0: channel
511 * %o1: dir_code
512 * %o2: tgt_raddr
513 * %o3: lcl_raddr
514 * %o4: len
515 * %o5: pointer to unsigned long actual_len
516 *
517 * returns %o0: status
518 */
David S. Miller687124d2008-09-01 03:13:17 -0700519ENTRY(sun4v_ldc_copy)
David S. Miller6eda3a72008-04-28 00:47:20 -0700520 mov %o5, %g1
521 mov HV_FAST_LDC_COPY, %o5
522 ta HV_FAST_TRAP
523 stx %o1, [%g1]
524 retl
525 nop
David S. Miller687124d2008-09-01 03:13:17 -0700526ENDPROC(sun4v_ldc_copy)
David S. Miller6eda3a72008-04-28 00:47:20 -0700527
528 /* %o0: channel
529 * %o1: cookie
530 * %o2: pointer to unsigned long ra
531 * %o3: pointer to unsigned long perm
532 *
533 * returns %o0: status
534 */
David S. Miller687124d2008-09-01 03:13:17 -0700535ENTRY(sun4v_ldc_mapin)
David S. Miller6eda3a72008-04-28 00:47:20 -0700536 mov %o2, %g1
537 mov %o3, %g2
538 mov HV_FAST_LDC_MAPIN, %o5
539 ta HV_FAST_TRAP
540 stx %o1, [%g1]
541 stx %o2, [%g2]
542 retl
543 nop
David S. Miller687124d2008-09-01 03:13:17 -0700544ENDPROC(sun4v_ldc_mapin)
David S. Miller6eda3a72008-04-28 00:47:20 -0700545
546 /* %o0: ra
547 *
548 * returns %o0: status
549 */
David S. Miller687124d2008-09-01 03:13:17 -0700550ENTRY(sun4v_ldc_unmap)
David S. Miller6eda3a72008-04-28 00:47:20 -0700551 mov HV_FAST_LDC_UNMAP, %o5
552 ta HV_FAST_TRAP
553 retl
554 nop
David S. Miller687124d2008-09-01 03:13:17 -0700555ENDPROC(sun4v_ldc_unmap)
David S. Miller6eda3a72008-04-28 00:47:20 -0700556
557 /* %o0: channel
558 * %o1: cookie
559 * %o2: mte_cookie
560 *
561 * returns %o0: status
562 */
David S. Miller687124d2008-09-01 03:13:17 -0700563ENTRY(sun4v_ldc_revoke)
David S. Miller6eda3a72008-04-28 00:47:20 -0700564 mov HV_FAST_LDC_REVOKE, %o5
565 ta HV_FAST_TRAP
566 retl
567 nop
David S. Miller687124d2008-09-01 03:13:17 -0700568ENDPROC(sun4v_ldc_revoke)
David S. Miller6eda3a72008-04-28 00:47:20 -0700569
570 /* %o0: device handle
571 * %o1: device INO
572 * %o2: pointer to unsigned long cookie
573 *
574 * returns %o0: status
575 */
David S. Miller687124d2008-09-01 03:13:17 -0700576ENTRY(sun4v_vintr_get_cookie)
David S. Miller6eda3a72008-04-28 00:47:20 -0700577 mov %o2, %g1
578 mov HV_FAST_VINTR_GET_COOKIE, %o5
579 ta HV_FAST_TRAP
580 stx %o1, [%g1]
581 retl
582 nop
David S. Miller687124d2008-09-01 03:13:17 -0700583ENDPROC(sun4v_vintr_get_cookie)
David S. Miller6eda3a72008-04-28 00:47:20 -0700584
585 /* %o0: device handle
586 * %o1: device INO
587 * %o2: cookie
588 *
589 * returns %o0: status
590 */
David S. Miller687124d2008-09-01 03:13:17 -0700591ENTRY(sun4v_vintr_set_cookie)
David S. Miller6eda3a72008-04-28 00:47:20 -0700592 mov HV_FAST_VINTR_SET_COOKIE, %o5
593 ta HV_FAST_TRAP
594 retl
595 nop
David S. Miller687124d2008-09-01 03:13:17 -0700596ENDPROC(sun4v_vintr_set_cookie)
David S. Miller6eda3a72008-04-28 00:47:20 -0700597
598 /* %o0: device handle
599 * %o1: device INO
600 * %o2: pointer to unsigned long valid_state
601 *
602 * returns %o0: status
603 */
David S. Miller687124d2008-09-01 03:13:17 -0700604ENTRY(sun4v_vintr_get_valid)
David S. Miller6eda3a72008-04-28 00:47:20 -0700605 mov %o2, %g1
606 mov HV_FAST_VINTR_GET_VALID, %o5
607 ta HV_FAST_TRAP
608 stx %o1, [%g1]
609 retl
610 nop
David S. Miller687124d2008-09-01 03:13:17 -0700611ENDPROC(sun4v_vintr_get_valid)
David S. Miller6eda3a72008-04-28 00:47:20 -0700612
613 /* %o0: device handle
614 * %o1: device INO
615 * %o2: valid_state
616 *
617 * returns %o0: status
618 */
David S. Miller687124d2008-09-01 03:13:17 -0700619ENTRY(sun4v_vintr_set_valid)
David S. Miller6eda3a72008-04-28 00:47:20 -0700620 mov HV_FAST_VINTR_SET_VALID, %o5
621 ta HV_FAST_TRAP
622 retl
623 nop
David S. Miller687124d2008-09-01 03:13:17 -0700624ENDPROC(sun4v_vintr_set_valid)
David S. Miller6eda3a72008-04-28 00:47:20 -0700625
626 /* %o0: device handle
627 * %o1: device INO
628 * %o2: pointer to unsigned long state
629 *
630 * returns %o0: status
631 */
David S. Miller687124d2008-09-01 03:13:17 -0700632ENTRY(sun4v_vintr_get_state)
David S. Miller6eda3a72008-04-28 00:47:20 -0700633 mov %o2, %g1
634 mov HV_FAST_VINTR_GET_STATE, %o5
635 ta HV_FAST_TRAP
636 stx %o1, [%g1]
637 retl
638 nop
David S. Miller687124d2008-09-01 03:13:17 -0700639ENDPROC(sun4v_vintr_get_state)
David S. Miller6eda3a72008-04-28 00:47:20 -0700640
641 /* %o0: device handle
642 * %o1: device INO
643 * %o2: state
644 *
645 * returns %o0: status
646 */
David S. Miller687124d2008-09-01 03:13:17 -0700647ENTRY(sun4v_vintr_set_state)
David S. Miller6eda3a72008-04-28 00:47:20 -0700648 mov HV_FAST_VINTR_SET_STATE, %o5
649 ta HV_FAST_TRAP
650 retl
651 nop
David S. Miller687124d2008-09-01 03:13:17 -0700652ENDPROC(sun4v_vintr_set_state)
David S. Miller6eda3a72008-04-28 00:47:20 -0700653
654 /* %o0: device handle
655 * %o1: device INO
656 * %o2: pointer to unsigned long cpuid
657 *
658 * returns %o0: status
659 */
David S. Miller687124d2008-09-01 03:13:17 -0700660ENTRY(sun4v_vintr_get_target)
David S. Miller6eda3a72008-04-28 00:47:20 -0700661 mov %o2, %g1
662 mov HV_FAST_VINTR_GET_TARGET, %o5
663 ta HV_FAST_TRAP
664 stx %o1, [%g1]
665 retl
666 nop
David S. Miller687124d2008-09-01 03:13:17 -0700667ENDPROC(sun4v_vintr_get_target)
David S. Miller6eda3a72008-04-28 00:47:20 -0700668
669 /* %o0: device handle
670 * %o1: device INO
671 * %o2: cpuid
672 *
673 * returns %o0: status
674 */
David S. Miller687124d2008-09-01 03:13:17 -0700675ENTRY(sun4v_vintr_set_target)
David S. Miller6eda3a72008-04-28 00:47:20 -0700676 mov HV_FAST_VINTR_SET_TARGET, %o5
677 ta HV_FAST_TRAP
678 retl
679 nop
David S. Miller687124d2008-09-01 03:13:17 -0700680ENDPROC(sun4v_vintr_set_target)
David S. Miller6eda3a72008-04-28 00:47:20 -0700681
682 /* %o0: NCS sub-function
683 * %o1: sub-function arg real-address
684 * %o2: sub-function arg size
685 *
686 * returns %o0: status
687 */
David S. Miller687124d2008-09-01 03:13:17 -0700688ENTRY(sun4v_ncs_request)
David S. Miller6eda3a72008-04-28 00:47:20 -0700689 mov HV_FAST_NCS_REQUEST, %o5
690 ta HV_FAST_TRAP
691 retl
692 nop
David S. Miller687124d2008-09-01 03:13:17 -0700693ENDPROC(sun4v_ncs_request)
David S. Miller6eda3a72008-04-28 00:47:20 -0700694
David S. Miller687124d2008-09-01 03:13:17 -0700695ENTRY(sun4v_svc_send)
David S. Miller6eda3a72008-04-28 00:47:20 -0700696 save %sp, -192, %sp
697 mov %i0, %o0
698 mov %i1, %o1
699 mov %i2, %o2
700 mov HV_FAST_SVC_SEND, %o5
701 ta HV_FAST_TRAP
702 stx %o1, [%i3]
703 ret
704 restore
David S. Miller687124d2008-09-01 03:13:17 -0700705ENDPROC(sun4v_svc_send)
David S. Miller6eda3a72008-04-28 00:47:20 -0700706
David S. Miller687124d2008-09-01 03:13:17 -0700707ENTRY(sun4v_svc_recv)
David S. Miller6eda3a72008-04-28 00:47:20 -0700708 save %sp, -192, %sp
709 mov %i0, %o0
710 mov %i1, %o1
711 mov %i2, %o2
712 mov HV_FAST_SVC_RECV, %o5
713 ta HV_FAST_TRAP
714 stx %o1, [%i3]
715 ret
716 restore
David S. Miller687124d2008-09-01 03:13:17 -0700717ENDPROC(sun4v_svc_recv)
David S. Miller6eda3a72008-04-28 00:47:20 -0700718
David S. Miller687124d2008-09-01 03:13:17 -0700719ENTRY(sun4v_svc_getstatus)
David S. Miller6eda3a72008-04-28 00:47:20 -0700720 mov HV_FAST_SVC_GETSTATUS, %o5
721 mov %o1, %o4
722 ta HV_FAST_TRAP
723 stx %o1, [%o4]
724 retl
725 nop
David S. Miller687124d2008-09-01 03:13:17 -0700726ENDPROC(sun4v_svc_getstatus)
David S. Miller6eda3a72008-04-28 00:47:20 -0700727
David S. Miller687124d2008-09-01 03:13:17 -0700728ENTRY(sun4v_svc_setstatus)
David S. Miller6eda3a72008-04-28 00:47:20 -0700729 mov HV_FAST_SVC_SETSTATUS, %o5
730 ta HV_FAST_TRAP
731 retl
732 nop
David S. Miller687124d2008-09-01 03:13:17 -0700733ENDPROC(sun4v_svc_setstatus)
David S. Miller6eda3a72008-04-28 00:47:20 -0700734
David S. Miller687124d2008-09-01 03:13:17 -0700735ENTRY(sun4v_svc_clrstatus)
David S. Miller6eda3a72008-04-28 00:47:20 -0700736 mov HV_FAST_SVC_CLRSTATUS, %o5
737 ta HV_FAST_TRAP
738 retl
739 nop
David S. Miller687124d2008-09-01 03:13:17 -0700740ENDPROC(sun4v_svc_clrstatus)
David S. Miller6eda3a72008-04-28 00:47:20 -0700741
David S. Miller687124d2008-09-01 03:13:17 -0700742ENTRY(sun4v_mmustat_conf)
David S. Miller6eda3a72008-04-28 00:47:20 -0700743 mov %o1, %o4
744 mov HV_FAST_MMUSTAT_CONF, %o5
745 ta HV_FAST_TRAP
746 stx %o1, [%o4]
747 retl
748 nop
David S. Miller687124d2008-09-01 03:13:17 -0700749ENDPROC(sun4v_mmustat_conf)
David S. Miller6eda3a72008-04-28 00:47:20 -0700750
David S. Miller687124d2008-09-01 03:13:17 -0700751ENTRY(sun4v_mmustat_info)
David S. Miller6eda3a72008-04-28 00:47:20 -0700752 mov %o0, %o4
753 mov HV_FAST_MMUSTAT_INFO, %o5
754 ta HV_FAST_TRAP
755 stx %o1, [%o4]
756 retl
757 nop
David S. Miller687124d2008-09-01 03:13:17 -0700758ENDPROC(sun4v_mmustat_info)
David S. Miller6eda3a72008-04-28 00:47:20 -0700759
David S. Miller687124d2008-09-01 03:13:17 -0700760ENTRY(sun4v_mmu_demap_all)
David S. Miller6eda3a72008-04-28 00:47:20 -0700761 clr %o0
762 clr %o1
763 mov HV_MMU_ALL, %o2
764 mov HV_FAST_MMU_DEMAP_ALL, %o5
765 ta HV_FAST_TRAP
766 retl
767 nop
David S. Miller687124d2008-09-01 03:13:17 -0700768ENDPROC(sun4v_mmu_demap_all)
David S. Miller3178a072008-11-28 02:26:55 -0800769
770ENTRY(sun4v_niagara_getperf)
771 mov %o0, %o4
772 mov HV_FAST_GET_PERFREG, %o5
773 ta HV_FAST_TRAP
774 stx %o1, [%o4]
775 retl
776 nop
777ENDPROC(sun4v_niagara_getperf)
778
779ENTRY(sun4v_niagara_setperf)
780 mov HV_FAST_SET_PERFREG, %o5
781 ta HV_FAST_TRAP
782 retl
783 nop
784ENDPROC(sun4v_niagara_setperf)
785
786ENTRY(sun4v_niagara2_getperf)
787 mov %o0, %o4
788 mov HV_FAST_N2_GET_PERFREG, %o5
789 ta HV_FAST_TRAP
790 stx %o1, [%o4]
791 retl
792 nop
793ENDPROC(sun4v_niagara2_getperf)
794
795ENTRY(sun4v_niagara2_setperf)
796 mov HV_FAST_N2_SET_PERFREG, %o5
797 ta HV_FAST_TRAP
798 retl
799 nop
800ENDPROC(sun4v_niagara2_setperf)
David S. Millerea5e7442011-08-01 23:27:17 -0700801
802ENTRY(sun4v_reboot_data_set)
803 mov HV_FAST_REBOOT_DATA_SET, %o5
804 ta HV_FAST_TRAP
805 retl
806 nop
807ENDPROC(sun4v_reboot_data_set)
David S. Miller8c79bfa2012-08-16 20:35:41 -0700808
809ENTRY(sun4v_vt_get_perfreg)
810 mov %o1, %o4
811 mov HV_FAST_VT_GET_PERFREG, %o5
812 ta HV_FAST_TRAP
813 stx %o1, [%o4]
814 retl
815 nop
816ENDPROC(sun4v_vt_get_perfreg)
817
818ENTRY(sun4v_vt_set_perfreg)
819 mov HV_FAST_VT_SET_PERFREG, %o5
820 ta HV_FAST_TRAP
821 retl
822 nop
823ENDPROC(sun4v_vt_set_perfreg)
bob picco05aa1652014-09-16 10:09:06 -0400824
825ENTRY(sun4v_t5_get_perfreg)
826 mov %o1, %o4
827 mov HV_FAST_T5_GET_PERFREG, %o5
828 ta HV_FAST_TRAP
829 stx %o1, [%o4]
830 retl
831 nop
832ENDPROC(sun4v_t5_get_perfreg)
833
834ENTRY(sun4v_t5_set_perfreg)
835 mov HV_FAST_T5_SET_PERFREG, %o5
836 ta HV_FAST_TRAP
837 retl
838 nop
839ENDPROC(sun4v_t5_set_perfreg)
David Ahernb5aff552015-03-19 16:06:37 -0400840
841ENTRY(sun4v_m7_get_perfreg)
842 mov %o1, %o4
843 mov HV_FAST_M7_GET_PERFREG, %o5
844 ta HV_FAST_TRAP
845 stx %o1, [%o4]
846 retl
847 nop
848ENDPROC(sun4v_m7_get_perfreg)
849
850ENTRY(sun4v_m7_set_perfreg)
851 mov HV_FAST_M7_SET_PERFREG, %o5
852 ta HV_FAST_TRAP
853 retl
854 nop
855ENDPROC(sun4v_m7_set_perfreg)