hvcall.S 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805
  1. /*
  2. * PS3 hvcall interface.
  3. *
  4. * Copyright (C) 2006 Sony Computer Entertainment Inc.
  5. * Copyright 2006 Sony Corp.
  6. * Copyright 2003, 2004 (c) MontaVista Software, Inc.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; version 2 of the License.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #include <asm/processor.h>
  22. #include <asm/ppc_asm.h>
  23. #define lv1call .long 0x44000022; extsw r3, r3
  24. #define LV1_N_IN_0_OUT(API_NAME, API_NUMBER) \
  25. _GLOBAL(_##API_NAME) \
  26. \
  27. mflr r0; \
  28. std r0, 16(r1); \
  29. \
  30. li r11, API_NUMBER; \
  31. lv1call; \
  32. \
  33. ld r0, 16(r1); \
  34. mtlr r0; \
  35. blr
  36. #define LV1_0_IN_0_OUT LV1_N_IN_0_OUT
  37. #define LV1_1_IN_0_OUT LV1_N_IN_0_OUT
  38. #define LV1_2_IN_0_OUT LV1_N_IN_0_OUT
  39. #define LV1_3_IN_0_OUT LV1_N_IN_0_OUT
  40. #define LV1_4_IN_0_OUT LV1_N_IN_0_OUT
  41. #define LV1_5_IN_0_OUT LV1_N_IN_0_OUT
  42. #define LV1_6_IN_0_OUT LV1_N_IN_0_OUT
  43. #define LV1_7_IN_0_OUT LV1_N_IN_0_OUT
  44. #define LV1_0_IN_1_OUT(API_NAME, API_NUMBER) \
  45. _GLOBAL(_##API_NAME) \
  46. \
  47. mflr r0; \
  48. std r0, 16(r1); \
  49. \
  50. stdu r3, -8(r1); \
  51. \
  52. li r11, API_NUMBER; \
  53. lv1call; \
  54. \
  55. addi r1, r1, 8; \
  56. ld r11, -8(r1); \
  57. std r4, 0(r11); \
  58. \
  59. ld r0, 16(r1); \
  60. mtlr r0; \
  61. blr
  62. #define LV1_0_IN_2_OUT(API_NAME, API_NUMBER) \
  63. _GLOBAL(_##API_NAME) \
  64. \
  65. mflr r0; \
  66. std r0, 16(r1); \
  67. \
  68. std r3, -8(r1); \
  69. stdu r4, -16(r1); \
  70. \
  71. li r11, API_NUMBER; \
  72. lv1call; \
  73. \
  74. addi r1, r1, 16; \
  75. ld r11, -8(r1); \
  76. std r4, 0(r11); \
  77. ld r11, -16(r1); \
  78. std r5, 0(r11); \
  79. \
  80. ld r0, 16(r1); \
  81. mtlr r0; \
  82. blr
  83. #define LV1_0_IN_3_OUT(API_NAME, API_NUMBER) \
  84. _GLOBAL(_##API_NAME) \
  85. \
  86. mflr r0; \
  87. std r0, 16(r1); \
  88. \
  89. std r3, -8(r1); \
  90. std r4, -16(r1); \
  91. stdu r5, -24(r1); \
  92. \
  93. li r11, API_NUMBER; \
  94. lv1call; \
  95. \
  96. addi r1, r1, 24; \
  97. ld r11, -8(r1); \
  98. std r4, 0(r11); \
  99. ld r11, -16(r1); \
  100. std r5, 0(r11); \
  101. ld r11, -24(r1); \
  102. std r6, 0(r11); \
  103. \
  104. ld r0, 16(r1); \
  105. mtlr r0; \
  106. blr
  107. #define LV1_0_IN_7_OUT(API_NAME, API_NUMBER) \
  108. _GLOBAL(_##API_NAME) \
  109. \
  110. mflr r0; \
  111. std r0, 16(r1); \
  112. \
  113. std r3, -8(r1); \
  114. std r4, -16(r1); \
  115. std r5, -24(r1); \
  116. std r6, -32(r1); \
  117. std r7, -40(r1); \
  118. std r8, -48(r1); \
  119. stdu r9, -56(r1); \
  120. \
  121. li r11, API_NUMBER; \
  122. lv1call; \
  123. \
  124. addi r1, r1, 56; \
  125. ld r11, -8(r1); \
  126. std r4, 0(r11); \
  127. ld r11, -16(r1); \
  128. std r5, 0(r11); \
  129. ld r11, -24(r1); \
  130. std r6, 0(r11); \
  131. ld r11, -32(r1); \
  132. std r7, 0(r11); \
  133. ld r11, -40(r1); \
  134. std r8, 0(r11); \
  135. ld r11, -48(r1); \
  136. std r9, 0(r11); \
  137. ld r11, -56(r1); \
  138. std r10, 0(r11); \
  139. \
  140. ld r0, 16(r1); \
  141. mtlr r0; \
  142. blr
  143. #define LV1_1_IN_1_OUT(API_NAME, API_NUMBER) \
  144. _GLOBAL(_##API_NAME) \
  145. \
  146. mflr r0; \
  147. std r0, 16(r1); \
  148. \
  149. stdu r4, -8(r1); \
  150. \
  151. li r11, API_NUMBER; \
  152. lv1call; \
  153. \
  154. addi r1, r1, 8; \
  155. ld r11, -8(r1); \
  156. std r4, 0(r11); \
  157. \
  158. ld r0, 16(r1); \
  159. mtlr r0; \
  160. blr
  161. #define LV1_1_IN_2_OUT(API_NAME, API_NUMBER) \
  162. _GLOBAL(_##API_NAME) \
  163. \
  164. mflr r0; \
  165. std r0, 16(r1); \
  166. \
  167. std r4, -8(r1); \
  168. stdu r5, -16(r1); \
  169. \
  170. li r11, API_NUMBER; \
  171. lv1call; \
  172. \
  173. addi r1, r1, 16; \
  174. ld r11, -8(r1); \
  175. std r4, 0(r11); \
  176. ld r11, -16(r1); \
  177. std r5, 0(r11); \
  178. \
  179. ld r0, 16(r1); \
  180. mtlr r0; \
  181. blr
  182. #define LV1_1_IN_3_OUT(API_NAME, API_NUMBER) \
  183. _GLOBAL(_##API_NAME) \
  184. \
  185. mflr r0; \
  186. std r0, 16(r1); \
  187. \
  188. std r4, -8(r1); \
  189. std r5, -16(r1); \
  190. stdu r6, -24(r1); \
  191. \
  192. li r11, API_NUMBER; \
  193. lv1call; \
  194. \
  195. addi r1, r1, 24; \
  196. ld r11, -8(r1); \
  197. std r4, 0(r11); \
  198. ld r11, -16(r1); \
  199. std r5, 0(r11); \
  200. ld r11, -24(r1); \
  201. std r6, 0(r11); \
  202. \
  203. ld r0, 16(r1); \
  204. mtlr r0; \
  205. blr
  206. #define LV1_1_IN_4_OUT(API_NAME, API_NUMBER) \
  207. _GLOBAL(_##API_NAME) \
  208. \
  209. mflr r0; \
  210. std r0, 16(r1); \
  211. \
  212. std r4, -8(r1); \
  213. std r5, -16(r1); \
  214. std r6, -24(r1); \
  215. stdu r7, -32(r1); \
  216. \
  217. li r11, API_NUMBER; \
  218. lv1call; \
  219. \
  220. addi r1, r1, 32; \
  221. ld r11, -8(r1); \
  222. std r4, 0(r11); \
  223. ld r11, -16(r1); \
  224. std r5, 0(r11); \
  225. ld r11, -24(r1); \
  226. std r6, 0(r11); \
  227. ld r11, -32(r1); \
  228. std r7, 0(r11); \
  229. \
  230. ld r0, 16(r1); \
  231. mtlr r0; \
  232. blr
  233. #define LV1_1_IN_5_OUT(API_NAME, API_NUMBER) \
  234. _GLOBAL(_##API_NAME) \
  235. \
  236. mflr r0; \
  237. std r0, 16(r1); \
  238. \
  239. std r4, -8(r1); \
  240. std r5, -16(r1); \
  241. std r6, -24(r1); \
  242. std r7, -32(r1); \
  243. stdu r8, -40(r1); \
  244. \
  245. li r11, API_NUMBER; \
  246. lv1call; \
  247. \
  248. addi r1, r1, 40; \
  249. ld r11, -8(r1); \
  250. std r4, 0(r11); \
  251. ld r11, -16(r1); \
  252. std r5, 0(r11); \
  253. ld r11, -24(r1); \
  254. std r6, 0(r11); \
  255. ld r11, -32(r1); \
  256. std r7, 0(r11); \
  257. ld r11, -40(r1); \
  258. std r8, 0(r11); \
  259. \
  260. ld r0, 16(r1); \
  261. mtlr r0; \
  262. blr
  263. #define LV1_1_IN_6_OUT(API_NAME, API_NUMBER) \
  264. _GLOBAL(_##API_NAME) \
  265. \
  266. mflr r0; \
  267. std r0, 16(r1); \
  268. \
  269. std r4, -8(r1); \
  270. std r5, -16(r1); \
  271. std r6, -24(r1); \
  272. std r7, -32(r1); \
  273. std r8, -40(r1); \
  274. stdu r9, -48(r1); \
  275. \
  276. li r11, API_NUMBER; \
  277. lv1call; \
  278. \
  279. addi r1, r1, 48; \
  280. ld r11, -8(r1); \
  281. std r4, 0(r11); \
  282. ld r11, -16(r1); \
  283. std r5, 0(r11); \
  284. ld r11, -24(r1); \
  285. std r6, 0(r11); \
  286. ld r11, -32(r1); \
  287. std r7, 0(r11); \
  288. ld r11, -40(r1); \
  289. std r8, 0(r11); \
  290. ld r11, -48(r1); \
  291. std r9, 0(r11); \
  292. \
  293. ld r0, 16(r1); \
  294. mtlr r0; \
  295. blr
  296. #define LV1_1_IN_7_OUT(API_NAME, API_NUMBER) \
  297. _GLOBAL(_##API_NAME) \
  298. \
  299. mflr r0; \
  300. std r0, 16(r1); \
  301. \
  302. std r4, -8(r1); \
  303. std r5, -16(r1); \
  304. std r6, -24(r1); \
  305. std r7, -32(r1); \
  306. std r8, -40(r1); \
  307. std r9, -48(r1); \
  308. stdu r10, -56(r1); \
  309. \
  310. li r11, API_NUMBER; \
  311. lv1call; \
  312. \
  313. addi r1, r1, 56; \
  314. ld r11, -8(r1); \
  315. std r4, 0(r11); \
  316. ld r11, -16(r1); \
  317. std r5, 0(r11); \
  318. ld r11, -24(r1); \
  319. std r6, 0(r11); \
  320. ld r11, -32(r1); \
  321. std r7, 0(r11); \
  322. ld r11, -40(r1); \
  323. std r8, 0(r11); \
  324. ld r11, -48(r1); \
  325. std r9, 0(r11); \
  326. ld r11, -56(r1); \
  327. std r10, 0(r11); \
  328. \
  329. ld r0, 16(r1); \
  330. mtlr r0; \
  331. blr
  332. #define LV1_2_IN_1_OUT(API_NAME, API_NUMBER) \
  333. _GLOBAL(_##API_NAME) \
  334. \
  335. mflr r0; \
  336. std r0, 16(r1); \
  337. \
  338. stdu r5, -8(r1); \
  339. \
  340. li r11, API_NUMBER; \
  341. lv1call; \
  342. \
  343. addi r1, r1, 8; \
  344. ld r11, -8(r1); \
  345. std r4, 0(r11); \
  346. \
  347. ld r0, 16(r1); \
  348. mtlr r0; \
  349. blr
  350. #define LV1_2_IN_2_OUT(API_NAME, API_NUMBER) \
  351. _GLOBAL(_##API_NAME) \
  352. \
  353. mflr r0; \
  354. std r0, 16(r1); \
  355. \
  356. std r5, -8(r1); \
  357. stdu r6, -16(r1); \
  358. \
  359. li r11, API_NUMBER; \
  360. lv1call; \
  361. \
  362. addi r1, r1, 16; \
  363. ld r11, -8(r1); \
  364. std r4, 0(r11); \
  365. ld r11, -16(r1); \
  366. std r5, 0(r11); \
  367. \
  368. ld r0, 16(r1); \
  369. mtlr r0; \
  370. blr
  371. #define LV1_2_IN_3_OUT(API_NAME, API_NUMBER) \
  372. _GLOBAL(_##API_NAME) \
  373. \
  374. mflr r0; \
  375. std r0, 16(r1); \
  376. \
  377. std r5, -8(r1); \
  378. std r6, -16(r1); \
  379. stdu r7, -24(r1); \
  380. \
  381. li r11, API_NUMBER; \
  382. lv1call; \
  383. \
  384. addi r1, r1, 24; \
  385. ld r11, -8(r1); \
  386. std r4, 0(r11); \
  387. ld r11, -16(r1); \
  388. std r5, 0(r11); \
  389. ld r11, -24(r1); \
  390. std r6, 0(r11); \
  391. \
  392. ld r0, 16(r1); \
  393. mtlr r0; \
  394. blr
  395. #define LV1_2_IN_4_OUT(API_NAME, API_NUMBER) \
  396. _GLOBAL(_##API_NAME) \
  397. \
  398. mflr r0; \
  399. std r0, 16(r1); \
  400. \
  401. std r5, -8(r1); \
  402. std r6, -16(r1); \
  403. std r7, -24(r1); \
  404. stdu r8, -32(r1); \
  405. \
  406. li r11, API_NUMBER; \
  407. lv1call; \
  408. \
  409. addi r1, r1, 32; \
  410. ld r11, -8(r1); \
  411. std r4, 0(r11); \
  412. ld r11, -16(r1); \
  413. std r5, 0(r11); \
  414. ld r11, -24(r1); \
  415. std r6, 0(r11); \
  416. ld r11, -32(r1); \
  417. std r7, 0(r11); \
  418. \
  419. ld r0, 16(r1); \
  420. mtlr r0; \
  421. blr
  422. #define LV1_2_IN_5_OUT(API_NAME, API_NUMBER) \
  423. _GLOBAL(_##API_NAME) \
  424. \
  425. mflr r0; \
  426. std r0, 16(r1); \
  427. \
  428. std r5, -8(r1); \
  429. std r6, -16(r1); \
  430. std r7, -24(r1); \
  431. std r8, -32(r1); \
  432. stdu r9, -40(r1); \
  433. \
  434. li r11, API_NUMBER; \
  435. lv1call; \
  436. \
  437. addi r1, r1, 40; \
  438. ld r11, -8(r1); \
  439. std r4, 0(r11); \
  440. ld r11, -16(r1); \
  441. std r5, 0(r11); \
  442. ld r11, -24(r1); \
  443. std r6, 0(r11); \
  444. ld r11, -32(r1); \
  445. std r7, 0(r11); \
  446. ld r11, -40(r1); \
  447. std r8, 0(r11); \
  448. \
  449. ld r0, 16(r1); \
  450. mtlr r0; \
  451. blr
  452. #define LV1_3_IN_1_OUT(API_NAME, API_NUMBER) \
  453. _GLOBAL(_##API_NAME) \
  454. \
  455. mflr r0; \
  456. std r0, 16(r1); \
  457. \
  458. stdu r6, -8(r1); \
  459. \
  460. li r11, API_NUMBER; \
  461. lv1call; \
  462. \
  463. addi r1, r1, 8; \
  464. ld r11, -8(r1); \
  465. std r4, 0(r11); \
  466. \
  467. ld r0, 16(r1); \
  468. mtlr r0; \
  469. blr
  470. #define LV1_3_IN_2_OUT(API_NAME, API_NUMBER) \
  471. _GLOBAL(_##API_NAME) \
  472. \
  473. mflr r0; \
  474. std r0, 16(r1); \
  475. \
  476. std r6, -8(r1); \
  477. stdu r7, -16(r1); \
  478. \
  479. li r11, API_NUMBER; \
  480. lv1call; \
  481. \
  482. addi r1, r1, 16; \
  483. ld r11, -8(r1); \
  484. std r4, 0(r11); \
  485. ld r11, -16(r1); \
  486. std r5, 0(r11); \
  487. \
  488. ld r0, 16(r1); \
  489. mtlr r0; \
  490. blr
  491. #define LV1_3_IN_3_OUT(API_NAME, API_NUMBER) \
  492. _GLOBAL(_##API_NAME) \
  493. \
  494. mflr r0; \
  495. std r0, 16(r1); \
  496. \
  497. std r6, -8(r1); \
  498. std r7, -16(r1); \
  499. stdu r8, -24(r1); \
  500. \
  501. li r11, API_NUMBER; \
  502. lv1call; \
  503. \
  504. addi r1, r1, 24; \
  505. ld r11, -8(r1); \
  506. std r4, 0(r11); \
  507. ld r11, -16(r1); \
  508. std r5, 0(r11); \
  509. ld r11, -24(r1); \
  510. std r6, 0(r11); \
  511. \
  512. ld r0, 16(r1); \
  513. mtlr r0; \
  514. blr
  515. #define LV1_4_IN_1_OUT(API_NAME, API_NUMBER) \
  516. _GLOBAL(_##API_NAME) \
  517. \
  518. mflr r0; \
  519. std r0, 16(r1); \
  520. \
  521. stdu r7, -8(r1); \
  522. \
  523. li r11, API_NUMBER; \
  524. lv1call; \
  525. \
  526. addi r1, r1, 8; \
  527. ld r11, -8(r1); \
  528. std r4, 0(r11); \
  529. \
  530. ld r0, 16(r1); \
  531. mtlr r0; \
  532. blr
  533. #define LV1_4_IN_2_OUT(API_NAME, API_NUMBER) \
  534. _GLOBAL(_##API_NAME) \
  535. \
  536. mflr r0; \
  537. std r0, 16(r1); \
  538. \
  539. std r7, -8(r1); \
  540. stdu r8, -16(r1); \
  541. \
  542. li r11, API_NUMBER; \
  543. lv1call; \
  544. \
  545. addi r1, r1, 16; \
  546. ld r11, -8(r1); \
  547. std r4, 0(r11); \
  548. ld r11, -16(r1); \
  549. std r5, 0(r11); \
  550. \
  551. ld r0, 16(r1); \
  552. mtlr r0; \
  553. blr
  554. #define LV1_4_IN_3_OUT(API_NAME, API_NUMBER) \
  555. _GLOBAL(_##API_NAME) \
  556. \
  557. mflr r0; \
  558. std r0, 16(r1); \
  559. \
  560. std r7, -8(r1); \
  561. std r8, -16(r1); \
  562. stdu r9, -24(r1); \
  563. \
  564. li r11, API_NUMBER; \
  565. lv1call; \
  566. \
  567. addi r1, r1, 24; \
  568. ld r11, -8(r1); \
  569. std r4, 0(r11); \
  570. ld r11, -16(r1); \
  571. std r5, 0(r11); \
  572. ld r11, -24(r1); \
  573. std r6, 0(r11); \
  574. \
  575. ld r0, 16(r1); \
  576. mtlr r0; \
  577. blr
  578. #define LV1_5_IN_1_OUT(API_NAME, API_NUMBER) \
  579. _GLOBAL(_##API_NAME) \
  580. \
  581. mflr r0; \
  582. std r0, 16(r1); \
  583. \
  584. stdu r8, -8(r1); \
  585. \
  586. li r11, API_NUMBER; \
  587. lv1call; \
  588. \
  589. addi r1, r1, 8; \
  590. ld r11, -8(r1); \
  591. std r4, 0(r11); \
  592. \
  593. ld r0, 16(r1); \
  594. mtlr r0; \
  595. blr
  596. #define LV1_5_IN_2_OUT(API_NAME, API_NUMBER) \
  597. _GLOBAL(_##API_NAME) \
  598. \
  599. mflr r0; \
  600. std r0, 16(r1); \
  601. \
  602. std r8, -8(r1); \
  603. stdu r9, -16(r1); \
  604. \
  605. li r11, API_NUMBER; \
  606. lv1call; \
  607. \
  608. addi r1, r1, 16; \
  609. ld r11, -8(r1); \
  610. std r4, 0(r11); \
  611. ld r11, -16(r1); \
  612. std r5, 0(r11); \
  613. \
  614. ld r0, 16(r1); \
  615. mtlr r0; \
  616. blr
  617. #define LV1_5_IN_3_OUT(API_NAME, API_NUMBER) \
  618. _GLOBAL(_##API_NAME) \
  619. \
  620. mflr r0; \
  621. std r0, 16(r1); \
  622. \
  623. std r8, -8(r1); \
  624. std r9, -16(r1); \
  625. stdu r10, -24(r1); \
  626. \
  627. li r11, API_NUMBER; \
  628. lv1call; \
  629. \
  630. addi r1, r1, 24; \
  631. ld r11, -8(r1); \
  632. std r4, 0(r11); \
  633. ld r11, -16(r1); \
  634. std r5, 0(r11); \
  635. ld r11, -24(r1); \
  636. std r6, 0(r11); \
  637. \
  638. ld r0, 16(r1); \
  639. mtlr r0; \
  640. blr
  641. #define LV1_6_IN_1_OUT(API_NAME, API_NUMBER) \
  642. _GLOBAL(_##API_NAME) \
  643. \
  644. mflr r0; \
  645. std r0, 16(r1); \
  646. \
  647. stdu r9, -8(r1); \
  648. \
  649. li r11, API_NUMBER; \
  650. lv1call; \
  651. \
  652. addi r1, r1, 8; \
  653. ld r11, -8(r1); \
  654. std r4, 0(r11); \
  655. \
  656. ld r0, 16(r1); \
  657. mtlr r0; \
  658. blr
  659. #define LV1_6_IN_2_OUT(API_NAME, API_NUMBER) \
  660. _GLOBAL(_##API_NAME) \
  661. \
  662. mflr r0; \
  663. std r0, 16(r1); \
  664. \
  665. std r9, -8(r1); \
  666. stdu r10, -16(r1); \
  667. \
  668. li r11, API_NUMBER; \
  669. lv1call; \
  670. \
  671. addi r1, r1, 16; \
  672. ld r11, -8(r1); \
  673. std r4, 0(r11); \
  674. ld r11, -16(r1); \
  675. std r5, 0(r11); \
  676. \
  677. ld r0, 16(r1); \
  678. mtlr r0; \
  679. blr
  680. #define LV1_6_IN_3_OUT(API_NAME, API_NUMBER) \
  681. _GLOBAL(_##API_NAME) \
  682. \
  683. mflr r0; \
  684. std r0, 16(r1); \
  685. \
  686. std r9, -8(r1); \
  687. stdu r10, -16(r1); \
  688. \
  689. li r11, API_NUMBER; \
  690. lv1call; \
  691. \
  692. addi r1, r1, 16; \
  693. ld r11, -8(r1); \
  694. std r4, 0(r11); \
  695. ld r11, -16(r1); \
  696. std r5, 0(r11); \
  697. ld r11, 48+8*8(r1); \
  698. std r6, 0(r11); \
  699. \
  700. ld r0, 16(r1); \
  701. mtlr r0; \
  702. blr
  703. #define LV1_7_IN_1_OUT(API_NAME, API_NUMBER) \
  704. _GLOBAL(_##API_NAME) \
  705. \
  706. mflr r0; \
  707. std r0, 16(r1); \
  708. \
  709. stdu r10, -8(r1); \
  710. \
  711. li r11, API_NUMBER; \
  712. lv1call; \
  713. \
  714. addi r1, r1, 8; \
  715. ld r11, -8(r1); \
  716. std r4, 0(r11); \
  717. \
  718. ld r0, 16(r1); \
  719. mtlr r0; \
  720. blr
  721. #define LV1_7_IN_6_OUT(API_NAME, API_NUMBER) \
  722. _GLOBAL(_##API_NAME) \
  723. \
  724. mflr r0; \
  725. std r0, 16(r1); \
  726. \
  727. std r10, 48+8*7(r1); \
  728. \
  729. li r11, API_NUMBER; \
  730. lv1call; \
  731. \
  732. ld r11, 48+8*7(r1); \
  733. std r4, 0(r11); \
  734. ld r11, 48+8*8(r1); \
  735. std r5, 0(r11); \
  736. ld r11, 48+8*9(r1); \
  737. std r6, 0(r11); \
  738. ld r11, 48+8*10(r1); \
  739. std r7, 0(r11); \
  740. ld r11, 48+8*11(r1); \
  741. std r8, 0(r11); \
  742. ld r11, 48+8*12(r1); \
  743. std r9, 0(r11); \
  744. \
  745. ld r0, 16(r1); \
  746. mtlr r0; \
  747. blr
  748. #define LV1_8_IN_1_OUT(API_NAME, API_NUMBER) \
  749. _GLOBAL(_##API_NAME) \
  750. \
  751. mflr r0; \
  752. std r0, 16(r1); \
  753. \
  754. li r11, API_NUMBER; \
  755. lv1call; \
  756. \
  757. ld r11, 48+8*8(r1); \
  758. std r4, 0(r11); \
  759. \
  760. ld r0, 16(r1); \
  761. mtlr r0; \
  762. blr
  763. .text
  764. /* the lv1 underscored call definitions expand here */
  765. #define LV1_CALL(name, in, out, num) LV1_##in##_IN_##out##_OUT(lv1_##name, num)
  766. #include <asm/lv1call.h>