[PATCH] w1: Adds a sysfs entry (w1_master_search) that allows you to disable/enable...
[linux-2.6/verdex.git] / include / asm-ppc64 / plpar_wrappers.h
blobf4a5fb7d67c7ccd24a0aa82c06672e8f54461565
1 #ifndef _PPC64_PLPAR_WRAPPERS_H
2 #define _PPC64_PLPAR_WRAPPERS_H
4 #include <asm/hvcall.h>
6 static inline long poll_pending(void)
8 unsigned long dummy;
9 return plpar_hcall(H_POLL_PENDING, 0, 0, 0, 0,
10 &dummy, &dummy, &dummy);
13 static inline long prod_processor(void)
15 plpar_hcall_norets(H_PROD);
16 return(0);
19 static inline long cede_processor(void)
21 plpar_hcall_norets(H_CEDE);
22 return(0);
25 static inline long register_vpa(unsigned long flags, unsigned long proc,
26 unsigned long vpa)
28 return plpar_hcall_norets(H_REGISTER_VPA, flags, proc, vpa);
31 void vpa_init(int cpu);
33 static 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)
39 unsigned long dummy;
40 return plpar_hcall(H_REMOVE, flags, ptex, avpn, 0,
41 old_pteh_ret, old_ptel_ret, &dummy);
44 static inline long plpar_pte_read(unsigned long flags,
45 unsigned long ptex,
46 unsigned long *old_pteh_ret, unsigned long *old_ptel_ret)
48 unsigned long dummy;
49 return plpar_hcall(H_READ, flags, ptex, 0, 0,
50 old_pteh_ret, old_ptel_ret, &dummy);
53 static inline long plpar_pte_protect(unsigned long flags,
54 unsigned long ptex,
55 unsigned long avpn)
57 return plpar_hcall_norets(H_PROTECT, flags, ptex, avpn);
60 static inline long plpar_tce_get(unsigned long liobn,
61 unsigned long ioba,
62 unsigned long *tce_ret)
64 unsigned long dummy;
65 return plpar_hcall(H_GET_TCE, liobn, ioba, 0, 0,
66 tce_ret, &dummy, &dummy);
69 static inline long plpar_tce_put(unsigned long liobn,
70 unsigned long ioba,
71 unsigned long tceval)
73 return plpar_hcall_norets(H_PUT_TCE, liobn, ioba, tceval);
76 static inline long plpar_tce_put_indirect(unsigned long liobn,
77 unsigned long ioba,
78 unsigned long page,
79 unsigned long count)
81 return plpar_hcall_norets(H_PUT_TCE_INDIRECT, liobn, ioba, page, count);
84 static inline long plpar_tce_stuff(unsigned long liobn,
85 unsigned long ioba,
86 unsigned long tceval,
87 unsigned long count)
89 return plpar_hcall_norets(H_STUFF_TCE, liobn, ioba, tceval, count);
92 static inline long plpar_get_term_char(unsigned long termno,
93 unsigned long *len_ret,
94 char *buf_ret)
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);
101 static inline long plpar_put_term_char(unsigned long termno,
102 unsigned long len,
103 const char *buffer)
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]);
111 #endif /* _PPC64_PLPAR_WRAPPERS_H */