diff options
author | Bharat Bhushan <r65777@freescale.com> | 2013-10-08 00:02:20 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2014-01-09 04:14:57 -0500 |
commit | b1f0d94c26b64e814243b736f47e7ef40d96432c (patch) | |
tree | fb3c11ffb3def157664a2e0c9d90fa739202e4f7 /arch/powerpc/include/asm | |
parent | 1820a8d2163554dcd0272cc095338499db4a4dc3 (diff) |
kvm/powerpc: move kvm_hypercall0() and friends to epapr_hypercall0()
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>
Diffstat (limited to 'arch/powerpc/include/asm')
-rw-r--r-- | arch/powerpc/include/asm/epapr_hcalls.h | 65 | ||||
-rw-r--r-- | arch/powerpc/include/asm/kvm_para.h | 69 |
2 files changed, 66 insertions, 68 deletions
diff --git a/arch/powerpc/include/asm/epapr_hcalls.h b/arch/powerpc/include/asm/epapr_hcalls.h index eec87f9494bc..334459ad145b 100644 --- a/arch/powerpc/include/asm/epapr_hcalls.h +++ b/arch/powerpc/include/asm/epapr_hcalls.h | |||
@@ -506,5 +506,70 @@ static unsigned long epapr_hypercall(unsigned long *in, | |||
506 | } | 506 | } |
507 | #endif | 507 | #endif |
508 | 508 | ||
509 | static inline long epapr_hypercall0_1(unsigned int nr, unsigned long *r2) | ||
510 | { | ||
511 | unsigned long in[8]; | ||
512 | unsigned long out[8]; | ||
513 | unsigned long r; | ||
514 | |||
515 | r = epapr_hypercall(in, out, nr); | ||
516 | *r2 = out[0]; | ||
517 | |||
518 | return r; | ||
519 | } | ||
520 | |||
521 | static inline long epapr_hypercall0(unsigned int nr) | ||
522 | { | ||
523 | unsigned long in[8]; | ||
524 | unsigned long out[8]; | ||
525 | |||
526 | return epapr_hypercall(in, out, nr); | ||
527 | } | ||
528 | |||
529 | static inline long epapr_hypercall1(unsigned int nr, unsigned long p1) | ||
530 | { | ||
531 | unsigned long in[8]; | ||
532 | unsigned long out[8]; | ||
533 | |||
534 | in[0] = p1; | ||
535 | return epapr_hypercall(in, out, nr); | ||
536 | } | ||
537 | |||
538 | static inline long epapr_hypercall2(unsigned int nr, unsigned long p1, | ||
539 | unsigned long p2) | ||
540 | { | ||
541 | unsigned long in[8]; | ||
542 | unsigned long out[8]; | ||
543 | |||
544 | in[0] = p1; | ||
545 | in[1] = p2; | ||
546 | return epapr_hypercall(in, out, nr); | ||
547 | } | ||
548 | |||
549 | static inline long epapr_hypercall3(unsigned int nr, unsigned long p1, | ||
550 | unsigned long p2, unsigned long p3) | ||
551 | { | ||
552 | unsigned long in[8]; | ||
553 | unsigned long out[8]; | ||
554 | |||
555 | in[0] = p1; | ||
556 | in[1] = p2; | ||
557 | in[2] = p3; | ||
558 | return epapr_hypercall(in, out, nr); | ||
559 | } | ||
560 | |||
561 | static inline long epapr_hypercall4(unsigned int nr, unsigned long p1, | ||
562 | unsigned long p2, unsigned long p3, | ||
563 | unsigned long p4) | ||
564 | { | ||
565 | unsigned long in[8]; | ||
566 | unsigned long out[8]; | ||
567 | |||
568 | in[0] = p1; | ||
569 | in[1] = p2; | ||
570 | in[2] = p3; | ||
571 | in[3] = p4; | ||
572 | return epapr_hypercall(in, out, nr); | ||
573 | } | ||
509 | #endif /* !__ASSEMBLY__ */ | 574 | #endif /* !__ASSEMBLY__ */ |
510 | #endif /* _EPAPR_HCALLS_H */ | 575 | #endif /* _EPAPR_HCALLS_H */ |
diff --git a/arch/powerpc/include/asm/kvm_para.h b/arch/powerpc/include/asm/kvm_para.h index c18660ef26d8..336a91acb8b1 100644 --- a/arch/powerpc/include/asm/kvm_para.h +++ b/arch/powerpc/include/asm/kvm_para.h | |||
@@ -48,73 +48,6 @@ static inline int kvm_para_available(void) | |||
48 | 48 | ||
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | static inline long kvm_hypercall0_1(unsigned int nr, unsigned long *r2) | ||
52 | { | ||
53 | unsigned long in[8]; | ||
54 | unsigned long out[8]; | ||
55 | unsigned long r; | ||
56 | |||
57 | r = epapr_hypercall(in, out, KVM_HCALL_TOKEN(nr)); | ||
58 | *r2 = out[0]; | ||
59 | |||
60 | return r; | ||
61 | } | ||
62 | |||
63 | static inline long kvm_hypercall0(unsigned int nr) | ||
64 | { | ||
65 | unsigned long in[8]; | ||
66 | unsigned long out[8]; | ||
67 | |||
68 | return epapr_hypercall(in, out, KVM_HCALL_TOKEN(nr)); | ||
69 | } | ||
70 | |||
71 | static inline long kvm_hypercall1(unsigned int nr, unsigned long p1) | ||
72 | { | ||
73 | unsigned long in[8]; | ||
74 | unsigned long out[8]; | ||
75 | |||
76 | in[0] = p1; | ||
77 | return epapr_hypercall(in, out, KVM_HCALL_TOKEN(nr)); | ||
78 | } | ||
79 | |||
80 | static inline long kvm_hypercall2(unsigned int nr, unsigned long p1, | ||
81 | unsigned long p2) | ||
82 | { | ||
83 | unsigned long in[8]; | ||
84 | unsigned long out[8]; | ||
85 | |||
86 | in[0] = p1; | ||
87 | in[1] = p2; | ||
88 | return epapr_hypercall(in, out, KVM_HCALL_TOKEN(nr)); | ||
89 | } | ||
90 | |||
91 | static inline long kvm_hypercall3(unsigned int nr, unsigned long p1, | ||
92 | unsigned long p2, unsigned long p3) | ||
93 | { | ||
94 | unsigned long in[8]; | ||
95 | unsigned long out[8]; | ||
96 | |||
97 | in[0] = p1; | ||
98 | in[1] = p2; | ||
99 | in[2] = p3; | ||
100 | return epapr_hypercall(in, out, KVM_HCALL_TOKEN(nr)); | ||
101 | } | ||
102 | |||
103 | static inline long kvm_hypercall4(unsigned int nr, unsigned long p1, | ||
104 | unsigned long p2, unsigned long p3, | ||
105 | unsigned long p4) | ||
106 | { | ||
107 | unsigned long in[8]; | ||
108 | unsigned long out[8]; | ||
109 | |||
110 | in[0] = p1; | ||
111 | in[1] = p2; | ||
112 | in[2] = p3; | ||
113 | in[3] = p4; | ||
114 | return epapr_hypercall(in, out, KVM_HCALL_TOKEN(nr)); | ||
115 | } | ||
116 | |||
117 | |||
118 | static inline unsigned int kvm_arch_para_features(void) | 51 | static inline unsigned int kvm_arch_para_features(void) |
119 | { | 52 | { |
120 | unsigned long r; | 53 | unsigned long r; |
@@ -122,7 +55,7 @@ static inline unsigned int kvm_arch_para_features(void) | |||
122 | if (!kvm_para_available()) | 55 | if (!kvm_para_available()) |
123 | return 0; | 56 | return 0; |
124 | 57 | ||
125 | if(kvm_hypercall0_1(KVM_HC_FEATURES, &r)) | 58 | if(epapr_hypercall0_1(KVM_HCALL_TOKEN(KVM_HC_FEATURES), &r)) |
126 | return 0; | 59 | return 0; |
127 | 60 | ||
128 | return r; | 61 | return r; |