aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2005-11-02 23:33:31 -0500
committerMichael Ellerman <michael@ellerman.id.au>2005-11-02 23:33:31 -0500
commita1218720321d778134914cf90ef54cf0d1d8477c (patch)
tree32399ec564cb1996fba4415979fcbf69b33b3ecc /arch
parentcab0af98dfbbf8076d1af01f2927af491a76a33f (diff)
powerpc: Move plpar_wrappers.h into arch/powerpc/platforms/pseries
Move plpar_wrappers.h into arch/powerpc/platforms/pseries, fixup white space, and update callers. Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Diffstat (limited to 'arch')
-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
5 files changed, 115 insertions, 4 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