Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[linux-2.6] / arch / sparc64 / kernel / hvcalls.S
1         /* %o0: devhandle
2          * %o1: devino
3          *
4          * returns %o0: sysino
5          */
6         .globl  sun4v_devino_to_sysino
7         .type   sun4v_devino_to_sysino,#function
8 sun4v_devino_to_sysino:
9         mov     HV_FAST_INTR_DEVINO2SYSINO, %o5
10         ta      HV_FAST_TRAP
11         retl
12          mov    %o1, %o0
13         .size   sun4v_devino_to_sysino, .-sun4v_devino_to_sysino
14
15         /* %o0: sysino
16          *
17          * returns %o0: intr_enabled (HV_INTR_{DISABLED,ENABLED})
18          */
19         .globl  sun4v_intr_getenabled
20         .type   sun4v_intr_getenabled,#function
21 sun4v_intr_getenabled:
22         mov     HV_FAST_INTR_GETENABLED, %o5
23         ta      HV_FAST_TRAP
24         retl
25          mov    %o1, %o0
26         .size   sun4v_intr_getenabled, .-sun4v_intr_getenabled
27
28         /* %o0: sysino
29          * %o1: intr_enabled (HV_INTR_{DISABLED,ENABLED})
30          */
31         .globl  sun4v_intr_setenabled
32         .type   sun4v_intr_setenabled,#function
33 sun4v_intr_setenabled:
34         mov     HV_FAST_INTR_SETENABLED, %o5
35         ta      HV_FAST_TRAP
36         retl
37          nop
38         .size   sun4v_intr_setenabled, .-sun4v_intr_setenabled
39
40         /* %o0: sysino
41          *
42          * returns %o0: intr_state (HV_INTR_STATE_*)
43          */
44         .globl  sun4v_intr_getstate
45         .type   sun4v_intr_getstate,#function
46 sun4v_intr_getstate:
47         mov     HV_FAST_INTR_GETSTATE, %o5
48         ta      HV_FAST_TRAP
49         retl
50          mov    %o1, %o0
51         .size   sun4v_intr_getstate, .-sun4v_intr_getstate
52
53         /* %o0: sysino
54          * %o1: intr_state (HV_INTR_STATE_*)
55          */
56         .globl  sun4v_intr_setstate
57         .type   sun4v_intr_setstate,#function
58 sun4v_intr_setstate:
59         mov     HV_FAST_INTR_SETSTATE, %o5
60         ta      HV_FAST_TRAP
61         retl
62          nop
63         .size   sun4v_intr_setstate, .-sun4v_intr_setstate
64
65         /* %o0: sysino
66          *
67          * returns %o0: cpuid
68          */
69         .globl  sun4v_intr_gettarget
70         .type   sun4v_intr_gettarget,#function
71 sun4v_intr_gettarget:
72         mov     HV_FAST_INTR_GETTARGET, %o5
73         ta      HV_FAST_TRAP
74         retl
75          mov    %o1, %o0
76         .size   sun4v_intr_gettarget, .-sun4v_intr_gettarget
77
78         /* %o0: sysino
79          * %o1: cpuid
80          */
81         .globl  sun4v_intr_settarget
82         .type   sun4v_intr_settarget,#function
83 sun4v_intr_settarget:
84         mov     HV_FAST_INTR_SETTARGET, %o5
85         ta      HV_FAST_TRAP
86         retl
87          nop
88         .size   sun4v_intr_settarget, .-sun4v_intr_settarget
89
90         /* %o0: cpuid
91          * %o1: pc
92          * %o2: rtba
93          * %o3: arg0
94          *
95          * returns %o0: status
96          */
97         .globl  sun4v_cpu_start
98         .type   sun4v_cpu_start,#function
99 sun4v_cpu_start:
100         mov     HV_FAST_CPU_START, %o5
101         ta      HV_FAST_TRAP
102         retl
103          nop
104         .size   sun4v_cpu_start, .-sun4v_cpu_start
105
106         /* %o0: cpuid
107          *
108          * returns %o0: status
109          */
110         .globl  sun4v_cpu_stop
111         .type   sun4v_cpu_stop,#function
112 sun4v_cpu_stop:
113         mov     HV_FAST_CPU_STOP, %o5
114         ta      HV_FAST_TRAP
115         retl
116          nop
117         .size   sun4v_cpu_stop, .-sun4v_cpu_stop
118
119         /* returns %o0: status  */
120         .globl  sun4v_cpu_yield
121         .type   sun4v_cpu_yield, #function
122 sun4v_cpu_yield:
123         mov     HV_FAST_CPU_YIELD, %o5
124         ta      HV_FAST_TRAP
125         retl
126          nop
127         .size   sun4v_cpu_yield, .-sun4v_cpu_yield
128
129         /* %o0: type
130          * %o1: queue paddr
131          * %o2: num queue entries
132          *
133          * returns %o0: status
134          */
135         .globl  sun4v_cpu_qconf
136         .type   sun4v_cpu_qconf,#function
137 sun4v_cpu_qconf:
138         mov     HV_FAST_CPU_QCONF, %o5
139         ta      HV_FAST_TRAP
140         retl
141          nop
142         .size   sun4v_cpu_qconf, .-sun4v_cpu_qconf
143
144         /* %o0: num cpus in cpu list
145          * %o1: cpu list paddr
146          * %o2: mondo block paddr
147          *
148          * returns %o0: status
149          */
150         .globl  sun4v_cpu_mondo_send
151         .type   sun4v_cpu_mondo_send,#function
152 sun4v_cpu_mondo_send:
153         mov     HV_FAST_CPU_MONDO_SEND, %o5
154         ta      HV_FAST_TRAP
155         retl
156          nop
157         .size   sun4v_cpu_mondo_send, .-sun4v_cpu_mondo_send
158
159         /* %o0: CPU ID
160          *
161          * returns %o0: -status if status non-zero, else
162          *         %o0: cpu state as HV_CPU_STATE_*
163          */
164         .globl  sun4v_cpu_state
165         .type   sun4v_cpu_state,#function
166 sun4v_cpu_state:
167         mov     HV_FAST_CPU_STATE, %o5
168         ta      HV_FAST_TRAP
169         brnz,pn %o0, 1f
170          sub    %g0, %o0, %o0
171         mov     %o1, %o0
172 1:      retl
173          nop
174         .size   sun4v_cpu_state, .-sun4v_cpu_state
175
176         /* %o0: virtual address
177          * %o1: must be zero
178          * %o2: TTE
179          * %o3: HV_MMU_* flags
180          *
181          * returns %o0: status
182          */
183         .globl  sun4v_mmu_map_perm_addr
184         .type   sun4v_mmu_map_perm_addr,#function
185 sun4v_mmu_map_perm_addr:
186         mov     HV_FAST_MMU_MAP_PERM_ADDR, %o5
187         ta      HV_FAST_TRAP
188         retl
189          nop
190         .size   sun4v_mmu_map_perm_addr, .-sun4v_mmu_map_perm_addr
191
192         /* %o0: number of TSB descriptions
193          * %o1: TSB descriptions real address
194          *
195          * returns %o0: status
196          */
197         .globl  sun4v_mmu_tsb_ctx0
198         .type   sun4v_mmu_tsb_ctx0,#function
199 sun4v_mmu_tsb_ctx0:
200         mov     HV_FAST_MMU_TSB_CTX0, %o5
201         ta      HV_FAST_TRAP
202         retl
203          nop
204         .size   sun4v_mmu_tsb_ctx0, .-sun4v_mmu_tsb_ctx0
205
206         /* %o0: API group number
207          * %o1: pointer to unsigned long major number storage
208          * %o2: pointer to unsigned long minor number storage
209          *
210          * returns %o0: status
211          */
212         .globl  sun4v_get_version
213         .type   sun4v_get_version,#function
214 sun4v_get_version:
215         mov     HV_CORE_GET_VER, %o5
216         mov     %o1, %o3
217         mov     %o2, %o4
218         ta      HV_CORE_TRAP
219         stx     %o1, [%o3]
220         retl
221          stx    %o2, [%o4]
222         .size   sun4v_get_version, .-sun4v_get_version
223
224         /* %o0: API group number
225          * %o1: desired major number
226          * %o2: desired minor number
227          * %o3: pointer to unsigned long actual minor number storage
228          *
229          * returns %o0: status
230          */
231         .globl  sun4v_set_version
232         .type   sun4v_set_version,#function
233 sun4v_set_version:
234         mov     HV_CORE_SET_VER, %o5
235         mov     %o3, %o4
236         ta      HV_CORE_TRAP
237         retl
238          stx    %o1, [%o4]
239         .size   sun4v_set_version, .-sun4v_set_version
240
241         /* %o0: pointer to unsigned long time
242          *
243          * returns %o0: status
244          */
245         .globl  sun4v_tod_get
246         .type   sun4v_tod_get,#function
247 sun4v_tod_get:
248         mov     %o0, %o4
249         mov     HV_FAST_TOD_GET, %o5
250         ta      HV_FAST_TRAP
251         stx     %o1, [%o4]
252         retl
253          nop
254         .size   sun4v_tod_get, .-sun4v_tod_get
255
256         /* %o0: time
257          *
258          * returns %o0: status
259          */
260         .globl  sun4v_tod_set
261         .type   sun4v_tod_set,#function
262 sun4v_tod_set:
263         mov     HV_FAST_TOD_SET, %o5
264         ta      HV_FAST_TRAP
265         retl
266          nop
267         .size   sun4v_tod_set, .-sun4v_tod_set
268
269         /* %o0: pointer to unsigned long status
270          *
271          * returns %o0: signed character
272          */
273         .globl  sun4v_con_getchar
274         .type   sun4v_con_getchar,#function
275 sun4v_con_getchar:
276         mov     %o0, %o4
277         mov     HV_FAST_CONS_GETCHAR, %o5
278         clr     %o0
279         clr     %o1
280         ta      HV_FAST_TRAP
281         stx     %o0, [%o4]
282         retl
283          sra    %o1, 0, %o0
284         .size   sun4v_con_getchar, .-sun4v_con_getchar
285
286         /* %o0: signed long character
287          *
288          * returns %o0: status
289          */
290         .globl  sun4v_con_putchar
291         .type   sun4v_con_putchar,#function
292 sun4v_con_putchar:
293         mov     HV_FAST_CONS_PUTCHAR, %o5
294         ta      HV_FAST_TRAP
295         retl
296          sra    %o0, 0, %o0
297         .size   sun4v_con_putchar, .-sun4v_con_putchar
298
299         /* %o0: buffer real address
300          * %o1: buffer size
301          * %o2: pointer to unsigned long bytes_read
302          *
303          * returns %o0: status
304          */
305         .globl  sun4v_con_read
306         .type   sun4v_con_read,#function
307 sun4v_con_read:
308         mov     %o2, %o4
309         mov     HV_FAST_CONS_READ, %o5
310         ta      HV_FAST_TRAP
311         brnz    %o0, 1f
312          cmp    %o1, -1         /* break */
313         be,a,pn %icc, 1f
314          mov    %o1, %o0
315         cmp     %o1, -2         /* hup */
316         be,a,pn %icc, 1f
317          mov    %o1, %o0
318         stx     %o1, [%o4]
319 1:      retl
320          nop
321         .size   sun4v_con_read, .-sun4v_con_read
322
323         /* %o0: buffer real address
324          * %o1: buffer size
325          * %o2: pointer to unsigned long bytes_written
326          *
327          * returns %o0: status
328          */
329         .globl  sun4v_con_write
330         .type   sun4v_con_write,#function
331 sun4v_con_write:
332         mov     %o2, %o4
333         mov     HV_FAST_CONS_WRITE, %o5
334         ta      HV_FAST_TRAP
335         stx     %o1, [%o4]
336         retl
337          nop
338         .size   sun4v_con_write, .-sun4v_con_write
339
340         /* %o0: soft state
341          * %o1: address of description string
342          *
343          * returns %o0: status
344          */
345         .globl  sun4v_mach_set_soft_state
346         .type   sun4v_mach_set_soft_state,#function
347 sun4v_mach_set_soft_state:
348         mov     HV_FAST_MACH_SET_SOFT_STATE, %o5
349         ta      HV_FAST_TRAP
350         retl
351          nop
352         .size   sun4v_mach_set_soft_state, .-sun4v_mach_set_soft_state
353
354         /* %o0: exit code
355          *
356          * Does not return.
357          */
358         .globl  sun4v_mach_exit
359         .type   sun4v_mach_exit,#function
360 sun4v_mach_exit:
361         mov     HV_FAST_MACH_EXIT, %o5
362         ta      HV_FAST_TRAP
363         retl
364          nop
365         .size   sun4v_mach_exit, .-sun4v_mach_exit
366
367         /* %o0: buffer real address
368          * %o1: buffer length
369          * %o2: pointer to unsigned long real_buf_len
370          *
371          * returns %o0: status
372          */
373         .globl  sun4v_mach_desc
374         .type   sun4v_mach_desc,#function
375 sun4v_mach_desc:
376         mov     %o2, %o4
377         mov     HV_FAST_MACH_DESC, %o5
378         ta      HV_FAST_TRAP
379         stx     %o1, [%o4]
380         retl
381          nop
382         .size   sun4v_mach_desc, .-sun4v_mach_desc
383
384         /* %o0: new timeout in milliseconds
385          * %o1: pointer to unsigned long orig_timeout
386          *
387          * returns %o0: status
388          */
389         .globl  sun4v_mach_set_watchdog
390         .type   sun4v_mach_set_watchdog,#function
391 sun4v_mach_set_watchdog:
392         mov     %o1, %o4
393         mov     HV_FAST_MACH_SET_WATCHDOG, %o5
394         ta      HV_FAST_TRAP
395         stx     %o1, [%o4]
396         retl
397          nop
398         .size   sun4v_mach_set_watchdog, .-sun4v_mach_set_watchdog
399
400         /* No inputs and does not return.  */
401         .globl  sun4v_mach_sir
402         .type   sun4v_mach_sir,#function
403 sun4v_mach_sir:
404         mov     %o1, %o4
405         mov     HV_FAST_MACH_SIR, %o5
406         ta      HV_FAST_TRAP
407         stx     %o1, [%o4]
408         retl
409          nop
410         .size   sun4v_mach_sir, .-sun4v_mach_sir
411
412         /* %o0: channel
413          * %o1: ra
414          * %o2: num_entries
415          *
416          * returns %o0: status
417          */
418         .globl  sun4v_ldc_tx_qconf
419         .type   sun4v_ldc_tx_qconf,#function
420 sun4v_ldc_tx_qconf:
421         mov     HV_FAST_LDC_TX_QCONF, %o5
422         ta      HV_FAST_TRAP
423         retl
424          nop
425         .size   sun4v_ldc_tx_qconf, .-sun4v_ldc_tx_qconf
426
427         /* %o0: channel
428          * %o1: pointer to unsigned long ra
429          * %o2: pointer to unsigned long num_entries
430          *
431          * returns %o0: status
432          */
433         .globl  sun4v_ldc_tx_qinfo
434         .type   sun4v_ldc_tx_qinfo,#function
435 sun4v_ldc_tx_qinfo:
436         mov     %o1, %g1
437         mov     %o2, %g2
438         mov     HV_FAST_LDC_TX_QINFO, %o5
439         ta      HV_FAST_TRAP
440         stx     %o1, [%g1]
441         stx     %o2, [%g2]
442         retl
443          nop
444         .size   sun4v_ldc_tx_qinfo, .-sun4v_ldc_tx_qinfo
445
446         /* %o0: channel
447          * %o1: pointer to unsigned long head_off
448          * %o2: pointer to unsigned long tail_off
449          * %o2: pointer to unsigned long chan_state
450          *
451          * returns %o0: status
452          */
453         .globl  sun4v_ldc_tx_get_state
454         .type   sun4v_ldc_tx_get_state,#function
455 sun4v_ldc_tx_get_state:
456         mov     %o1, %g1
457         mov     %o2, %g2
458         mov     %o3, %g3
459         mov     HV_FAST_LDC_TX_GET_STATE, %o5
460         ta      HV_FAST_TRAP
461         stx     %o1, [%g1]
462         stx     %o2, [%g2]
463         stx     %o3, [%g3]
464         retl
465          nop
466         .size   sun4v_ldc_tx_get_state, .-sun4v_ldc_tx_get_state
467
468         /* %o0: channel
469          * %o1: tail_off
470          *
471          * returns %o0: status
472          */
473         .globl  sun4v_ldc_tx_set_qtail
474         .type   sun4v_ldc_tx_set_qtail,#function
475 sun4v_ldc_tx_set_qtail:
476         mov     HV_FAST_LDC_TX_SET_QTAIL, %o5
477         ta      HV_FAST_TRAP
478         retl
479          nop
480         .size   sun4v_ldc_tx_set_qtail, .-sun4v_ldc_tx_set_qtail
481
482         /* %o0: channel
483          * %o1: ra
484          * %o2: num_entries
485          *
486          * returns %o0: status
487          */
488         .globl  sun4v_ldc_rx_qconf
489         .type   sun4v_ldc_rx_qconf,#function
490 sun4v_ldc_rx_qconf:
491         mov     HV_FAST_LDC_RX_QCONF, %o5
492         ta      HV_FAST_TRAP
493         retl
494          nop
495         .size   sun4v_ldc_rx_qconf, .-sun4v_ldc_rx_qconf
496
497         /* %o0: channel
498          * %o1: pointer to unsigned long ra
499          * %o2: pointer to unsigned long num_entries
500          *
501          * returns %o0: status
502          */
503         .globl  sun4v_ldc_rx_qinfo
504         .type   sun4v_ldc_rx_qinfo,#function
505 sun4v_ldc_rx_qinfo:
506         mov     %o1, %g1
507         mov     %o2, %g2
508         mov     HV_FAST_LDC_RX_QINFO, %o5
509         ta      HV_FAST_TRAP
510         stx     %o1, [%g1]
511         stx     %o2, [%g2]
512         retl
513          nop
514         .size   sun4v_ldc_rx_qinfo, .-sun4v_ldc_rx_qinfo
515
516         /* %o0: channel
517          * %o1: pointer to unsigned long head_off
518          * %o2: pointer to unsigned long tail_off
519          * %o2: pointer to unsigned long chan_state
520          *
521          * returns %o0: status
522          */
523         .globl  sun4v_ldc_rx_get_state
524         .type   sun4v_ldc_rx_get_state,#function
525 sun4v_ldc_rx_get_state:
526         mov     %o1, %g1
527         mov     %o2, %g2
528         mov     %o3, %g3
529         mov     HV_FAST_LDC_RX_GET_STATE, %o5
530         ta      HV_FAST_TRAP
531         stx     %o1, [%g1]
532         stx     %o2, [%g2]
533         stx     %o3, [%g3]
534         retl
535          nop
536         .size   sun4v_ldc_rx_get_state, .-sun4v_ldc_rx_get_state
537
538         /* %o0: channel
539          * %o1: head_off
540          *
541          * returns %o0: status
542          */
543         .globl  sun4v_ldc_rx_set_qhead
544         .type   sun4v_ldc_rx_set_qhead,#function
545 sun4v_ldc_rx_set_qhead:
546         mov     HV_FAST_LDC_RX_SET_QHEAD, %o5
547         ta      HV_FAST_TRAP
548         retl
549          nop
550         .size   sun4v_ldc_rx_set_qhead, .-sun4v_ldc_rx_set_qhead
551
552         /* %o0: channel
553          * %o1: ra
554          * %o2: num_entries
555          *
556          * returns %o0: status
557          */
558         .globl  sun4v_ldc_set_map_table
559         .type   sun4v_ldc_set_map_table,#function
560 sun4v_ldc_set_map_table:
561         mov     HV_FAST_LDC_SET_MAP_TABLE, %o5
562         ta      HV_FAST_TRAP
563         retl
564          nop
565         .size   sun4v_ldc_set_map_table, .-sun4v_ldc_set_map_table
566
567         /* %o0: channel
568          * %o1: pointer to unsigned long ra
569          * %o2: pointer to unsigned long num_entries
570          *
571          * returns %o0: status
572          */
573         .globl  sun4v_ldc_get_map_table
574         .type   sun4v_ldc_get_map_table,#function
575 sun4v_ldc_get_map_table:
576         mov     %o1, %g1
577         mov     %o2, %g2
578         mov     HV_FAST_LDC_GET_MAP_TABLE, %o5
579         ta      HV_FAST_TRAP
580         stx     %o1, [%g1]
581         stx     %o2, [%g2]
582         retl
583          nop
584         .size   sun4v_ldc_get_map_table, .-sun4v_ldc_get_map_table
585
586         /* %o0: channel
587          * %o1: dir_code
588          * %o2: tgt_raddr
589          * %o3: lcl_raddr
590          * %o4: len
591          * %o5: pointer to unsigned long actual_len
592          *
593          * returns %o0: status
594          */
595         .globl  sun4v_ldc_copy
596         .type   sun4v_ldc_copy,#function
597 sun4v_ldc_copy:
598         mov     %o5, %g1
599         mov     HV_FAST_LDC_COPY, %o5
600         ta      HV_FAST_TRAP
601         stx     %o1, [%g1]
602         retl
603          nop
604         .size   sun4v_ldc_copy, .-sun4v_ldc_copy
605
606         /* %o0: channel
607          * %o1: cookie
608          * %o2: pointer to unsigned long ra
609          * %o3: pointer to unsigned long perm
610          *
611          * returns %o0: status
612          */
613         .globl  sun4v_ldc_mapin
614         .type   sun4v_ldc_mapin,#function
615 sun4v_ldc_mapin:
616         mov     %o2, %g1
617         mov     %o3, %g2
618         mov     HV_FAST_LDC_MAPIN, %o5
619         ta      HV_FAST_TRAP
620         stx     %o1, [%g1]
621         stx     %o2, [%g2]
622         retl
623          nop
624         .size   sun4v_ldc_mapin, .-sun4v_ldc_mapin
625
626         /* %o0: ra
627          *
628          * returns %o0: status
629          */
630         .globl  sun4v_ldc_unmap
631         .type   sun4v_ldc_unmap,#function
632 sun4v_ldc_unmap:
633         mov     HV_FAST_LDC_UNMAP, %o5
634         ta      HV_FAST_TRAP
635         retl
636          nop
637         .size   sun4v_ldc_unmap, .-sun4v_ldc_unmap
638
639         /* %o0: channel
640          * %o1: cookie
641          * %o2: mte_cookie
642          *
643          * returns %o0: status
644          */
645         .globl  sun4v_ldc_revoke
646         .type   sun4v_ldc_revoke,#function
647 sun4v_ldc_revoke:
648         mov     HV_FAST_LDC_REVOKE, %o5
649         ta      HV_FAST_TRAP
650         retl
651          nop
652         .size   sun4v_ldc_revoke, .-sun4v_ldc_revoke
653
654         /* %o0: device handle
655          * %o1: device INO
656          * %o2: pointer to unsigned long cookie
657          *
658          * returns %o0: status
659          */
660         .globl  sun4v_vintr_get_cookie
661         .type   sun4v_vintr_get_cookie,#function
662 sun4v_vintr_get_cookie:
663         mov     %o2, %g1
664         mov     HV_FAST_VINTR_GET_COOKIE, %o5
665         ta      HV_FAST_TRAP
666         stx     %o1, [%g1]
667         retl
668          nop
669         .size   sun4v_vintr_get_cookie, .-sun4v_vintr_get_cookie
670
671         /* %o0: device handle
672          * %o1: device INO
673          * %o2: cookie
674          *
675          * returns %o0: status
676          */
677         .globl  sun4v_vintr_set_cookie
678         .type   sun4v_vintr_set_cookie,#function
679 sun4v_vintr_set_cookie:
680         mov     HV_FAST_VINTR_SET_COOKIE, %o5
681         ta      HV_FAST_TRAP
682         retl
683          nop
684         .size   sun4v_vintr_set_cookie, .-sun4v_vintr_set_cookie
685
686         /* %o0: device handle
687          * %o1: device INO
688          * %o2: pointer to unsigned long valid_state
689          *
690          * returns %o0: status
691          */
692         .globl  sun4v_vintr_get_valid
693         .type   sun4v_vintr_get_valid,#function
694 sun4v_vintr_get_valid:
695         mov     %o2, %g1
696         mov     HV_FAST_VINTR_GET_VALID, %o5
697         ta      HV_FAST_TRAP
698         stx     %o1, [%g1]
699         retl
700          nop
701         .size   sun4v_vintr_get_valid, .-sun4v_vintr_get_valid
702
703         /* %o0: device handle
704          * %o1: device INO
705          * %o2: valid_state
706          *
707          * returns %o0: status
708          */
709         .globl  sun4v_vintr_set_valid
710         .type   sun4v_vintr_set_valid,#function
711 sun4v_vintr_set_valid:
712         mov     HV_FAST_VINTR_SET_VALID, %o5
713         ta      HV_FAST_TRAP
714         retl
715          nop
716         .size   sun4v_vintr_set_valid, .-sun4v_vintr_set_valid
717
718         /* %o0: device handle
719          * %o1: device INO
720          * %o2: pointer to unsigned long state
721          *
722          * returns %o0: status
723          */
724         .globl  sun4v_vintr_get_state
725         .type   sun4v_vintr_get_state,#function
726 sun4v_vintr_get_state:
727         mov     %o2, %g1
728         mov     HV_FAST_VINTR_GET_STATE, %o5
729         ta      HV_FAST_TRAP
730         stx     %o1, [%g1]
731         retl
732          nop
733         .size   sun4v_vintr_get_state, .-sun4v_vintr_get_state
734
735         /* %o0: device handle
736          * %o1: device INO
737          * %o2: state
738          *
739          * returns %o0: status
740          */
741         .globl  sun4v_vintr_set_state
742         .type   sun4v_vintr_set_state,#function
743 sun4v_vintr_set_state:
744         mov     HV_FAST_VINTR_SET_STATE, %o5
745         ta      HV_FAST_TRAP
746         retl
747          nop
748         .size   sun4v_vintr_set_state, .-sun4v_vintr_set_state
749
750         /* %o0: device handle
751          * %o1: device INO
752          * %o2: pointer to unsigned long cpuid
753          *
754          * returns %o0: status
755          */
756         .globl  sun4v_vintr_get_target
757         .type   sun4v_vintr_get_target,#function
758 sun4v_vintr_get_target:
759         mov     %o2, %g1
760         mov     HV_FAST_VINTR_GET_TARGET, %o5
761         ta      HV_FAST_TRAP
762         stx     %o1, [%g1]
763         retl
764          nop
765         .size   sun4v_vintr_get_target, .-sun4v_vintr_get_target
766
767         /* %o0: device handle
768          * %o1: device INO
769          * %o2: cpuid
770          *
771          * returns %o0: status
772          */
773         .globl  sun4v_vintr_set_target
774         .type   sun4v_vintr_set_target,#function
775 sun4v_vintr_set_target:
776         mov     HV_FAST_VINTR_SET_TARGET, %o5
777         ta      HV_FAST_TRAP
778         retl
779          nop
780         .size   sun4v_vintr_set_target, .-sun4v_vintr_set_target
781
782         /* %o0: NCS sub-function
783          * %o1: sub-function arg real-address
784          * %o2: sub-function arg size
785          *
786          * returns %o0: status
787          */
788         .globl  sun4v_ncs_request
789         .type   sun4v_ncs_request,#function
790 sun4v_ncs_request:
791         mov     HV_FAST_NCS_REQUEST, %o5
792         ta      HV_FAST_TRAP
793         retl
794          nop
795         .size   sun4v_ncs_request, .-sun4v_ncs_request
796
797         .globl  sun4v_svc_send
798         .type   sun4v_svc_send,#function
799 sun4v_svc_send:
800         save    %sp, -192, %sp
801         mov     %i0, %o0
802         mov     %i1, %o1
803         mov     %i2, %o2
804         mov     HV_FAST_SVC_SEND, %o5
805         ta      HV_FAST_TRAP
806         stx     %o1, [%i3]
807         ret
808         restore
809         .size   sun4v_svc_send, .-sun4v_svc_send
810
811         .globl  sun4v_svc_recv
812         .type   sun4v_svc_recv,#function
813 sun4v_svc_recv:
814         save    %sp, -192, %sp
815         mov     %i0, %o0
816         mov     %i1, %o1
817         mov     %i2, %o2
818         mov     HV_FAST_SVC_RECV, %o5
819         ta      HV_FAST_TRAP
820         stx     %o1, [%i3]
821         ret
822         restore
823         .size   sun4v_svc_recv, .-sun4v_svc_recv
824
825         .globl  sun4v_svc_getstatus
826         .type   sun4v_svc_getstatus,#function
827 sun4v_svc_getstatus:
828         mov     HV_FAST_SVC_GETSTATUS, %o5
829         mov     %o1, %o4
830         ta      HV_FAST_TRAP
831         stx     %o1, [%o4]
832         retl
833          nop
834         .size   sun4v_svc_getstatus, .-sun4v_svc_getstatus
835
836         .globl  sun4v_svc_setstatus
837         .type   sun4v_svc_setstatus,#function
838 sun4v_svc_setstatus:
839         mov     HV_FAST_SVC_SETSTATUS, %o5
840         ta      HV_FAST_TRAP
841         retl
842          nop
843         .size   sun4v_svc_setstatus, .-sun4v_svc_setstatus
844
845         .globl  sun4v_svc_clrstatus
846         .type   sun4v_svc_clrstatus,#function
847 sun4v_svc_clrstatus:
848         mov     HV_FAST_SVC_CLRSTATUS, %o5
849         ta      HV_FAST_TRAP
850         retl
851          nop
852         .size   sun4v_svc_clrstatus, .-sun4v_svc_clrstatus
853
854         .globl  sun4v_mmustat_conf
855         .type   sun4v_mmustat_conf,#function
856 sun4v_mmustat_conf:
857         mov     %o1, %o4
858         mov     HV_FAST_MMUSTAT_CONF, %o5
859         ta      HV_FAST_TRAP
860         stx     %o1, [%o4]
861         retl
862          nop
863         .size   sun4v_mmustat_conf, .-sun4v_mmustat_conf
864
865         .globl  sun4v_mmustat_info
866         .type   sun4v_mmustat_info,#function
867 sun4v_mmustat_info:
868         mov     %o0, %o4
869         mov     HV_FAST_MMUSTAT_INFO, %o5
870         ta      HV_FAST_TRAP
871         stx     %o1, [%o4]
872         retl
873          nop
874         .size   sun4v_mmustat_info, .-sun4v_mmustat_info
875
876         .globl  sun4v_mmu_demap_all
877         .type   sun4v_mmu_demap_all,#function
878 sun4v_mmu_demap_all:
879         clr     %o0
880         clr     %o1
881         mov     HV_MMU_ALL, %o2
882         mov     HV_FAST_MMU_DEMAP_ALL, %o5
883         ta      HV_FAST_TRAP
884         retl
885          nop
886         .size   sun4v_mmu_demap_all, .-sun4v_mmu_demap_all