cleanup
[linux-2.4.21-pre4.git] / arch / ppc64 / kernel / pSeries_hvCall.S
1 /*
2  * arch/ppc64/kernel/pSeries_hvCall.S
3  *
4  *
5  * This file contains the generic code to perform a call to the
6  * pSeries LPAR hypervisor.
7  * NOTE: this file will go away when we move to inline this work.
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version
12  * 2 of the License, or (at your option) any later version.
13  */
14 #include <linux/config.h>
15 #include <linux/sys.h>
16 #include <asm/unistd.h>
17 #include <asm/errno.h>
18 #include <asm/processor.h>
19 #include <asm/page.h>
20 #include <asm/cache.h>
21 #include "ppc_asm.h"
22         
23 /*
24  * hcall interface to pSeries LPAR
25  */
26 #define HSC .long 0x44000022
27
28 /* long plpar_hcall(unsigned long opcode,        R3 
29                  unsigned long arg1,             R4 
30                  unsigned long arg2,             R5 
31                  unsigned long arg3,             R6 
32                  unsigned long arg4,             R7 
33                  unsigned long *out1,            R8 
34                  unsigned long *out2,            R9
35                  unsigned long *out3);           R10
36  */
37
38         .text
39 _GLOBAL(plpar_hcall)
40         mfcr    r0
41         std     r0,-8(r1)
42         stdu    r1,-32(r1)
43
44         std     r8,-8(r1)       /* Save out ptrs. */
45         std     r9,-16(r1)
46         std     r10,-24(r1)
47         
48         HSC                     /* invoke the hypervisor */
49
50         ld      r10,-8(r1)      /* Fetch r4-r7 ret args. */
51         std     r4,0(r10)
52         ld      r10,-16(r1)
53         std     r5,0(r10)
54         ld      r10,-24(r1)
55         std     r6,0(r10)
56
57         ld      r1,0(r1)
58         ld      r0,-8(r1)
59         mtcrf   0xff,r0
60         blr                     /* return r3 = status */
61
62
63 /* Simple interface with no output values (other than status) */
64 _GLOBAL(plpar_hcall_norets)
65         mfcr    r0
66         std     r0,-8(r1)
67         HSC                     /* invoke the hypervisor */
68         ld      r0,-8(r1)
69         mtcrf   0xff,r0
70         blr                     /* return r3 = status */