diff options
author | Geoff Levand <geoffrey.levand@am.sony.com> | 2006-11-22 18:46:52 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-12-04 04:40:44 -0500 |
commit | 1e4ed915d133aaa2802d11914a7e80b3e31304e6 (patch) | |
tree | ac5c0e4c49483494123d1d072bee564fd239b447 | |
parent | f58a9d171a346afb1b09190427e6c28c6118703e (diff) |
[POWERPC] ps3: add lv1 hvcalls
Adds the PS3 hvcalls.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
-rw-r--r-- | arch/powerpc/platforms/ps3/exports.c | 27 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/hvcall.S | 804 | ||||
-rw-r--r-- | include/asm-powerpc/lv1call.h | 345 |
3 files changed, 1176 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/ps3/exports.c b/arch/powerpc/platforms/ps3/exports.c new file mode 100644 index 000000000000..a7e8ffd24a65 --- /dev/null +++ b/arch/powerpc/platforms/ps3/exports.c | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * PS3 hvcall exports for modules. | ||
3 | * | ||
4 | * Copyright (C) 2006 Sony Computer Entertainment Inc. | ||
5 | * Copyright 2006 Sony Corp. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; version 2 of the License. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #include <linux/module.h> | ||
22 | |||
23 | #define LV1_CALL(name, in, out, num) \ | ||
24 | extern s64 _lv1_##name(LV1_##in##_IN_##out##_OUT_ARG_DECL); \ | ||
25 | EXPORT_SYMBOL(_lv1_##name); | ||
26 | |||
27 | #include <asm/lv1call.h> | ||
diff --git a/arch/powerpc/platforms/ps3/hvcall.S b/arch/powerpc/platforms/ps3/hvcall.S new file mode 100644 index 000000000000..54be6523a0e8 --- /dev/null +++ b/arch/powerpc/platforms/ps3/hvcall.S | |||
@@ -0,0 +1,804 @@ | |||
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 | |||
22 | #include <asm/processor.h> | ||
23 | #include <asm/ppc_asm.h> | ||
24 | |||
25 | #define lv1call .long 0x44000022; extsw r3, r3 | ||
26 | |||
27 | #define LV1_N_IN_0_OUT(API_NAME, API_NUMBER) \ | ||
28 | _GLOBAL(_##API_NAME) \ | ||
29 | \ | ||
30 | mflr r0; \ | ||
31 | std r0, 16(r1); \ | ||
32 | \ | ||
33 | li r11, API_NUMBER; \ | ||
34 | lv1call; \ | ||
35 | \ | ||
36 | ld r0, 16(r1); \ | ||
37 | mtlr r0; \ | ||
38 | blr | ||
39 | |||
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 | ||
48 | |||
49 | #define LV1_0_IN_1_OUT(API_NAME, API_NUMBER) \ | ||
50 | _GLOBAL(_##API_NAME) \ | ||
51 | \ | ||
52 | mflr r0; \ | ||
53 | std r0, 16(r1); \ | ||
54 | \ | ||
55 | stdu r3, -8(r1); \ | ||
56 | \ | ||
57 | li r11, API_NUMBER; \ | ||
58 | lv1call; \ | ||
59 | \ | ||
60 | addi r1, r1, 8; \ | ||
61 | ld r11, -8(r1); \ | ||
62 | std r4, 0(r11); \ | ||
63 | \ | ||
64 | ld r0, 16(r1); \ | ||
65 | mtlr r0; \ | ||
66 | blr | ||
67 | |||
68 | #define LV1_0_IN_2_OUT(API_NAME, API_NUMBER) \ | ||
69 | _GLOBAL(_##API_NAME) \ | ||
70 | \ | ||
71 | mflr r0; \ | ||
72 | std r0, 16(r1); \ | ||
73 | \ | ||
74 | std r3, -8(r1); \ | ||
75 | stdu r4, -16(r1); \ | ||
76 | \ | ||
77 | li r11, API_NUMBER; \ | ||
78 | lv1call; \ | ||
79 | \ | ||
80 | addi r1, r1, 16; \ | ||
81 | ld r11, -8(r1); \ | ||
82 | std r4, 0(r11); \ | ||
83 | ld r11, -16(r1); \ | ||
84 | std r5, 0(r11); \ | ||
85 | \ | ||
86 | ld r0, 16(r1); \ | ||
87 | mtlr r0; \ | ||
88 | blr | ||
89 | |||
90 | #define LV1_0_IN_3_OUT(API_NAME, API_NUMBER) \ | ||
91 | _GLOBAL(_##API_NAME) \ | ||
92 | \ | ||
93 | mflr r0; \ | ||
94 | std r0, 16(r1); \ | ||
95 | \ | ||
96 | std r3, -8(r1); \ | ||
97 | std r4, -16(r1); \ | ||
98 | stdu r5, -24(r1); \ | ||
99 | \ | ||
100 | li r11, API_NUMBER; \ | ||
101 | lv1call; \ | ||
102 | \ | ||
103 | addi r1, r1, 24; \ | ||
104 | ld r11, -8(r1); \ | ||
105 | std r4, 0(r11); \ | ||
106 | ld r11, -16(r1); \ | ||
107 | std r5, 0(r11); \ | ||
108 | ld r11, -24(r1); \ | ||
109 | std r6, 0(r11); \ | ||
110 | \ | ||
111 | ld r0, 16(r1); \ | ||
112 | mtlr r0; \ | ||
113 | blr | ||
114 | |||
115 | #define LV1_0_IN_7_OUT(API_NAME, API_NUMBER) \ | ||
116 | _GLOBAL(_##API_NAME) \ | ||
117 | \ | ||
118 | mflr r0; \ | ||
119 | std r0, 16(r1); \ | ||
120 | \ | ||
121 | std r3, -8(r1); \ | ||
122 | std r4, -16(r1); \ | ||
123 | std r5, -24(r1); \ | ||
124 | std r6, -32(r1); \ | ||
125 | std r7, -40(r1); \ | ||
126 | std r8, -48(r1); \ | ||
127 | stdu r9, -56(r1); \ | ||
128 | \ | ||
129 | li r11, API_NUMBER; \ | ||
130 | lv1call; \ | ||
131 | \ | ||
132 | addi r1, r1, 56; \ | ||
133 | ld r11, -8(r1); \ | ||
134 | std r4, 0(r11); \ | ||
135 | ld r11, -16(r1); \ | ||
136 | std r5, 0(r11); \ | ||
137 | ld r11, -24(r1); \ | ||
138 | std r6, 0(r11); \ | ||
139 | ld r11, -32(r1); \ | ||
140 | std r7, 0(r11); \ | ||
141 | ld r11, -40(r1); \ | ||
142 | std r8, 0(r11); \ | ||
143 | ld r11, -48(r1); \ | ||
144 | std r9, 0(r11); \ | ||
145 | ld r11, -56(r1); \ | ||
146 | std r10, 0(r11); \ | ||
147 | \ | ||
148 | ld r0, 16(r1); \ | ||
149 | mtlr r0; \ | ||
150 | blr | ||
151 | |||
152 | #define LV1_1_IN_1_OUT(API_NAME, API_NUMBER) \ | ||
153 | _GLOBAL(_##API_NAME) \ | ||
154 | \ | ||
155 | mflr r0; \ | ||
156 | std r0, 16(r1); \ | ||
157 | \ | ||
158 | stdu r4, -8(r1); \ | ||
159 | \ | ||
160 | li r11, API_NUMBER; \ | ||
161 | lv1call; \ | ||
162 | \ | ||
163 | addi r1, r1, 8; \ | ||
164 | ld r11, -8(r1); \ | ||
165 | std r4, 0(r11); \ | ||
166 | \ | ||
167 | ld r0, 16(r1); \ | ||
168 | mtlr r0; \ | ||
169 | blr | ||
170 | |||
171 | #define LV1_1_IN_2_OUT(API_NAME, API_NUMBER) \ | ||
172 | _GLOBAL(_##API_NAME) \ | ||
173 | \ | ||
174 | mflr r0; \ | ||
175 | std r0, 16(r1); \ | ||
176 | \ | ||
177 | std r4, -8(r1); \ | ||
178 | stdu r5, -16(r1); \ | ||
179 | \ | ||
180 | li r11, API_NUMBER; \ | ||
181 | lv1call; \ | ||
182 | \ | ||
183 | addi r1, r1, 16; \ | ||
184 | ld r11, -8(r1); \ | ||
185 | std r4, 0(r11); \ | ||
186 | ld r11, -16(r1); \ | ||
187 | std r5, 0(r11); \ | ||
188 | \ | ||
189 | ld r0, 16(r1); \ | ||
190 | mtlr r0; \ | ||
191 | blr | ||
192 | |||
193 | #define LV1_1_IN_3_OUT(API_NAME, API_NUMBER) \ | ||
194 | _GLOBAL(_##API_NAME) \ | ||
195 | \ | ||
196 | mflr r0; \ | ||
197 | std r0, 16(r1); \ | ||
198 | \ | ||
199 | std r4, -8(r1); \ | ||
200 | std r5, -16(r1); \ | ||
201 | stdu r6, -24(r1); \ | ||
202 | \ | ||
203 | li r11, API_NUMBER; \ | ||
204 | lv1call; \ | ||
205 | \ | ||
206 | addi r1, r1, 24; \ | ||
207 | ld r11, -8(r1); \ | ||
208 | std r4, 0(r11); \ | ||
209 | ld r11, -16(r1); \ | ||
210 | std r5, 0(r11); \ | ||
211 | ld r11, -24(r1); \ | ||
212 | std r6, 0(r11); \ | ||
213 | \ | ||
214 | ld r0, 16(r1); \ | ||
215 | mtlr r0; \ | ||
216 | blr | ||
217 | |||
218 | #define LV1_1_IN_4_OUT(API_NAME, API_NUMBER) \ | ||
219 | _GLOBAL(_##API_NAME) \ | ||
220 | \ | ||
221 | mflr r0; \ | ||
222 | std r0, 16(r1); \ | ||
223 | \ | ||
224 | std r4, -8(r1); \ | ||
225 | std r5, -16(r1); \ | ||
226 | std r6, -24(r1); \ | ||
227 | stdu r7, -32(r1); \ | ||
228 | \ | ||
229 | li r11, API_NUMBER; \ | ||
230 | lv1call; \ | ||
231 | \ | ||
232 | addi r1, r1, 32; \ | ||
233 | ld r11, -8(r1); \ | ||
234 | std r4, 0(r11); \ | ||
235 | ld r11, -16(r1); \ | ||
236 | std r5, 0(r11); \ | ||
237 | ld r11, -24(r1); \ | ||
238 | std r6, 0(r11); \ | ||
239 | ld r11, -32(r1); \ | ||
240 | std r7, 0(r11); \ | ||
241 | \ | ||
242 | ld r0, 16(r1); \ | ||
243 | mtlr r0; \ | ||
244 | blr | ||
245 | |||
246 | #define LV1_1_IN_5_OUT(API_NAME, API_NUMBER) \ | ||
247 | _GLOBAL(_##API_NAME) \ | ||
248 | \ | ||
249 | mflr r0; \ | ||
250 | std r0, 16(r1); \ | ||
251 | \ | ||
252 | std r4, -8(r1); \ | ||
253 | std r5, -16(r1); \ | ||
254 | std r6, -24(r1); \ | ||
255 | std r7, -32(r1); \ | ||
256 | stdu r8, -40(r1); \ | ||
257 | \ | ||
258 | li r11, API_NUMBER; \ | ||
259 | lv1call; \ | ||
260 | \ | ||
261 | addi r1, r1, 40; \ | ||
262 | ld r11, -8(r1); \ | ||
263 | std r4, 0(r11); \ | ||
264 | ld r11, -16(r1); \ | ||
265 | std r5, 0(r11); \ | ||
266 | ld r11, -24(r1); \ | ||
267 | std r6, 0(r11); \ | ||
268 | ld r11, -32(r1); \ | ||
269 | std r7, 0(r11); \ | ||
270 | ld r11, -40(r1); \ | ||
271 | std r8, 0(r11); \ | ||
272 | \ | ||
273 | ld r0, 16(r1); \ | ||
274 | mtlr r0; \ | ||
275 | blr | ||
276 | |||
277 | #define LV1_1_IN_6_OUT(API_NAME, API_NUMBER) \ | ||
278 | _GLOBAL(_##API_NAME) \ | ||
279 | \ | ||
280 | mflr r0; \ | ||
281 | std r0, 16(r1); \ | ||
282 | \ | ||
283 | std r4, -8(r1); \ | ||
284 | std r5, -16(r1); \ | ||
285 | std r6, -24(r1); \ | ||
286 | std r7, -32(r1); \ | ||
287 | std r8, -40(r1); \ | ||
288 | stdu r9, -48(r1); \ | ||
289 | \ | ||
290 | li r11, API_NUMBER; \ | ||
291 | lv1call; \ | ||
292 | \ | ||
293 | addi r1, r1, 48; \ | ||
294 | ld r11, -8(r1); \ | ||
295 | std r4, 0(r11); \ | ||
296 | ld r11, -16(r1); \ | ||
297 | std r5, 0(r11); \ | ||
298 | ld r11, -24(r1); \ | ||
299 | std r6, 0(r11); \ | ||
300 | ld r11, -32(r1); \ | ||
301 | std r7, 0(r11); \ | ||
302 | ld r11, -40(r1); \ | ||
303 | std r8, 0(r11); \ | ||
304 | ld r11, -48(r1); \ | ||
305 | std r9, 0(r11); \ | ||
306 | \ | ||
307 | ld r0, 16(r1); \ | ||
308 | mtlr r0; \ | ||
309 | blr | ||
310 | |||
311 | #define LV1_1_IN_7_OUT(API_NAME, API_NUMBER) \ | ||
312 | _GLOBAL(_##API_NAME) \ | ||
313 | \ | ||
314 | mflr r0; \ | ||
315 | std r0, 16(r1); \ | ||
316 | \ | ||
317 | std r4, -8(r1); \ | ||
318 | std r5, -16(r1); \ | ||
319 | std r6, -24(r1); \ | ||
320 | std r7, -32(r1); \ | ||
321 | std r8, -40(r1); \ | ||
322 | std r9, -48(r1); \ | ||
323 | stdu r10, -56(r1); \ | ||
324 | \ | ||
325 | li r11, API_NUMBER; \ | ||
326 | lv1call; \ | ||
327 | \ | ||
328 | addi r1, r1, 56; \ | ||
329 | ld r11, -8(r1); \ | ||
330 | std r4, 0(r11); \ | ||
331 | ld r11, -16(r1); \ | ||
332 | std r5, 0(r11); \ | ||
333 | ld r11, -24(r1); \ | ||
334 | std r6, 0(r11); \ | ||
335 | ld r11, -32(r1); \ | ||
336 | std r7, 0(r11); \ | ||
337 | ld r11, -40(r1); \ | ||
338 | std r8, 0(r11); \ | ||
339 | ld r11, -48(r1); \ | ||
340 | std r9, 0(r11); \ | ||
341 | ld r11, -56(r1); \ | ||
342 | std r10, 0(r11); \ | ||
343 | \ | ||
344 | ld r0, 16(r1); \ | ||
345 | mtlr r0; \ | ||
346 | blr | ||
347 | |||
348 | #define LV1_2_IN_1_OUT(API_NAME, API_NUMBER) \ | ||
349 | _GLOBAL(_##API_NAME) \ | ||
350 | \ | ||
351 | mflr r0; \ | ||
352 | std r0, 16(r1); \ | ||
353 | \ | ||
354 | stdu r5, -8(r1); \ | ||
355 | \ | ||
356 | li r11, API_NUMBER; \ | ||
357 | lv1call; \ | ||
358 | \ | ||
359 | addi r1, r1, 8; \ | ||
360 | ld r11, -8(r1); \ | ||
361 | std r4, 0(r11); \ | ||
362 | \ | ||
363 | ld r0, 16(r1); \ | ||
364 | mtlr r0; \ | ||
365 | blr | ||
366 | |||
367 | #define LV1_2_IN_2_OUT(API_NAME, API_NUMBER) \ | ||
368 | _GLOBAL(_##API_NAME) \ | ||
369 | \ | ||
370 | mflr r0; \ | ||
371 | std r0, 16(r1); \ | ||
372 | \ | ||
373 | std r5, -8(r1); \ | ||
374 | stdu r6, -16(r1); \ | ||
375 | \ | ||
376 | li r11, API_NUMBER; \ | ||
377 | lv1call; \ | ||
378 | \ | ||
379 | addi r1, r1, 16; \ | ||
380 | ld r11, -8(r1); \ | ||
381 | std r4, 0(r11); \ | ||
382 | ld r11, -16(r1); \ | ||
383 | std r5, 0(r11); \ | ||
384 | \ | ||
385 | ld r0, 16(r1); \ | ||
386 | mtlr r0; \ | ||
387 | blr | ||
388 | |||
389 | #define LV1_2_IN_3_OUT(API_NAME, API_NUMBER) \ | ||
390 | _GLOBAL(_##API_NAME) \ | ||
391 | \ | ||
392 | mflr r0; \ | ||
393 | std r0, 16(r1); \ | ||
394 | \ | ||
395 | std r5, -8(r1); \ | ||
396 | std r6, -16(r1); \ | ||
397 | stdu r7, -24(r1); \ | ||
398 | \ | ||
399 | li r11, API_NUMBER; \ | ||
400 | lv1call; \ | ||
401 | \ | ||
402 | addi r1, r1, 24; \ | ||
403 | ld r11, -8(r1); \ | ||
404 | std r4, 0(r11); \ | ||
405 | ld r11, -16(r1); \ | ||
406 | std r5, 0(r11); \ | ||
407 | ld r11, -24(r1); \ | ||
408 | std r6, 0(r11); \ | ||
409 | \ | ||
410 | ld r0, 16(r1); \ | ||
411 | mtlr r0; \ | ||
412 | blr | ||
413 | |||
414 | #define LV1_2_IN_4_OUT(API_NAME, API_NUMBER) \ | ||
415 | _GLOBAL(_##API_NAME) \ | ||
416 | \ | ||
417 | mflr r0; \ | ||
418 | std r0, 16(r1); \ | ||
419 | \ | ||
420 | std r5, -8(r1); \ | ||
421 | std r6, -16(r1); \ | ||
422 | std r7, -24(r1); \ | ||
423 | stdu r8, -32(r1); \ | ||
424 | \ | ||
425 | li r11, API_NUMBER; \ | ||
426 | lv1call; \ | ||
427 | \ | ||
428 | addi r1, r1, 32; \ | ||
429 | ld r11, -8(r1); \ | ||
430 | std r4, 0(r11); \ | ||
431 | ld r11, -16(r1); \ | ||
432 | std r5, 0(r11); \ | ||
433 | ld r11, -24(r1); \ | ||
434 | std r6, 0(r11); \ | ||
435 | ld r11, -32(r1); \ | ||
436 | std r7, 0(r11); \ | ||
437 | \ | ||
438 | ld r0, 16(r1); \ | ||
439 | mtlr r0; \ | ||
440 | blr | ||
441 | |||
442 | #define LV1_2_IN_5_OUT(API_NAME, API_NUMBER) \ | ||
443 | _GLOBAL(_##API_NAME) \ | ||
444 | \ | ||
445 | mflr r0; \ | ||
446 | std r0, 16(r1); \ | ||
447 | \ | ||
448 | std r5, -8(r1); \ | ||
449 | std r6, -16(r1); \ | ||
450 | std r7, -24(r1); \ | ||
451 | std r8, -32(r1); \ | ||
452 | stdu r9, -40(r1); \ | ||
453 | \ | ||
454 | li r11, API_NUMBER; \ | ||
455 | lv1call; \ | ||
456 | \ | ||
457 | addi r1, r1, 40; \ | ||
458 | ld r11, -8(r1); \ | ||
459 | std r4, 0(r11); \ | ||
460 | ld r11, -16(r1); \ | ||
461 | std r5, 0(r11); \ | ||
462 | ld r11, -24(r1); \ | ||
463 | std r6, 0(r11); \ | ||
464 | ld r11, -32(r1); \ | ||
465 | std r7, 0(r11); \ | ||
466 | ld r11, -40(r1); \ | ||
467 | std r8, 0(r11); \ | ||
468 | \ | ||
469 | ld r0, 16(r1); \ | ||
470 | mtlr r0; \ | ||
471 | blr | ||
472 | |||
473 | #define LV1_3_IN_1_OUT(API_NAME, API_NUMBER) \ | ||
474 | _GLOBAL(_##API_NAME) \ | ||
475 | \ | ||
476 | mflr r0; \ | ||
477 | std r0, 16(r1); \ | ||
478 | \ | ||
479 | stdu r6, -8(r1); \ | ||
480 | \ | ||
481 | li r11, API_NUMBER; \ | ||
482 | lv1call; \ | ||
483 | \ | ||
484 | addi r1, r1, 8; \ | ||
485 | ld r11, -8(r1); \ | ||
486 | std r4, 0(r11); \ | ||
487 | \ | ||
488 | ld r0, 16(r1); \ | ||
489 | mtlr r0; \ | ||
490 | blr | ||
491 | |||
492 | #define LV1_3_IN_2_OUT(API_NAME, API_NUMBER) \ | ||
493 | _GLOBAL(_##API_NAME) \ | ||
494 | \ | ||
495 | mflr r0; \ | ||
496 | std r0, 16(r1); \ | ||
497 | \ | ||
498 | std r6, -8(r1); \ | ||
499 | stdu r7, -16(r1); \ | ||
500 | \ | ||
501 | li r11, API_NUMBER; \ | ||
502 | lv1call; \ | ||
503 | \ | ||
504 | addi r1, r1, 16; \ | ||
505 | ld r11, -8(r1); \ | ||
506 | std r4, 0(r11); \ | ||
507 | ld r11, -16(r1); \ | ||
508 | std r5, 0(r11); \ | ||
509 | \ | ||
510 | ld r0, 16(r1); \ | ||
511 | mtlr r0; \ | ||
512 | blr | ||
513 | |||
514 | #define LV1_3_IN_3_OUT(API_NAME, API_NUMBER) \ | ||
515 | _GLOBAL(_##API_NAME) \ | ||
516 | \ | ||
517 | mflr r0; \ | ||
518 | std r0, 16(r1); \ | ||
519 | \ | ||
520 | std r6, -8(r1); \ | ||
521 | std r7, -16(r1); \ | ||
522 | stdu r8, -24(r1); \ | ||
523 | \ | ||
524 | li r11, API_NUMBER; \ | ||
525 | lv1call; \ | ||
526 | \ | ||
527 | addi r1, r1, 24; \ | ||
528 | ld r11, -8(r1); \ | ||
529 | std r4, 0(r11); \ | ||
530 | ld r11, -16(r1); \ | ||
531 | std r5, 0(r11); \ | ||
532 | ld r11, -24(r1); \ | ||
533 | std r6, 0(r11); \ | ||
534 | \ | ||
535 | ld r0, 16(r1); \ | ||
536 | mtlr r0; \ | ||
537 | blr | ||
538 | |||
539 | #define LV1_4_IN_1_OUT(API_NAME, API_NUMBER) \ | ||
540 | _GLOBAL(_##API_NAME) \ | ||
541 | \ | ||
542 | mflr r0; \ | ||
543 | std r0, 16(r1); \ | ||
544 | \ | ||
545 | stdu r7, -8(r1); \ | ||
546 | \ | ||
547 | li r11, API_NUMBER; \ | ||
548 | lv1call; \ | ||
549 | \ | ||
550 | addi r1, r1, 8; \ | ||
551 | ld r11, -8(r1); \ | ||
552 | std r4, 0(r11); \ | ||
553 | \ | ||
554 | ld r0, 16(r1); \ | ||
555 | mtlr r0; \ | ||
556 | blr | ||
557 | |||
558 | #define LV1_4_IN_2_OUT(API_NAME, API_NUMBER) \ | ||
559 | _GLOBAL(_##API_NAME) \ | ||
560 | \ | ||
561 | mflr r0; \ | ||
562 | std r0, 16(r1); \ | ||
563 | \ | ||
564 | std r7, -8(r1); \ | ||
565 | stdu r8, -16(r1); \ | ||
566 | \ | ||
567 | li r11, API_NUMBER; \ | ||
568 | lv1call; \ | ||
569 | \ | ||
570 | addi r1, r1, 16; \ | ||
571 | ld r11, -8(r1); \ | ||
572 | std r4, 0(r11); \ | ||
573 | ld r11, -16(r1); \ | ||
574 | std r5, 0(r11); \ | ||
575 | \ | ||
576 | ld r0, 16(r1); \ | ||
577 | mtlr r0; \ | ||
578 | blr | ||
579 | |||
580 | #define LV1_4_IN_3_OUT(API_NAME, API_NUMBER) \ | ||
581 | _GLOBAL(_##API_NAME) \ | ||
582 | \ | ||
583 | mflr r0; \ | ||
584 | std r0, 16(r1); \ | ||
585 | \ | ||
586 | std r7, -8(r1); \ | ||
587 | std r8, -16(r1); \ | ||
588 | stdu r9, -24(r1); \ | ||
589 | \ | ||
590 | li r11, API_NUMBER; \ | ||
591 | lv1call; \ | ||
592 | \ | ||
593 | addi r1, r1, 24; \ | ||
594 | ld r11, -8(r1); \ | ||
595 | std r4, 0(r11); \ | ||
596 | ld r11, -16(r1); \ | ||
597 | std r5, 0(r11); \ | ||
598 | ld r11, -24(r1); \ | ||
599 | std r6, 0(r11); \ | ||
600 | \ | ||
601 | ld r0, 16(r1); \ | ||
602 | mtlr r0; \ | ||
603 | blr | ||
604 | |||
605 | #define LV1_5_IN_1_OUT(API_NAME, API_NUMBER) \ | ||
606 | _GLOBAL(_##API_NAME) \ | ||
607 | \ | ||
608 | mflr r0; \ | ||
609 | std r0, 16(r1); \ | ||
610 | \ | ||
611 | stdu r8, -8(r1); \ | ||
612 | \ | ||
613 | li r11, API_NUMBER; \ | ||
614 | lv1call; \ | ||
615 | \ | ||
616 | addi r1, r1, 8; \ | ||
617 | ld r11, -8(r1); \ | ||
618 | std r4, 0(r11); \ | ||
619 | \ | ||
620 | ld r0, 16(r1); \ | ||
621 | mtlr r0; \ | ||
622 | blr | ||
623 | |||
624 | #define LV1_5_IN_2_OUT(API_NAME, API_NUMBER) \ | ||
625 | _GLOBAL(_##API_NAME) \ | ||
626 | \ | ||
627 | mflr r0; \ | ||
628 | std r0, 16(r1); \ | ||
629 | \ | ||
630 | std r8, -8(r1); \ | ||
631 | stdu r9, -16(r1); \ | ||
632 | \ | ||
633 | li r11, API_NUMBER; \ | ||
634 | lv1call; \ | ||
635 | \ | ||
636 | addi r1, r1, 16; \ | ||
637 | ld r11, -8(r1); \ | ||
638 | std r4, 0(r11); \ | ||
639 | ld r11, -16(r1); \ | ||
640 | std r5, 0(r11); \ | ||
641 | \ | ||
642 | ld r0, 16(r1); \ | ||
643 | mtlr r0; \ | ||
644 | blr | ||
645 | |||
646 | #define LV1_5_IN_3_OUT(API_NAME, API_NUMBER) \ | ||
647 | _GLOBAL(_##API_NAME) \ | ||
648 | \ | ||
649 | mflr r0; \ | ||
650 | std r0, 16(r1); \ | ||
651 | \ | ||
652 | std r8, -8(r1); \ | ||
653 | std r9, -16(r1); \ | ||
654 | stdu r10, -24(r1); \ | ||
655 | \ | ||
656 | li r11, API_NUMBER; \ | ||
657 | lv1call; \ | ||
658 | \ | ||
659 | addi r1, r1, 24; \ | ||
660 | ld r11, -8(r1); \ | ||
661 | std r4, 0(r11); \ | ||
662 | ld r11, -16(r1); \ | ||
663 | std r5, 0(r11); \ | ||
664 | ld r11, -24(r1); \ | ||
665 | std r6, 0(r11); \ | ||
666 | \ | ||
667 | ld r0, 16(r1); \ | ||
668 | mtlr r0; \ | ||
669 | blr | ||
670 | |||
671 | #define LV1_6_IN_1_OUT(API_NAME, API_NUMBER) \ | ||
672 | _GLOBAL(_##API_NAME) \ | ||
673 | \ | ||
674 | mflr r0; \ | ||
675 | std r0, 16(r1); \ | ||
676 | \ | ||
677 | stdu r9, -8(r1); \ | ||
678 | \ | ||
679 | li r11, API_NUMBER; \ | ||
680 | lv1call; \ | ||
681 | \ | ||
682 | addi r1, r1, 8; \ | ||
683 | ld r11, -8(r1); \ | ||
684 | std r4, 0(r11); \ | ||
685 | \ | ||
686 | ld r0, 16(r1); \ | ||
687 | mtlr r0; \ | ||
688 | blr | ||
689 | |||
690 | #define LV1_6_IN_2_OUT(API_NAME, API_NUMBER) \ | ||
691 | _GLOBAL(_##API_NAME) \ | ||
692 | \ | ||
693 | mflr r0; \ | ||
694 | std r0, 16(r1); \ | ||
695 | \ | ||
696 | std r9, -8(r1); \ | ||
697 | stdu r10, -16(r1); \ | ||
698 | \ | ||
699 | li r11, API_NUMBER; \ | ||
700 | lv1call; \ | ||
701 | \ | ||
702 | addi r1, r1, 16; \ | ||
703 | ld r11, -8(r1); \ | ||
704 | std r4, 0(r11); \ | ||
705 | ld r11, -16(r1); \ | ||
706 | std r5, 0(r11); \ | ||
707 | \ | ||
708 | ld r0, 16(r1); \ | ||
709 | mtlr r0; \ | ||
710 | blr | ||
711 | |||
712 | #define LV1_6_IN_3_OUT(API_NAME, API_NUMBER) \ | ||
713 | _GLOBAL(_##API_NAME) \ | ||
714 | \ | ||
715 | mflr r0; \ | ||
716 | std r0, 16(r1); \ | ||
717 | \ | ||
718 | std r9, -8(r1); \ | ||
719 | stdu r10, -16(r1); \ | ||
720 | \ | ||
721 | li r11, API_NUMBER; \ | ||
722 | lv1call; \ | ||
723 | \ | ||
724 | addi r1, r1, 16; \ | ||
725 | ld r11, -8(r1); \ | ||
726 | std r4, 0(r11); \ | ||
727 | ld r11, -16(r1); \ | ||
728 | std r5, 0(r11); \ | ||
729 | ld r11, 48+8*8(r1); \ | ||
730 | std r6, 0(r11); \ | ||
731 | \ | ||
732 | ld r0, 16(r1); \ | ||
733 | mtlr r0; \ | ||
734 | blr | ||
735 | |||
736 | #define LV1_7_IN_1_OUT(API_NAME, API_NUMBER) \ | ||
737 | _GLOBAL(_##API_NAME) \ | ||
738 | \ | ||
739 | mflr r0; \ | ||
740 | std r0, 16(r1); \ | ||
741 | \ | ||
742 | stdu r10, -8(r1); \ | ||
743 | \ | ||
744 | li r11, API_NUMBER; \ | ||
745 | lv1call; \ | ||
746 | \ | ||
747 | addi r1, r1, 8; \ | ||
748 | ld r11, -8(r1); \ | ||
749 | std r4, 0(r11); \ | ||
750 | \ | ||
751 | ld r0, 16(r1); \ | ||
752 | mtlr r0; \ | ||
753 | blr | ||
754 | |||
755 | #define LV1_7_IN_6_OUT(API_NAME, API_NUMBER) \ | ||
756 | _GLOBAL(_##API_NAME) \ | ||
757 | \ | ||
758 | mflr r0; \ | ||
759 | std r0, 16(r1); \ | ||
760 | \ | ||
761 | std r10, 48+8*7(r1); \ | ||
762 | \ | ||
763 | li r11, API_NUMBER; \ | ||
764 | lv1call; \ | ||
765 | \ | ||
766 | ld r11, 48+8*7(r1); \ | ||
767 | std r4, 0(r11); \ | ||
768 | ld r11, 48+8*8(r1); \ | ||
769 | std r5, 0(r11); \ | ||
770 | ld r11, 48+8*9(r1); \ | ||
771 | std r6, 0(r11); \ | ||
772 | ld r11, 48+8*10(r1); \ | ||
773 | std r7, 0(r11); \ | ||
774 | ld r11, 48+8*11(r1); \ | ||
775 | std r8, 0(r11); \ | ||
776 | ld r11, 48+8*12(r1); \ | ||
777 | std r9, 0(r11); \ | ||
778 | \ | ||
779 | ld r0, 16(r1); \ | ||
780 | mtlr r0; \ | ||
781 | blr | ||
782 | |||
783 | #define LV1_8_IN_1_OUT(API_NAME, API_NUMBER) \ | ||
784 | _GLOBAL(_##API_NAME) \ | ||
785 | \ | ||
786 | mflr r0; \ | ||
787 | std r0, 16(r1); \ | ||
788 | \ | ||
789 | li r11, API_NUMBER; \ | ||
790 | lv1call; \ | ||
791 | \ | ||
792 | ld r11, 48+8*8(r1); \ | ||
793 | std r4, 0(r11); \ | ||
794 | \ | ||
795 | ld r0, 16(r1); \ | ||
796 | mtlr r0; \ | ||
797 | blr | ||
798 | |||
799 | .text | ||
800 | |||
801 | /* the lv1 underscored call definitions expand here */ | ||
802 | |||
803 | #define LV1_CALL(name, in, out, num) LV1_##in##_IN_##out##_OUT(lv1_##name, num) | ||
804 | #include <asm/lv1call.h> | ||
diff --git a/include/asm-powerpc/lv1call.h b/include/asm-powerpc/lv1call.h new file mode 100644 index 000000000000..f733beeea63a --- /dev/null +++ b/include/asm-powerpc/lv1call.h | |||
@@ -0,0 +1,345 @@ | |||
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 | |||
22 | #if !defined(_ASM_POWERPC_LV1CALL_H) | ||
23 | #define _ASM_POWERPC_LV1CALL_H | ||
24 | |||
25 | #if !defined(__ASSEMBLY__) | ||
26 | |||
27 | #include <linux/types.h> | ||
28 | |||
29 | /* lv1 call declaration macros */ | ||
30 | |||
31 | #define LV1_1_IN_ARG_DECL u64 in_1 | ||
32 | #define LV1_2_IN_ARG_DECL LV1_1_IN_ARG_DECL, u64 in_2 | ||
33 | #define LV1_3_IN_ARG_DECL LV1_2_IN_ARG_DECL, u64 in_3 | ||
34 | #define LV1_4_IN_ARG_DECL LV1_3_IN_ARG_DECL, u64 in_4 | ||
35 | #define LV1_5_IN_ARG_DECL LV1_4_IN_ARG_DECL, u64 in_5 | ||
36 | #define LV1_6_IN_ARG_DECL LV1_5_IN_ARG_DECL, u64 in_6 | ||
37 | #define LV1_7_IN_ARG_DECL LV1_6_IN_ARG_DECL, u64 in_7 | ||
38 | #define LV1_8_IN_ARG_DECL LV1_7_IN_ARG_DECL, u64 in_8 | ||
39 | #define LV1_1_OUT_ARG_DECL u64 *out_1 | ||
40 | #define LV1_2_OUT_ARG_DECL LV1_1_OUT_ARG_DECL, u64 *out_2 | ||
41 | #define LV1_3_OUT_ARG_DECL LV1_2_OUT_ARG_DECL, u64 *out_3 | ||
42 | #define LV1_4_OUT_ARG_DECL LV1_3_OUT_ARG_DECL, u64 *out_4 | ||
43 | #define LV1_5_OUT_ARG_DECL LV1_4_OUT_ARG_DECL, u64 *out_5 | ||
44 | #define LV1_6_OUT_ARG_DECL LV1_5_OUT_ARG_DECL, u64 *out_6 | ||
45 | #define LV1_7_OUT_ARG_DECL LV1_6_OUT_ARG_DECL, u64 *out_7 | ||
46 | |||
47 | #define LV1_0_IN_0_OUT_ARG_DECL void | ||
48 | #define LV1_1_IN_0_OUT_ARG_DECL LV1_1_IN_ARG_DECL | ||
49 | #define LV1_2_IN_0_OUT_ARG_DECL LV1_2_IN_ARG_DECL | ||
50 | #define LV1_3_IN_0_OUT_ARG_DECL LV1_3_IN_ARG_DECL | ||
51 | #define LV1_4_IN_0_OUT_ARG_DECL LV1_4_IN_ARG_DECL | ||
52 | #define LV1_5_IN_0_OUT_ARG_DECL LV1_5_IN_ARG_DECL | ||
53 | #define LV1_6_IN_0_OUT_ARG_DECL LV1_6_IN_ARG_DECL | ||
54 | #define LV1_7_IN_0_OUT_ARG_DECL LV1_7_IN_ARG_DECL | ||
55 | |||
56 | #define LV1_0_IN_1_OUT_ARG_DECL LV1_1_OUT_ARG_DECL | ||
57 | #define LV1_1_IN_1_OUT_ARG_DECL LV1_1_IN_ARG_DECL, LV1_1_OUT_ARG_DECL | ||
58 | #define LV1_2_IN_1_OUT_ARG_DECL LV1_2_IN_ARG_DECL, LV1_1_OUT_ARG_DECL | ||
59 | #define LV1_3_IN_1_OUT_ARG_DECL LV1_3_IN_ARG_DECL, LV1_1_OUT_ARG_DECL | ||
60 | #define LV1_4_IN_1_OUT_ARG_DECL LV1_4_IN_ARG_DECL, LV1_1_OUT_ARG_DECL | ||
61 | #define LV1_5_IN_1_OUT_ARG_DECL LV1_5_IN_ARG_DECL, LV1_1_OUT_ARG_DECL | ||
62 | #define LV1_6_IN_1_OUT_ARG_DECL LV1_6_IN_ARG_DECL, LV1_1_OUT_ARG_DECL | ||
63 | #define LV1_7_IN_1_OUT_ARG_DECL LV1_7_IN_ARG_DECL, LV1_1_OUT_ARG_DECL | ||
64 | #define LV1_8_IN_1_OUT_ARG_DECL LV1_8_IN_ARG_DECL, LV1_1_OUT_ARG_DECL | ||
65 | |||
66 | #define LV1_0_IN_2_OUT_ARG_DECL LV1_2_OUT_ARG_DECL | ||
67 | #define LV1_1_IN_2_OUT_ARG_DECL LV1_1_IN_ARG_DECL, LV1_2_OUT_ARG_DECL | ||
68 | #define LV1_2_IN_2_OUT_ARG_DECL LV1_2_IN_ARG_DECL, LV1_2_OUT_ARG_DECL | ||
69 | #define LV1_3_IN_2_OUT_ARG_DECL LV1_3_IN_ARG_DECL, LV1_2_OUT_ARG_DECL | ||
70 | #define LV1_4_IN_2_OUT_ARG_DECL LV1_4_IN_ARG_DECL, LV1_2_OUT_ARG_DECL | ||
71 | #define LV1_5_IN_2_OUT_ARG_DECL LV1_5_IN_ARG_DECL, LV1_2_OUT_ARG_DECL | ||
72 | #define LV1_6_IN_2_OUT_ARG_DECL LV1_6_IN_ARG_DECL, LV1_2_OUT_ARG_DECL | ||
73 | #define LV1_7_IN_2_OUT_ARG_DECL LV1_7_IN_ARG_DECL, LV1_2_OUT_ARG_DECL | ||
74 | |||
75 | #define LV1_0_IN_3_OUT_ARG_DECL LV1_3_OUT_ARG_DECL | ||
76 | #define LV1_1_IN_3_OUT_ARG_DECL LV1_1_IN_ARG_DECL, LV1_3_OUT_ARG_DECL | ||
77 | #define LV1_2_IN_3_OUT_ARG_DECL LV1_2_IN_ARG_DECL, LV1_3_OUT_ARG_DECL | ||
78 | #define LV1_3_IN_3_OUT_ARG_DECL LV1_3_IN_ARG_DECL, LV1_3_OUT_ARG_DECL | ||
79 | #define LV1_4_IN_3_OUT_ARG_DECL LV1_4_IN_ARG_DECL, LV1_3_OUT_ARG_DECL | ||
80 | #define LV1_5_IN_3_OUT_ARG_DECL LV1_5_IN_ARG_DECL, LV1_3_OUT_ARG_DECL | ||
81 | #define LV1_6_IN_3_OUT_ARG_DECL LV1_6_IN_ARG_DECL, LV1_3_OUT_ARG_DECL | ||
82 | #define LV1_7_IN_3_OUT_ARG_DECL LV1_7_IN_ARG_DECL, LV1_3_OUT_ARG_DECL | ||
83 | |||
84 | #define LV1_0_IN_4_OUT_ARG_DECL LV1_4_OUT_ARG_DECL | ||
85 | #define LV1_1_IN_4_OUT_ARG_DECL LV1_1_IN_ARG_DECL, LV1_4_OUT_ARG_DECL | ||
86 | #define LV1_2_IN_4_OUT_ARG_DECL LV1_2_IN_ARG_DECL, LV1_4_OUT_ARG_DECL | ||
87 | #define LV1_3_IN_4_OUT_ARG_DECL LV1_3_IN_ARG_DECL, LV1_4_OUT_ARG_DECL | ||
88 | #define LV1_4_IN_4_OUT_ARG_DECL LV1_4_IN_ARG_DECL, LV1_4_OUT_ARG_DECL | ||
89 | #define LV1_5_IN_4_OUT_ARG_DECL LV1_5_IN_ARG_DECL, LV1_4_OUT_ARG_DECL | ||
90 | #define LV1_6_IN_4_OUT_ARG_DECL LV1_6_IN_ARG_DECL, LV1_4_OUT_ARG_DECL | ||
91 | #define LV1_7_IN_4_OUT_ARG_DECL LV1_7_IN_ARG_DECL, LV1_4_OUT_ARG_DECL | ||
92 | |||
93 | #define LV1_0_IN_5_OUT_ARG_DECL LV1_5_OUT_ARG_DECL | ||
94 | #define LV1_1_IN_5_OUT_ARG_DECL LV1_1_IN_ARG_DECL, LV1_5_OUT_ARG_DECL | ||
95 | #define LV1_2_IN_5_OUT_ARG_DECL LV1_2_IN_ARG_DECL, LV1_5_OUT_ARG_DECL | ||
96 | #define LV1_3_IN_5_OUT_ARG_DECL LV1_3_IN_ARG_DECL, LV1_5_OUT_ARG_DECL | ||
97 | #define LV1_4_IN_5_OUT_ARG_DECL LV1_4_IN_ARG_DECL, LV1_5_OUT_ARG_DECL | ||
98 | #define LV1_5_IN_5_OUT_ARG_DECL LV1_5_IN_ARG_DECL, LV1_5_OUT_ARG_DECL | ||
99 | #define LV1_6_IN_5_OUT_ARG_DECL LV1_6_IN_ARG_DECL, LV1_5_OUT_ARG_DECL | ||
100 | #define LV1_7_IN_5_OUT_ARG_DECL LV1_7_IN_ARG_DECL, LV1_5_OUT_ARG_DECL | ||
101 | |||
102 | #define LV1_0_IN_6_OUT_ARG_DECL LV1_6_OUT_ARG_DECL | ||
103 | #define LV1_1_IN_6_OUT_ARG_DECL LV1_1_IN_ARG_DECL, LV1_6_OUT_ARG_DECL | ||
104 | #define LV1_2_IN_6_OUT_ARG_DECL LV1_2_IN_ARG_DECL, LV1_6_OUT_ARG_DECL | ||
105 | #define LV1_3_IN_6_OUT_ARG_DECL LV1_3_IN_ARG_DECL, LV1_6_OUT_ARG_DECL | ||
106 | #define LV1_4_IN_6_OUT_ARG_DECL LV1_4_IN_ARG_DECL, LV1_6_OUT_ARG_DECL | ||
107 | #define LV1_5_IN_6_OUT_ARG_DECL LV1_5_IN_ARG_DECL, LV1_6_OUT_ARG_DECL | ||
108 | #define LV1_6_IN_6_OUT_ARG_DECL LV1_6_IN_ARG_DECL, LV1_6_OUT_ARG_DECL | ||
109 | #define LV1_7_IN_6_OUT_ARG_DECL LV1_7_IN_ARG_DECL, LV1_6_OUT_ARG_DECL | ||
110 | |||
111 | #define LV1_0_IN_7_OUT_ARG_DECL LV1_7_OUT_ARG_DECL | ||
112 | #define LV1_1_IN_7_OUT_ARG_DECL LV1_1_IN_ARG_DECL, LV1_7_OUT_ARG_DECL | ||
113 | #define LV1_2_IN_7_OUT_ARG_DECL LV1_2_IN_ARG_DECL, LV1_7_OUT_ARG_DECL | ||
114 | #define LV1_3_IN_7_OUT_ARG_DECL LV1_3_IN_ARG_DECL, LV1_7_OUT_ARG_DECL | ||
115 | #define LV1_4_IN_7_OUT_ARG_DECL LV1_4_IN_ARG_DECL, LV1_7_OUT_ARG_DECL | ||
116 | #define LV1_5_IN_7_OUT_ARG_DECL LV1_5_IN_ARG_DECL, LV1_7_OUT_ARG_DECL | ||
117 | #define LV1_6_IN_7_OUT_ARG_DECL LV1_6_IN_ARG_DECL, LV1_7_OUT_ARG_DECL | ||
118 | #define LV1_7_IN_7_OUT_ARG_DECL LV1_7_IN_ARG_DECL, LV1_7_OUT_ARG_DECL | ||
119 | |||
120 | #define LV1_1_IN_ARGS in_1 | ||
121 | #define LV1_2_IN_ARGS LV1_1_IN_ARGS, in_2 | ||
122 | #define LV1_3_IN_ARGS LV1_2_IN_ARGS, in_3 | ||
123 | #define LV1_4_IN_ARGS LV1_3_IN_ARGS, in_4 | ||
124 | #define LV1_5_IN_ARGS LV1_4_IN_ARGS, in_5 | ||
125 | #define LV1_6_IN_ARGS LV1_5_IN_ARGS, in_6 | ||
126 | #define LV1_7_IN_ARGS LV1_6_IN_ARGS, in_7 | ||
127 | #define LV1_8_IN_ARGS LV1_7_IN_ARGS, in_8 | ||
128 | |||
129 | #define LV1_1_OUT_ARGS out_1 | ||
130 | #define LV1_2_OUT_ARGS LV1_1_OUT_ARGS, out_2 | ||
131 | #define LV1_3_OUT_ARGS LV1_2_OUT_ARGS, out_3 | ||
132 | #define LV1_4_OUT_ARGS LV1_3_OUT_ARGS, out_4 | ||
133 | #define LV1_5_OUT_ARGS LV1_4_OUT_ARGS, out_5 | ||
134 | #define LV1_6_OUT_ARGS LV1_5_OUT_ARGS, out_6 | ||
135 | #define LV1_7_OUT_ARGS LV1_6_OUT_ARGS, out_7 | ||
136 | |||
137 | #define LV1_0_IN_0_OUT_ARGS | ||
138 | #define LV1_1_IN_0_OUT_ARGS LV1_1_IN_ARGS | ||
139 | #define LV1_2_IN_0_OUT_ARGS LV1_2_IN_ARGS | ||
140 | #define LV1_3_IN_0_OUT_ARGS LV1_3_IN_ARGS | ||
141 | #define LV1_4_IN_0_OUT_ARGS LV1_4_IN_ARGS | ||
142 | #define LV1_5_IN_0_OUT_ARGS LV1_5_IN_ARGS | ||
143 | #define LV1_6_IN_0_OUT_ARGS LV1_6_IN_ARGS | ||
144 | #define LV1_7_IN_0_OUT_ARGS LV1_7_IN_ARGS | ||
145 | |||
146 | #define LV1_0_IN_1_OUT_ARGS LV1_1_OUT_ARGS | ||
147 | #define LV1_1_IN_1_OUT_ARGS LV1_1_IN_ARGS, LV1_1_OUT_ARGS | ||
148 | #define LV1_2_IN_1_OUT_ARGS LV1_2_IN_ARGS, LV1_1_OUT_ARGS | ||
149 | #define LV1_3_IN_1_OUT_ARGS LV1_3_IN_ARGS, LV1_1_OUT_ARGS | ||
150 | #define LV1_4_IN_1_OUT_ARGS LV1_4_IN_ARGS, LV1_1_OUT_ARGS | ||
151 | #define LV1_5_IN_1_OUT_ARGS LV1_5_IN_ARGS, LV1_1_OUT_ARGS | ||
152 | #define LV1_6_IN_1_OUT_ARGS LV1_6_IN_ARGS, LV1_1_OUT_ARGS | ||
153 | #define LV1_7_IN_1_OUT_ARGS LV1_7_IN_ARGS, LV1_1_OUT_ARGS | ||
154 | #define LV1_8_IN_1_OUT_ARGS LV1_8_IN_ARGS, LV1_1_OUT_ARGS | ||
155 | |||
156 | #define LV1_0_IN_2_OUT_ARGS LV1_2_OUT_ARGS | ||
157 | #define LV1_1_IN_2_OUT_ARGS LV1_1_IN_ARGS, LV1_2_OUT_ARGS | ||
158 | #define LV1_2_IN_2_OUT_ARGS LV1_2_IN_ARGS, LV1_2_OUT_ARGS | ||
159 | #define LV1_3_IN_2_OUT_ARGS LV1_3_IN_ARGS, LV1_2_OUT_ARGS | ||
160 | #define LV1_4_IN_2_OUT_ARGS LV1_4_IN_ARGS, LV1_2_OUT_ARGS | ||
161 | #define LV1_5_IN_2_OUT_ARGS LV1_5_IN_ARGS, LV1_2_OUT_ARGS | ||
162 | #define LV1_6_IN_2_OUT_ARGS LV1_6_IN_ARGS, LV1_2_OUT_ARGS | ||
163 | #define LV1_7_IN_2_OUT_ARGS LV1_7_IN_ARGS, LV1_2_OUT_ARGS | ||
164 | |||
165 | #define LV1_0_IN_3_OUT_ARGS LV1_3_OUT_ARGS | ||
166 | #define LV1_1_IN_3_OUT_ARGS LV1_1_IN_ARGS, LV1_3_OUT_ARGS | ||
167 | #define LV1_2_IN_3_OUT_ARGS LV1_2_IN_ARGS, LV1_3_OUT_ARGS | ||
168 | #define LV1_3_IN_3_OUT_ARGS LV1_3_IN_ARGS, LV1_3_OUT_ARGS | ||
169 | #define LV1_4_IN_3_OUT_ARGS LV1_4_IN_ARGS, LV1_3_OUT_ARGS | ||
170 | #define LV1_5_IN_3_OUT_ARGS LV1_5_IN_ARGS, LV1_3_OUT_ARGS | ||
171 | #define LV1_6_IN_3_OUT_ARGS LV1_6_IN_ARGS, LV1_3_OUT_ARGS | ||
172 | #define LV1_7_IN_3_OUT_ARGS LV1_7_IN_ARGS, LV1_3_OUT_ARGS | ||
173 | |||
174 | #define LV1_0_IN_4_OUT_ARGS LV1_4_OUT_ARGS | ||
175 | #define LV1_1_IN_4_OUT_ARGS LV1_1_IN_ARGS, LV1_4_OUT_ARGS | ||
176 | #define LV1_2_IN_4_OUT_ARGS LV1_2_IN_ARGS, LV1_4_OUT_ARGS | ||
177 | #define LV1_3_IN_4_OUT_ARGS LV1_3_IN_ARGS, LV1_4_OUT_ARGS | ||
178 | #define LV1_4_IN_4_OUT_ARGS LV1_4_IN_ARGS, LV1_4_OUT_ARGS | ||
179 | #define LV1_5_IN_4_OUT_ARGS LV1_5_IN_ARGS, LV1_4_OUT_ARGS | ||
180 | #define LV1_6_IN_4_OUT_ARGS LV1_6_IN_ARGS, LV1_4_OUT_ARGS | ||
181 | #define LV1_7_IN_4_OUT_ARGS LV1_7_IN_ARGS, LV1_4_OUT_ARGS | ||
182 | |||
183 | #define LV1_0_IN_5_OUT_ARGS LV1_5_OUT_ARGS | ||
184 | #define LV1_1_IN_5_OUT_ARGS LV1_1_IN_ARGS, LV1_5_OUT_ARGS | ||
185 | #define LV1_2_IN_5_OUT_ARGS LV1_2_IN_ARGS, LV1_5_OUT_ARGS | ||
186 | #define LV1_3_IN_5_OUT_ARGS LV1_3_IN_ARGS, LV1_5_OUT_ARGS | ||
187 | #define LV1_4_IN_5_OUT_ARGS LV1_4_IN_ARGS, LV1_5_OUT_ARGS | ||
188 | #define LV1_5_IN_5_OUT_ARGS LV1_5_IN_ARGS, LV1_5_OUT_ARGS | ||
189 | #define LV1_6_IN_5_OUT_ARGS LV1_6_IN_ARGS, LV1_5_OUT_ARGS | ||
190 | #define LV1_7_IN_5_OUT_ARGS LV1_7_IN_ARGS, LV1_5_OUT_ARGS | ||
191 | |||
192 | #define LV1_0_IN_6_OUT_ARGS LV1_6_OUT_ARGS | ||
193 | #define LV1_1_IN_6_OUT_ARGS LV1_1_IN_ARGS, LV1_6_OUT_ARGS | ||
194 | #define LV1_2_IN_6_OUT_ARGS LV1_2_IN_ARGS, LV1_6_OUT_ARGS | ||
195 | #define LV1_3_IN_6_OUT_ARGS LV1_3_IN_ARGS, LV1_6_OUT_ARGS | ||
196 | #define LV1_4_IN_6_OUT_ARGS LV1_4_IN_ARGS, LV1_6_OUT_ARGS | ||
197 | #define LV1_5_IN_6_OUT_ARGS LV1_5_IN_ARGS, LV1_6_OUT_ARGS | ||
198 | #define LV1_6_IN_6_OUT_ARGS LV1_6_IN_ARGS, LV1_6_OUT_ARGS | ||
199 | #define LV1_7_IN_6_OUT_ARGS LV1_7_IN_ARGS, LV1_6_OUT_ARGS | ||
200 | |||
201 | #define LV1_0_IN_7_OUT_ARGS LV1_7_OUT_ARGS | ||
202 | #define LV1_1_IN_7_OUT_ARGS LV1_1_IN_ARGS, LV1_7_OUT_ARGS | ||
203 | #define LV1_2_IN_7_OUT_ARGS LV1_2_IN_ARGS, LV1_7_OUT_ARGS | ||
204 | #define LV1_3_IN_7_OUT_ARGS LV1_3_IN_ARGS, LV1_7_OUT_ARGS | ||
205 | #define LV1_4_IN_7_OUT_ARGS LV1_4_IN_ARGS, LV1_7_OUT_ARGS | ||
206 | #define LV1_5_IN_7_OUT_ARGS LV1_5_IN_ARGS, LV1_7_OUT_ARGS | ||
207 | #define LV1_6_IN_7_OUT_ARGS LV1_6_IN_ARGS, LV1_7_OUT_ARGS | ||
208 | #define LV1_7_IN_7_OUT_ARGS LV1_7_IN_ARGS, LV1_7_OUT_ARGS | ||
209 | |||
210 | /* | ||
211 | * This LV1_CALL() macro is for use by callers. It expands into an | ||
212 | * inline call wrapper and an underscored HV call declaration. The | ||
213 | * wrapper can be used to instrument the lv1 call interface. The | ||
214 | * file lv1call.S defines its own LV1_CALL() macro to expand into | ||
215 | * the actual underscored call definition. | ||
216 | */ | ||
217 | |||
218 | #if !defined(LV1_CALL) | ||
219 | #define LV1_CALL(name, in, out, num) \ | ||
220 | extern s64 _lv1_##name(LV1_##in##_IN_##out##_OUT_ARG_DECL); \ | ||
221 | static inline int lv1_##name(LV1_##in##_IN_##out##_OUT_ARG_DECL) \ | ||
222 | {return _lv1_##name(LV1_##in##_IN_##out##_OUT_ARGS);} | ||
223 | #endif | ||
224 | |||
225 | #endif /* !defined(__ASSEMBLY__) */ | ||
226 | |||
227 | /* lv1 call table */ | ||
228 | |||
229 | LV1_CALL(allocate_memory, 4, 2, 0 ) | ||
230 | LV1_CALL(write_htab_entry, 4, 0, 1 ) | ||
231 | LV1_CALL(construct_virtual_address_space, 3, 2, 2 ) | ||
232 | LV1_CALL(invalidate_htab_entries, 5, 0, 3 ) | ||
233 | LV1_CALL(get_virtual_address_space_id_of_ppe, 1, 1, 4 ) | ||
234 | LV1_CALL(query_logical_partition_address_region_info, 1, 5, 6 ) | ||
235 | LV1_CALL(select_virtual_address_space, 1, 0, 7 ) | ||
236 | LV1_CALL(pause, 1, 0, 9 ) | ||
237 | LV1_CALL(destruct_virtual_address_space, 1, 0, 10 ) | ||
238 | LV1_CALL(configure_irq_state_bitmap, 3, 0, 11 ) | ||
239 | LV1_CALL(connect_irq_plug_ext, 5, 0, 12 ) | ||
240 | LV1_CALL(release_memory, 1, 0, 13 ) | ||
241 | LV1_CALL(disconnect_irq_plug_ext, 3, 0, 17 ) | ||
242 | LV1_CALL(construct_event_receive_port, 0, 1, 18 ) | ||
243 | LV1_CALL(destruct_event_receive_port, 1, 0, 19 ) | ||
244 | LV1_CALL(send_event_locally, 1, 0, 24 ) | ||
245 | LV1_CALL(end_of_interrupt, 1, 0, 27 ) | ||
246 | LV1_CALL(connect_irq_plug, 2, 0, 28 ) | ||
247 | LV1_CALL(disconnect_irq_plug, 1, 0, 29 ) | ||
248 | LV1_CALL(end_of_interrupt_ext, 3, 0, 30 ) | ||
249 | LV1_CALL(did_update_interrupt_mask, 2, 0, 31 ) | ||
250 | LV1_CALL(shutdown_logical_partition, 1, 0, 44 ) | ||
251 | LV1_CALL(destruct_logical_spe, 1, 0, 54 ) | ||
252 | LV1_CALL(construct_logical_spe, 7, 6, 57 ) | ||
253 | LV1_CALL(set_spe_interrupt_mask, 3, 0, 61 ) | ||
254 | LV1_CALL(set_spe_transition_notifier, 3, 0, 64 ) | ||
255 | LV1_CALL(disable_logical_spe, 2, 0, 65 ) | ||
256 | LV1_CALL(clear_spe_interrupt_status, 4, 0, 66 ) | ||
257 | LV1_CALL(get_spe_interrupt_status, 2, 1, 67 ) | ||
258 | LV1_CALL(get_logical_ppe_id, 0, 1, 69 ) | ||
259 | LV1_CALL(set_interrupt_mask, 5, 0, 73 ) | ||
260 | LV1_CALL(get_logical_partition_id, 0, 1, 74 ) | ||
261 | LV1_CALL(configure_execution_time_variable, 1, 0, 77 ) | ||
262 | LV1_CALL(get_spe_irq_outlet, 2, 1, 78 ) | ||
263 | LV1_CALL(set_spe_privilege_state_area_1_register, 3, 0, 79 ) | ||
264 | LV1_CALL(create_repository_node, 6, 0, 90 ) | ||
265 | LV1_CALL(get_repository_node_value, 5, 2, 91 ) | ||
266 | LV1_CALL(modify_repository_node_value, 6, 0, 92 ) | ||
267 | LV1_CALL(remove_repository_node, 4, 0, 93 ) | ||
268 | LV1_CALL(read_htab_entries, 2, 5, 95 ) | ||
269 | LV1_CALL(set_dabr, 2, 0, 96 ) | ||
270 | LV1_CALL(get_total_execution_time, 2, 1, 103 ) | ||
271 | LV1_CALL(construct_io_irq_outlet, 1, 1, 120 ) | ||
272 | LV1_CALL(destruct_io_irq_outlet, 1, 0, 121 ) | ||
273 | LV1_CALL(map_htab, 1, 1, 122 ) | ||
274 | LV1_CALL(unmap_htab, 1, 0, 123 ) | ||
275 | LV1_CALL(get_version_info, 0, 1, 127 ) | ||
276 | LV1_CALL(insert_htab_entry, 6, 3, 158 ) | ||
277 | LV1_CALL(read_virtual_uart, 3, 1, 162 ) | ||
278 | LV1_CALL(write_virtual_uart, 3, 1, 163 ) | ||
279 | LV1_CALL(set_virtual_uart_param, 3, 0, 164 ) | ||
280 | LV1_CALL(get_virtual_uart_param, 2, 1, 165 ) | ||
281 | LV1_CALL(configure_virtual_uart_irq, 1, 1, 166 ) | ||
282 | LV1_CALL(open_device, 3, 0, 170 ) | ||
283 | LV1_CALL(close_device, 2, 0, 171 ) | ||
284 | LV1_CALL(map_device_mmio_region, 5, 1, 172 ) | ||
285 | LV1_CALL(unmap_device_mmio_region, 3, 0, 173 ) | ||
286 | LV1_CALL(allocate_device_dma_region, 5, 1, 174 ) | ||
287 | LV1_CALL(free_device_dma_region, 3, 0, 175 ) | ||
288 | LV1_CALL(map_device_dma_region, 6, 0, 176 ) | ||
289 | LV1_CALL(unmap_device_dma_region, 4, 0, 177 ) | ||
290 | LV1_CALL(net_add_multicast_address, 4, 0, 185 ) | ||
291 | LV1_CALL(net_remove_multicast_address, 4, 0, 186 ) | ||
292 | LV1_CALL(net_start_tx_dma, 4, 0, 187 ) | ||
293 | LV1_CALL(net_stop_tx_dma, 3, 0, 188 ) | ||
294 | LV1_CALL(net_start_rx_dma, 4, 0, 189 ) | ||
295 | LV1_CALL(net_stop_rx_dma, 3, 0, 190 ) | ||
296 | LV1_CALL(net_set_interrupt_status_indicator, 4, 0, 191 ) | ||
297 | LV1_CALL(net_set_interrupt_mask, 4, 0, 193 ) | ||
298 | LV1_CALL(net_control, 6, 2, 194 ) | ||
299 | LV1_CALL(connect_interrupt_event_receive_port, 4, 0, 197 ) | ||
300 | LV1_CALL(disconnect_interrupt_event_receive_port, 4, 0, 198 ) | ||
301 | LV1_CALL(get_spe_all_interrupt_statuses, 1, 1, 199 ) | ||
302 | LV1_CALL(deconfigure_virtual_uart_irq, 0, 0, 202 ) | ||
303 | LV1_CALL(enable_logical_spe, 2, 0, 207 ) | ||
304 | LV1_CALL(gpu_open, 1, 0, 210 ) | ||
305 | LV1_CALL(gpu_close, 0, 0, 211 ) | ||
306 | LV1_CALL(gpu_device_map, 1, 2, 212 ) | ||
307 | LV1_CALL(gpu_device_unmap, 1, 0, 213 ) | ||
308 | LV1_CALL(gpu_memory_allocate, 5, 2, 214 ) | ||
309 | LV1_CALL(gpu_memory_free, 1, 0, 216 ) | ||
310 | LV1_CALL(gpu_context_allocate, 2, 5, 217 ) | ||
311 | LV1_CALL(gpu_context_free, 1, 0, 218 ) | ||
312 | LV1_CALL(gpu_context_iomap, 5, 0, 221 ) | ||
313 | LV1_CALL(gpu_context_attribute, 6, 0, 225 ) | ||
314 | LV1_CALL(gpu_context_intr, 1, 1, 227 ) | ||
315 | LV1_CALL(gpu_attribute, 5, 0, 228 ) | ||
316 | LV1_CALL(get_rtc, 0, 2, 232 ) | ||
317 | LV1_CALL(set_ppe_periodic_tracer_frequency, 1, 0, 240 ) | ||
318 | LV1_CALL(start_ppe_periodic_tracer, 5, 0, 241 ) | ||
319 | LV1_CALL(stop_ppe_periodic_tracer, 1, 1, 242 ) | ||
320 | LV1_CALL(storage_read, 6, 1, 245 ) | ||
321 | LV1_CALL(storage_write, 6, 1, 246 ) | ||
322 | LV1_CALL(storage_send_device_command, 6, 1, 248 ) | ||
323 | LV1_CALL(storage_get_async_status, 1, 2, 249 ) | ||
324 | LV1_CALL(storage_check_async_status, 2, 1, 254 ) | ||
325 | LV1_CALL(panic, 1, 0, 255 ) | ||
326 | LV1_CALL(construct_lpm, 6, 3, 140 ) | ||
327 | LV1_CALL(destruct_lpm, 1, 0, 141 ) | ||
328 | LV1_CALL(start_lpm, 1, 0, 142 ) | ||
329 | LV1_CALL(stop_lpm, 1, 1, 143 ) | ||
330 | LV1_CALL(copy_lpm_trace_buffer, 3, 1, 144 ) | ||
331 | LV1_CALL(add_lpm_event_bookmark, 5, 0, 145 ) | ||
332 | LV1_CALL(delete_lpm_event_bookmark, 3, 0, 146 ) | ||
333 | LV1_CALL(set_lpm_interrupt_mask, 3, 1, 147 ) | ||
334 | LV1_CALL(get_lpm_interrupt_status, 1, 1, 148 ) | ||
335 | LV1_CALL(set_lpm_general_control, 5, 2, 149 ) | ||
336 | LV1_CALL(set_lpm_interval, 3, 1, 150 ) | ||
337 | LV1_CALL(set_lpm_trigger_control, 3, 1, 151 ) | ||
338 | LV1_CALL(set_lpm_counter_control, 4, 1, 152 ) | ||
339 | LV1_CALL(set_lpm_group_control, 3, 1, 153 ) | ||
340 | LV1_CALL(set_lpm_debug_bus_control, 3, 1, 154 ) | ||
341 | LV1_CALL(set_lpm_counter, 5, 2, 155 ) | ||
342 | LV1_CALL(set_lpm_signal, 7, 0, 156 ) | ||
343 | LV1_CALL(set_lpm_spr_trigger, 2, 0, 157 ) | ||
344 | |||
345 | #endif | ||