1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * PS3 hvcall interface.
5 * Copyright (C) 2006 Sony Computer Entertainment Inc.
6 * Copyright 2006 Sony Corp.
7 * Copyright 2003, 2004 (c) MontaVista Software, Inc.
10 #include <asm/processor.h>
11 #include <asm/ppc_asm.h>
13 #define lv1call .long 0x44000022; extsw r3, r3
15 #define LV1_N_IN_0_OUT(API_NAME, API_NUMBER) \
16 _GLOBAL(_##API_NAME) \
28 #define LV1_0_IN_0_OUT LV1_N_IN_0_OUT
29 #define LV1_1_IN_0_OUT LV1_N_IN_0_OUT
30 #define LV1_2_IN_0_OUT LV1_N_IN_0_OUT
31 #define LV1_3_IN_0_OUT LV1_N_IN_0_OUT
32 #define LV1_4_IN_0_OUT LV1_N_IN_0_OUT
33 #define LV1_5_IN_0_OUT LV1_N_IN_0_OUT
34 #define LV1_6_IN_0_OUT LV1_N_IN_0_OUT
35 #define LV1_7_IN_0_OUT LV1_N_IN_0_OUT
37 #define LV1_0_IN_1_OUT(API_NAME, API_NUMBER) \
38 _GLOBAL(_##API_NAME) \
56 #define LV1_0_IN_2_OUT(API_NAME, API_NUMBER) \
57 _GLOBAL(_##API_NAME) \
78 #define LV1_0_IN_3_OUT(API_NAME, API_NUMBER) \
79 _GLOBAL(_##API_NAME) \
103 #define LV1_0_IN_7_OUT(API_NAME, API_NUMBER) \
104 _GLOBAL(_##API_NAME) \
117 li r11, API_NUMBER; \
140 #define LV1_1_IN_1_OUT(API_NAME, API_NUMBER) \
141 _GLOBAL(_##API_NAME) \
148 li r11, API_NUMBER; \
159 #define LV1_1_IN_2_OUT(API_NAME, API_NUMBER) \
160 _GLOBAL(_##API_NAME) \
168 li r11, API_NUMBER; \
181 #define LV1_1_IN_3_OUT(API_NAME, API_NUMBER) \
182 _GLOBAL(_##API_NAME) \
191 li r11, API_NUMBER; \
206 #define LV1_1_IN_4_OUT(API_NAME, API_NUMBER) \
207 _GLOBAL(_##API_NAME) \
217 li r11, API_NUMBER; \
234 #define LV1_1_IN_5_OUT(API_NAME, API_NUMBER) \
235 _GLOBAL(_##API_NAME) \
246 li r11, API_NUMBER; \
265 #define LV1_1_IN_6_OUT(API_NAME, API_NUMBER) \
266 _GLOBAL(_##API_NAME) \
278 li r11, API_NUMBER; \
299 #define LV1_1_IN_7_OUT(API_NAME, API_NUMBER) \
300 _GLOBAL(_##API_NAME) \
313 li r11, API_NUMBER; \
336 #define LV1_2_IN_1_OUT(API_NAME, API_NUMBER) \
337 _GLOBAL(_##API_NAME) \
344 li r11, API_NUMBER; \
355 #define LV1_2_IN_2_OUT(API_NAME, API_NUMBER) \
356 _GLOBAL(_##API_NAME) \
364 li r11, API_NUMBER; \
377 #define LV1_2_IN_3_OUT(API_NAME, API_NUMBER) \
378 _GLOBAL(_##API_NAME) \
387 li r11, API_NUMBER; \
402 #define LV1_2_IN_4_OUT(API_NAME, API_NUMBER) \
403 _GLOBAL(_##API_NAME) \
413 li r11, API_NUMBER; \
430 #define LV1_2_IN_5_OUT(API_NAME, API_NUMBER) \
431 _GLOBAL(_##API_NAME) \
442 li r11, API_NUMBER; \
461 #define LV1_3_IN_1_OUT(API_NAME, API_NUMBER) \
462 _GLOBAL(_##API_NAME) \
469 li r11, API_NUMBER; \
480 #define LV1_3_IN_2_OUT(API_NAME, API_NUMBER) \
481 _GLOBAL(_##API_NAME) \
489 li r11, API_NUMBER; \
502 #define LV1_3_IN_3_OUT(API_NAME, API_NUMBER) \
503 _GLOBAL(_##API_NAME) \
512 li r11, API_NUMBER; \
527 #define LV1_4_IN_1_OUT(API_NAME, API_NUMBER) \
528 _GLOBAL(_##API_NAME) \
535 li r11, API_NUMBER; \
546 #define LV1_4_IN_2_OUT(API_NAME, API_NUMBER) \
547 _GLOBAL(_##API_NAME) \
555 li r11, API_NUMBER; \
568 #define LV1_4_IN_3_OUT(API_NAME, API_NUMBER) \
569 _GLOBAL(_##API_NAME) \
578 li r11, API_NUMBER; \
593 #define LV1_5_IN_1_OUT(API_NAME, API_NUMBER) \
594 _GLOBAL(_##API_NAME) \
601 li r11, API_NUMBER; \
612 #define LV1_5_IN_2_OUT(API_NAME, API_NUMBER) \
613 _GLOBAL(_##API_NAME) \
621 li r11, API_NUMBER; \
634 #define LV1_5_IN_3_OUT(API_NAME, API_NUMBER) \
635 _GLOBAL(_##API_NAME) \
644 li r11, API_NUMBER; \
659 #define LV1_6_IN_1_OUT(API_NAME, API_NUMBER) \
660 _GLOBAL(_##API_NAME) \
667 li r11, API_NUMBER; \
678 #define LV1_6_IN_2_OUT(API_NAME, API_NUMBER) \
679 _GLOBAL(_##API_NAME) \
687 li r11, API_NUMBER; \
700 #define LV1_6_IN_3_OUT(API_NAME, API_NUMBER) \
701 _GLOBAL(_##API_NAME) \
709 li r11, API_NUMBER; \
717 ld r11, 48+8*8(r1); \
724 #define LV1_7_IN_1_OUT(API_NAME, API_NUMBER) \
725 _GLOBAL(_##API_NAME) \
732 li r11, API_NUMBER; \
743 #define LV1_7_IN_6_OUT(API_NAME, API_NUMBER) \
744 _GLOBAL(_##API_NAME) \
749 std r10, 48+8*7(r1); \
751 li r11, API_NUMBER; \
754 ld r11, 48+8*7(r1); \
756 ld r11, 48+8*8(r1); \
758 ld r11, 48+8*9(r1); \
760 ld r11, 48+8*10(r1); \
762 ld r11, 48+8*11(r1); \
764 ld r11, 48+8*12(r1); \
771 #define LV1_8_IN_1_OUT(API_NAME, API_NUMBER) \
772 _GLOBAL(_##API_NAME) \
777 li r11, API_NUMBER; \
780 ld r11, 48+8*8(r1); \
789 /* the lv1 underscored call definitions expand here */
791 #define LV1_CALL(name, in, out, num) LV1_##in##_IN_##out##_OUT(lv1_##name, num)
792 #include <asm/lv1call.h>