kvm/powerpc: move kvm_hypercall0() and friends to epapr_hypercall0()
authorBharat Bhushan <r65777@freescale.com>
Tue, 8 Oct 2013 04:02:20 +0000 (09:32 +0530)
committerAlexander Graf <agraf@suse.de>
Thu, 9 Jan 2014 09:14:57 +0000 (10:14 +0100)
kvm_hypercall0() and friends have nothing KVM specific so moved to
epapr_hypercall0() and friends. Also they are moved from
arch/powerpc/include/asm/kvm_para.h to arch/powerpc/include/asm/epapr_hcalls.h

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/include/asm/epapr_hcalls.h
arch/powerpc/include/asm/kvm_para.h

index eec87f9494bc427ef7fe5da39b7e4b386da8ac4b..334459ad145b4e2ad417b4d359507a29f14ac617 100644 (file)
@@ -506,5 +506,70 @@ static unsigned long epapr_hypercall(unsigned long *in,
 }
 #endif
 
+static inline long epapr_hypercall0_1(unsigned int nr, unsigned long *r2)
+{
+       unsigned long in[8];
+       unsigned long out[8];
+       unsigned long r;
+
+       r = epapr_hypercall(in, out, nr);
+       *r2 = out[0];
+
+       return r;
+}
+
+static inline long epapr_hypercall0(unsigned int nr)
+{
+       unsigned long in[8];
+       unsigned long out[8];
+
+       return epapr_hypercall(in, out, nr);
+}
+
+static inline long epapr_hypercall1(unsigned int nr, unsigned long p1)
+{
+       unsigned long in[8];
+       unsigned long out[8];
+
+       in[0] = p1;
+       return epapr_hypercall(in, out, nr);
+}
+
+static inline long epapr_hypercall2(unsigned int nr, unsigned long p1,
+                                   unsigned long p2)
+{
+       unsigned long in[8];
+       unsigned long out[8];
+
+       in[0] = p1;
+       in[1] = p2;
+       return epapr_hypercall(in, out, nr);
+}
+
+static inline long epapr_hypercall3(unsigned int nr, unsigned long p1,
+                                   unsigned long p2, unsigned long p3)
+{
+       unsigned long in[8];
+       unsigned long out[8];
+
+       in[0] = p1;
+       in[1] = p2;
+       in[2] = p3;
+       return epapr_hypercall(in, out, nr);
+}
+
+static inline long epapr_hypercall4(unsigned int nr, unsigned long p1,
+                                   unsigned long p2, unsigned long p3,
+                                   unsigned long p4)
+{
+       unsigned long in[8];
+       unsigned long out[8];
+
+       in[0] = p1;
+       in[1] = p2;
+       in[2] = p3;
+       in[3] = p4;
+       return epapr_hypercall(in, out, nr);
+}
 #endif /* !__ASSEMBLY__ */
 #endif /* _EPAPR_HCALLS_H */
index c18660ef26d8c1d110b14ef1a047bfa48f1d5067..336a91acb8b1f3a98f4bfdd7c0c6488d95b86ae0 100644 (file)
@@ -48,73 +48,6 @@ static inline int kvm_para_available(void)
 
 #endif
 
-static inline long kvm_hypercall0_1(unsigned int nr, unsigned long *r2)
-{
-       unsigned long in[8];
-       unsigned long out[8];
-       unsigned long r;
-
-       r = epapr_hypercall(in, out, KVM_HCALL_TOKEN(nr));
-       *r2 = out[0];
-
-       return r;
-}
-
-static inline long kvm_hypercall0(unsigned int nr)
-{
-       unsigned long in[8];
-       unsigned long out[8];
-
-       return epapr_hypercall(in, out, KVM_HCALL_TOKEN(nr));
-}
-
-static inline long kvm_hypercall1(unsigned int nr, unsigned long p1)
-{
-       unsigned long in[8];
-       unsigned long out[8];
-
-       in[0] = p1;
-       return epapr_hypercall(in, out, KVM_HCALL_TOKEN(nr));
-}
-
-static inline long kvm_hypercall2(unsigned int nr, unsigned long p1,
-                                 unsigned long p2)
-{
-       unsigned long in[8];
-       unsigned long out[8];
-
-       in[0] = p1;
-       in[1] = p2;
-       return epapr_hypercall(in, out, KVM_HCALL_TOKEN(nr));
-}
-
-static inline long kvm_hypercall3(unsigned int nr, unsigned long p1,
-                                 unsigned long p2, unsigned long p3)
-{
-       unsigned long in[8];
-       unsigned long out[8];
-
-       in[0] = p1;
-       in[1] = p2;
-       in[2] = p3;
-       return epapr_hypercall(in, out, KVM_HCALL_TOKEN(nr));
-}
-
-static inline long kvm_hypercall4(unsigned int nr, unsigned long p1,
-                                 unsigned long p2, unsigned long p3,
-                                 unsigned long p4)
-{
-       unsigned long in[8];
-       unsigned long out[8];
-
-       in[0] = p1;
-       in[1] = p2;
-       in[2] = p3;
-       in[3] = p4;
-       return epapr_hypercall(in, out, KVM_HCALL_TOKEN(nr));
-}
-
-
 static inline unsigned int kvm_arch_para_features(void)
 {
        unsigned long r;
@@ -122,7 +55,7 @@ static inline unsigned int kvm_arch_para_features(void)
        if (!kvm_para_available())
                return 0;
 
-       if(kvm_hypercall0_1(KVM_HC_FEATURES, &r))
+       if(epapr_hypercall0_1(KVM_HCALL_TOKEN(KVM_HC_FEATURES), &r))
                return 0;
 
        return r;