]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - arch/powerpc/platforms/iseries/hvcall.S
powerpc: move ItLpQueue.c to powerpc/platforms/iseries
[karo-tx-linux.git] / arch / powerpc / platforms / iseries / hvcall.S
1 /*
2  * This file contains the code to perform calls to the
3  * iSeries LPAR hypervisor
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version
8  * 2 of the License, or (at your option) any later version.
9  */
10
11 #include <asm/ppc_asm.h>
12 #include <asm/processor.h>
13
14         .text
15
16 /*
17  * Hypervisor call
18  *
19  * Invoke the iSeries hypervisor via the System Call instruction
20  * Parameters are passed to this routine in registers r3 - r10
21  *
22  * r3 contains the HV function to be called
23  * r4-r10 contain the operands to the hypervisor function
24  *
25  */
26
27 _GLOBAL(HvCall)
28 _GLOBAL(HvCall0)
29 _GLOBAL(HvCall1)
30 _GLOBAL(HvCall2)
31 _GLOBAL(HvCall3)
32 _GLOBAL(HvCall4)
33 _GLOBAL(HvCall5)
34 _GLOBAL(HvCall6)
35 _GLOBAL(HvCall7)
36
37
38         mfcr    r0
39         std     r0,-8(r1)
40         stdu    r1,-(STACK_FRAME_OVERHEAD+16)(r1)
41
42         /* r0 = 0xffffffffffffffff indicates a hypervisor call */
43
44         li      r0,-1
45
46         /* Invoke the hypervisor */
47
48         sc
49
50         ld      r1,0(r1)
51         ld      r0,-8(r1)
52         mtcrf   0xff,r0
53
54         /*  return to caller, return value in r3 */
55
56         blr
57
58 _GLOBAL(HvCall0Ret16)
59 _GLOBAL(HvCall1Ret16)
60 _GLOBAL(HvCall2Ret16)
61 _GLOBAL(HvCall3Ret16)
62 _GLOBAL(HvCall4Ret16)
63 _GLOBAL(HvCall5Ret16)
64 _GLOBAL(HvCall6Ret16)
65 _GLOBAL(HvCall7Ret16)
66
67         mfcr    r0
68         std     r0,-8(r1)
69         std     r31,-16(r1)
70         stdu    r1,-(STACK_FRAME_OVERHEAD+32)(r1)
71
72         mr      r31,r4
73         li      r0,-1
74         mr      r4,r5
75         mr      r5,r6
76         mr      r6,r7
77         mr      r7,r8
78         mr      r8,r9
79         mr      r9,r10
80
81         sc
82
83         std     r3,0(r31)
84         std     r4,8(r31)
85
86         mr      r3,r5
87
88         ld      r1,0(r1)
89         ld      r0,-8(r1)
90         mtcrf   0xff,r0
91         ld      r31,-16(r1)
92
93         blr