1 #ifndef _PPC64_PLPAR_WRAPPERS_H
2 #define _PPC64_PLPAR_WRAPPERS_H
4 #include <asm/hvcall.h>
6 static inline long poll_pending(void)
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);
19 static inline long cede_processor(void)
21 plpar_hcall_norets(H_CEDE);
25 static inline long register_vpa(unsigned long flags, unsigned long proc,
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,
36 unsigned long *old_pteh_ret,
37 unsigned long *old_ptel_ret)
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,
46 unsigned long *old_pteh_ret, unsigned long *old_ptel_ret)
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,
57 return plpar_hcall_norets(H_PROTECT, flags, ptex, avpn);
60 static inline long plpar_tce_get(unsigned long liobn,
62 unsigned long *tce_ret)
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,
73 return plpar_hcall_norets(H_PUT_TCE, liobn, ioba, tceval);
76 static inline long plpar_tce_put_indirect(unsigned long liobn,
81 return plpar_hcall_norets(H_PUT_TCE_INDIRECT, liobn, ioba, page, count);
84 static inline long plpar_tce_stuff(unsigned long liobn,
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,
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,
105 unsigned long *lbuf = (unsigned long *)buffer; /* ToDo: alignment? */
106 return plpar_hcall_norets(H_PUT_TERM_CHAR, termno, len, lbuf[0],
111 #endif /* _PPC64_PLPAR_WRAPPERS_H */