2 * PS3 hvcall interface.
4 * Copyright (C) 2006 Sony Computer Entertainment Inc.
5 * Copyright 2006 Sony Corp.
6 * Copyright 2003, 2004 (c) MontaVista Software, Inc.
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.
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.
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
22 #include <asm/processor.h>
23 #include <asm/ppc_asm.h>
25 #define lv1call .long 0x44000022; extsw r3, r3
27 #define LV1_N_IN_0_OUT(API_NAME, API_NUMBER) \
28 _GLOBAL(_##API_NAME) \
40 #define LV1_0_IN_0_OUT LV1_N_IN_0_OUT
41 #define LV1_1_IN_0_OUT LV1_N_IN_0_OUT
42 #define LV1_2_IN_0_OUT LV1_N_IN_0_OUT
43 #define LV1_3_IN_0_OUT LV1_N_IN_0_OUT
44 #define LV1_4_IN_0_OUT LV1_N_IN_0_OUT
45 #define LV1_5_IN_0_OUT LV1_N_IN_0_OUT
46 #define LV1_6_IN_0_OUT LV1_N_IN_0_OUT
47 #define LV1_7_IN_0_OUT LV1_N_IN_0_OUT
49 #define LV1_0_IN_1_OUT(API_NAME, API_NUMBER) \
50 _GLOBAL(_##API_NAME) \
68 #define LV1_0_IN_2_OUT(API_NAME, API_NUMBER) \
69 _GLOBAL(_##API_NAME) \
90 #define LV1_0_IN_3_OUT(API_NAME, API_NUMBER) \
91 _GLOBAL(_##API_NAME) \
100 li r11, API_NUMBER; \
115 #define LV1_0_IN_7_OUT(API_NAME, API_NUMBER) \
116 _GLOBAL(_##API_NAME) \
129 li r11, API_NUMBER; \
152 #define LV1_1_IN_1_OUT(API_NAME, API_NUMBER) \
153 _GLOBAL(_##API_NAME) \
160 li r11, API_NUMBER; \
171 #define LV1_1_IN_2_OUT(API_NAME, API_NUMBER) \
172 _GLOBAL(_##API_NAME) \
180 li r11, API_NUMBER; \
193 #define LV1_1_IN_3_OUT(API_NAME, API_NUMBER) \
194 _GLOBAL(_##API_NAME) \
203 li r11, API_NUMBER; \
218 #define LV1_1_IN_4_OUT(API_NAME, API_NUMBER) \
219 _GLOBAL(_##API_NAME) \
229 li r11, API_NUMBER; \
246 #define LV1_1_IN_5_OUT(API_NAME, API_NUMBER) \
247 _GLOBAL(_##API_NAME) \
258 li r11, API_NUMBER; \
277 #define LV1_1_IN_6_OUT(API_NAME, API_NUMBER) \
278 _GLOBAL(_##API_NAME) \
290 li r11, API_NUMBER; \
311 #define LV1_1_IN_7_OUT(API_NAME, API_NUMBER) \
312 _GLOBAL(_##API_NAME) \
325 li r11, API_NUMBER; \
348 #define LV1_2_IN_1_OUT(API_NAME, API_NUMBER) \
349 _GLOBAL(_##API_NAME) \
356 li r11, API_NUMBER; \
367 #define LV1_2_IN_2_OUT(API_NAME, API_NUMBER) \
368 _GLOBAL(_##API_NAME) \
376 li r11, API_NUMBER; \
389 #define LV1_2_IN_3_OUT(API_NAME, API_NUMBER) \
390 _GLOBAL(_##API_NAME) \
399 li r11, API_NUMBER; \
414 #define LV1_2_IN_4_OUT(API_NAME, API_NUMBER) \
415 _GLOBAL(_##API_NAME) \
425 li r11, API_NUMBER; \
442 #define LV1_2_IN_5_OUT(API_NAME, API_NUMBER) \
443 _GLOBAL(_##API_NAME) \
454 li r11, API_NUMBER; \
473 #define LV1_3_IN_1_OUT(API_NAME, API_NUMBER) \
474 _GLOBAL(_##API_NAME) \
481 li r11, API_NUMBER; \
492 #define LV1_3_IN_2_OUT(API_NAME, API_NUMBER) \
493 _GLOBAL(_##API_NAME) \
501 li r11, API_NUMBER; \
514 #define LV1_3_IN_3_OUT(API_NAME, API_NUMBER) \
515 _GLOBAL(_##API_NAME) \
524 li r11, API_NUMBER; \
539 #define LV1_4_IN_1_OUT(API_NAME, API_NUMBER) \
540 _GLOBAL(_##API_NAME) \
547 li r11, API_NUMBER; \
558 #define LV1_4_IN_2_OUT(API_NAME, API_NUMBER) \
559 _GLOBAL(_##API_NAME) \
567 li r11, API_NUMBER; \
580 #define LV1_4_IN_3_OUT(API_NAME, API_NUMBER) \
581 _GLOBAL(_##API_NAME) \
590 li r11, API_NUMBER; \
605 #define LV1_5_IN_1_OUT(API_NAME, API_NUMBER) \
606 _GLOBAL(_##API_NAME) \
613 li r11, API_NUMBER; \
624 #define LV1_5_IN_2_OUT(API_NAME, API_NUMBER) \
625 _GLOBAL(_##API_NAME) \
633 li r11, API_NUMBER; \
646 #define LV1_5_IN_3_OUT(API_NAME, API_NUMBER) \
647 _GLOBAL(_##API_NAME) \
656 li r11, API_NUMBER; \
671 #define LV1_6_IN_1_OUT(API_NAME, API_NUMBER) \
672 _GLOBAL(_##API_NAME) \
679 li r11, API_NUMBER; \
690 #define LV1_6_IN_2_OUT(API_NAME, API_NUMBER) \
691 _GLOBAL(_##API_NAME) \
699 li r11, API_NUMBER; \
712 #define LV1_6_IN_3_OUT(API_NAME, API_NUMBER) \
713 _GLOBAL(_##API_NAME) \
721 li r11, API_NUMBER; \
729 ld r11, 48+8*8(r1); \
736 #define LV1_7_IN_1_OUT(API_NAME, API_NUMBER) \
737 _GLOBAL(_##API_NAME) \
744 li r11, API_NUMBER; \
755 #define LV1_7_IN_6_OUT(API_NAME, API_NUMBER) \
756 _GLOBAL(_##API_NAME) \
761 std r10, 48+8*7(r1); \
763 li r11, API_NUMBER; \
766 ld r11, 48+8*7(r1); \
768 ld r11, 48+8*8(r1); \
770 ld r11, 48+8*9(r1); \
772 ld r11, 48+8*10(r1); \
774 ld r11, 48+8*11(r1); \
776 ld r11, 48+8*12(r1); \
783 #define LV1_8_IN_1_OUT(API_NAME, API_NUMBER) \
784 _GLOBAL(_##API_NAME) \
789 li r11, API_NUMBER; \
792 ld r11, 48+8*8(r1); \
801 /* the lv1 underscored call definitions expand here */
803 #define LV1_CALL(name, in, out, num) LV1_##in##_IN_##out##_OUT(lv1_##name, num)
804 #include <asm/lv1call.h>