diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2005-11-03 08:34:38 (GMT) |
---|---|---|
committer | Michael Ellerman <michael@ellerman.id.au> | 2005-11-03 08:34:38 (GMT) |
commit | 40765d2b8b86446b4ac8ec880cf4fdf56ce4ae7e (patch) | |
tree | 36f18519c5094495840a1a1c424f24db837eed22 /arch/powerpc/platforms/pseries/plpar_wrappers.h | |
parent | c87ef1171db207d9d19f87ad12db92974d95c466 (diff) | |
download | linux-fsl-qoriq-40765d2b8b86446b4ac8ec880cf4fdf56ce4ae7e.tar.xz |
powerpc: Cleanup vpa code
register_vpa() doesn't actually do a VPA register call it just uses the flags
you pass it, so rename it to vpa_call() to be clearer.
We can then define register_vpa() and unregister_vpa() which are both simple
wrappers around vpa_call(). (we'll need unregister_vpa() for kexec soon)
We can then cleanup vpa_init(), and because vpa_init() is only called from
platforms/pseries we remove the definition in asm-ppc64/smp.h.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/pseries/plpar_wrappers.h')
-rw-r--r-- | arch/powerpc/platforms/pseries/plpar_wrappers.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h index 2457be2..382f8c5 100644 --- a/arch/powerpc/platforms/pseries/plpar_wrappers.h +++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h @@ -21,13 +21,26 @@ static inline long cede_processor(void) return 0; } -static inline long register_vpa(unsigned long flags, unsigned long proc, +static inline long vpa_call(unsigned long flags, unsigned long cpu, unsigned long vpa) { - return plpar_hcall_norets(H_REGISTER_VPA, flags, proc, vpa); + /* flags are in bits 16-18 (counting from most significant bit) */ + flags = flags << (63 - 18); + + return plpar_hcall_norets(H_REGISTER_VPA, flags, cpu, vpa); +} + +static inline long unregister_vpa(unsigned long cpu, unsigned long vpa) +{ + return vpa_call(0x5, cpu, vpa); +} + +static inline long register_vpa(unsigned long cpu, unsigned long vpa) +{ + return vpa_call(0x1, cpu, vpa); } -void vpa_init(int cpu); +extern void vpa_init(int cpu); static inline long plpar_pte_remove(unsigned long flags, unsigned long ptex, unsigned long avpn, unsigned long *old_pteh_ret, |