From: Paul Mackerras Date: Fri, 21 Sep 2018 10:01:43 +0000 Subject: [RFC PATCH 12/32] powerpc: Provide dummy versions of plpar_hcall functions when !CONFIG_PPC_PSERIES Message-Id: <1537524123-9578-13-git-send-email-paulus@ozlabs.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org This will reduce the number of instances where we require ifdefs in code which needs to call a hypercall on a pseries platform or do something different on a powernv platform. Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/hvcall.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h index a0b17f9..cc9fe87 100644 --- a/arch/powerpc/include/asm/hvcall.h +++ b/arch/powerpc/include/asm/hvcall.h @@ -362,6 +362,7 @@ #ifndef __ASSEMBLY__ #include +#ifdef CONFIG_PPC_PSERIES /** * plpar_hcall_norets: - Make a pseries hypervisor call with no return arguments * @opcode: The hypervisor call to make. @@ -411,6 +412,27 @@ long plpar_hcall_raw(unsigned long opcode, unsigned long *retbuf, ...); long plpar_hcall9(unsigned long opcode, unsigned long *retbuf, ...); long plpar_hcall9_raw(unsigned long opcode, unsigned long *retbuf, ...); +#else /* CONFIG_PPC_PSERIES */ +static inline long plpar_hcall_norets(unsigned long opcode, ...) +{ return H_FUNCTION; } + +#define PLPAR_HCALL_BUFSIZE 4 +static inline long plpar_hcall(unsigned long opcode, unsigned long *retbuf, ...) +{ return H_FUNCTION; } + +static inline long plpar_hcall_raw(unsigned long opcode, + unsigned long *retbuf, ...) +{ return H_FUNCTION; } + +#define PLPAR_HCALL9_BUFSIZE 9 +static inline long plpar_hcall9(unsigned long opcode, + unsigned long *retbuf, ...) +{ return H_FUNCTION; } +static inline long plpar_hcall9_raw(unsigned long opcode, + unsigned long *retbuf, ...) +{ return H_FUNCTION; } +#endif /* CONFIG_PPC_PSERIES */ + struct hvcall_mpp_data { unsigned long entitled_mem; unsigned long mapped_mem; -- 2.7.4