hvcalls.S 17 KB

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