aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c3
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c3
-rw-r--r--arch/powerpc/platforms/pseries/plpar_wrappers.h107
-rw-r--r--arch/powerpc/platforms/pseries/setup.c3
-rw-r--r--arch/powerpc/platforms/pseries/smp.c3
-rw-r--r--include/asm-ppc64/plpar_wrappers.h120
6 files changed, 115 insertions, 124 deletions
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 9e90d41131d8..9e58a1922109 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -42,13 +42,14 @@
42#include <asm/pci-bridge.h> 42#include <asm/pci-bridge.h>
43#include <asm/machdep.h> 43#include <asm/machdep.h>
44#include <asm/abs_addr.h> 44#include <asm/abs_addr.h>
45#include <asm/plpar_wrappers.h>
46#include <asm/pSeries_reconfig.h> 45#include <asm/pSeries_reconfig.h>
47#include <asm/systemcfg.h> 46#include <asm/systemcfg.h>
48#include <asm/firmware.h> 47#include <asm/firmware.h>
49#include <asm/tce.h> 48#include <asm/tce.h>
50#include <asm/ppc-pci.h> 49#include <asm/ppc-pci.h>
51 50
51#include "plpar_wrappers.h"
52
52#define DBG(fmt...) 53#define DBG(fmt...)
53 54
54extern int is_python(struct device_node *); 55extern int is_python(struct device_node *);
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 268d8362dde7..8a7bda3db677 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -38,7 +38,8 @@
38#include <asm/prom.h> 38#include <asm/prom.h>
39#include <asm/abs_addr.h> 39#include <asm/abs_addr.h>
40#include <asm/cputable.h> 40#include <asm/cputable.h>
41#include <asm/plpar_wrappers.h> 41
42#include "plpar_wrappers.h"
42 43
43#ifdef DEBUG 44#ifdef DEBUG
44#define DBG(fmt...) udbg_printf(fmt) 45#define DBG(fmt...) udbg_printf(fmt)
diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h
new file mode 100644
index 000000000000..2457be2e217e
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h
@@ -0,0 +1,107 @@
1#ifndef _PSERIES_PLPAR_WRAPPERS_H
2#define _PSERIES_PLPAR_WRAPPERS_H
3
4#include <asm/hvcall.h>
5
6static inline long poll_pending(void)
7{
8 unsigned long dummy;
9 return plpar_hcall(H_POLL_PENDING, 0, 0, 0, 0, &dummy, &dummy, &dummy);
10}
11
12static inline long prod_processor(void)
13{
14 plpar_hcall_norets(H_PROD);
15 return 0;
16}
17
18static inline long cede_processor(void)
19{
20 plpar_hcall_norets(H_CEDE);
21 return 0;
22}
23
24static inline long register_vpa(unsigned long flags, unsigned long proc,
25 unsigned long vpa)
26{
27 return plpar_hcall_norets(H_REGISTER_VPA, flags, proc, vpa);
28}
29
30void vpa_init(int cpu);
31
32static inline long plpar_pte_remove(unsigned long flags, unsigned long ptex,
33 unsigned long avpn, unsigned long *old_pteh_ret,
34 unsigned long *old_ptel_ret)
35{
36 unsigned long dummy;
37 return plpar_hcall(H_REMOVE, flags, ptex, avpn, 0, old_pteh_ret,
38 old_ptel_ret, &dummy);
39}
40
41static inline long plpar_pte_read(unsigned long flags, unsigned long ptex,
42 unsigned long *old_pteh_ret, unsigned long *old_ptel_ret)
43{
44 unsigned long dummy;
45 return plpar_hcall(H_READ, flags, ptex, 0, 0, old_pteh_ret,
46 old_ptel_ret, &dummy);
47}
48
49static inline long plpar_pte_protect(unsigned long flags, unsigned long ptex,
50 unsigned long avpn)
51{
52 return plpar_hcall_norets(H_PROTECT, flags, ptex, avpn);
53}
54
55static inline long plpar_tce_get(unsigned long liobn, unsigned long ioba,
56 unsigned long *tce_ret)
57{
58 unsigned long dummy;
59 return plpar_hcall(H_GET_TCE, liobn, ioba, 0, 0, tce_ret, &dummy,
60 &dummy);
61}
62
63static inline long plpar_tce_put(unsigned long liobn, unsigned long ioba,
64 unsigned long tceval)
65{
66 return plpar_hcall_norets(H_PUT_TCE, liobn, ioba, tceval);
67}
68
69static inline long plpar_tce_put_indirect(unsigned long liobn,
70 unsigned long ioba, unsigned long page, unsigned long count)
71{
72 return plpar_hcall_norets(H_PUT_TCE_INDIRECT, liobn, ioba, page, count);
73}
74
75static inline long plpar_tce_stuff(unsigned long liobn, unsigned long ioba,
76 unsigned long tceval, unsigned long count)
77{
78 return plpar_hcall_norets(H_STUFF_TCE, liobn, ioba, tceval, count);
79}
80
81static inline long plpar_get_term_char(unsigned long termno,
82 unsigned long *len_ret, char *buf_ret)
83{
84 unsigned long *lbuf = (unsigned long *)buf_ret; /* TODO: alignment? */
85 return plpar_hcall(H_GET_TERM_CHAR, termno, 0, 0, 0, len_ret,
86 lbuf + 0, lbuf + 1);
87}
88
89static inline long plpar_put_term_char(unsigned long termno, unsigned long len,
90 const char *buffer)
91{
92 unsigned long *lbuf = (unsigned long *)buffer; /* TODO: alignment? */
93 return plpar_hcall_norets(H_PUT_TERM_CHAR, termno, len, lbuf[0],
94 lbuf[1]);
95}
96
97static inline long plpar_set_xdabr(unsigned long address, unsigned long flags)
98{
99 return plpar_hcall_norets(H_SET_XDABR, address, flags);
100}
101
102static inline long plpar_set_dabr(unsigned long val)
103{
104 return plpar_hcall_norets(H_SET_DABR, val);
105}
106
107#endif /* _PSERIES_PLPAR_WRAPPERS_H */
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index ee468f07f378..d54e1e4c7c63 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -58,7 +58,6 @@
58#include <asm/irq.h> 58#include <asm/irq.h>
59#include <asm/time.h> 59#include <asm/time.h>
60#include <asm/nvram.h> 60#include <asm/nvram.h>
61#include <asm/plpar_wrappers.h>
62#include "xics.h" 61#include "xics.h"
63#include <asm/firmware.h> 62#include <asm/firmware.h>
64#include <asm/pmc.h> 63#include <asm/pmc.h>
@@ -67,6 +66,8 @@
67#include <asm/i8259.h> 66#include <asm/i8259.h>
68#include <asm/udbg.h> 67#include <asm/udbg.h>
69 68
69#include "plpar_wrappers.h"
70
70#ifdef DEBUG 71#ifdef DEBUG
71#define DBG(fmt...) udbg_printf(fmt) 72#define DBG(fmt...) udbg_printf(fmt)
72#else 73#else
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index 9c9458ddfc25..7a243e8ccd7e 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -44,10 +44,11 @@
44#include <asm/firmware.h> 44#include <asm/firmware.h>
45#include <asm/system.h> 45#include <asm/system.h>
46#include <asm/rtas.h> 46#include <asm/rtas.h>
47#include <asm/plpar_wrappers.h>
48#include <asm/pSeries_reconfig.h> 47#include <asm/pSeries_reconfig.h>
49#include <asm/mpic.h> 48#include <asm/mpic.h>
50 49
50#include "plpar_wrappers.h"
51
51#ifdef DEBUG 52#ifdef DEBUG
52#define DBG(fmt...) udbg_printf(fmt) 53#define DBG(fmt...) udbg_printf(fmt)
53#else 54#else
diff --git a/include/asm-ppc64/plpar_wrappers.h b/include/asm-ppc64/plpar_wrappers.h
deleted file mode 100644
index 72dd2449ee76..000000000000
--- a/include/asm-ppc64/plpar_wrappers.h
+++ /dev/null
@@ -1,120 +0,0 @@
1#ifndef _PPC64_PLPAR_WRAPPERS_H
2#define _PPC64_PLPAR_WRAPPERS_H
3
4#include <asm/hvcall.h>
5
6static inline long poll_pending(void)
7{
8 unsigned long dummy;
9 return plpar_hcall(H_POLL_PENDING, 0, 0, 0, 0,
10 &dummy, &dummy, &dummy);
11}
12
13static inline long prod_processor(void)
14{
15 plpar_hcall_norets(H_PROD);
16 return(0);
17}
18
19static inline long cede_processor(void)
20{
21 plpar_hcall_norets(H_CEDE);
22 return(0);
23}
24
25static inline long register_vpa(unsigned long flags, unsigned long proc,
26 unsigned long vpa)
27{
28 return plpar_hcall_norets(H_REGISTER_VPA, flags, proc, vpa);
29}
30
31void vpa_init(int cpu);
32
33static inline long plpar_pte_remove(unsigned long flags,
34 unsigned long ptex,
35 unsigned long avpn,
36 unsigned long *old_pteh_ret,
37 unsigned long *old_ptel_ret)
38{
39 unsigned long dummy;
40 return plpar_hcall(H_REMOVE, flags, ptex, avpn, 0,
41 old_pteh_ret, old_ptel_ret, &dummy);
42}
43
44static inline long plpar_pte_read(unsigned long flags,
45 unsigned long ptex,
46 unsigned long *old_pteh_ret, unsigned long *old_ptel_ret)
47{
48 unsigned long dummy;
49 return plpar_hcall(H_READ, flags, ptex, 0, 0,
50 old_pteh_ret, old_ptel_ret, &dummy);
51}
52
53static inline long plpar_pte_protect(unsigned long flags,
54 unsigned long ptex,
55 unsigned long avpn)
56{
57 return plpar_hcall_norets(H_PROTECT, flags, ptex, avpn);
58}
59
60static inline long plpar_tce_get(unsigned long liobn,
61 unsigned long ioba,
62 unsigned long *tce_ret)
63{
64 unsigned long dummy;
65 return plpar_hcall(H_GET_TCE, liobn, ioba, 0, 0,
66 tce_ret, &dummy, &dummy);
67}
68
69static inline long plpar_tce_put(unsigned long liobn,
70 unsigned long ioba,
71 unsigned long tceval)
72{
73 return plpar_hcall_norets(H_PUT_TCE, liobn, ioba, tceval);
74}
75
76static inline long plpar_tce_put_indirect(unsigned long liobn,
77 unsigned long ioba,
78 unsigned long page,
79 unsigned long count)
80{
81 return plpar_hcall_norets(H_PUT_TCE_INDIRECT, liobn, ioba, page, count);
82}
83
84static inline long plpar_tce_stuff(unsigned long liobn,
85 unsigned long ioba,
86 unsigned long tceval,
87 unsigned long count)
88{
89 return plpar_hcall_norets(H_STUFF_TCE, liobn, ioba, tceval, count);
90}
91
92static inline long plpar_get_term_char(unsigned long termno,
93 unsigned long *len_ret,
94 char *buf_ret)
95{
96 unsigned long *lbuf = (unsigned long *)buf_ret; /* ToDo: alignment? */
97 return plpar_hcall(H_GET_TERM_CHAR, termno, 0, 0, 0,
98 len_ret, lbuf+0, lbuf+1);
99}
100
101static inline long plpar_put_term_char(unsigned long termno,
102 unsigned long len,
103 const char *buffer)
104{
105 unsigned long *lbuf = (unsigned long *)buffer; /* ToDo: alignment? */
106 return plpar_hcall_norets(H_PUT_TERM_CHAR, termno, len, lbuf[0],
107 lbuf[1]);
108}
109
110static inline long plpar_set_xdabr(unsigned long address, unsigned long flags)
111{
112 return plpar_hcall_norets(H_SET_XDABR, address, flags);
113}
114
115static inline long plpar_set_dabr(unsigned long val)
116{
117 return plpar_hcall_norets(H_SET_DABR, val);
118}
119
120#endif /* _PPC64_PLPAR_WRAPPERS_H */