[PATCH] powerpc: Extends HCALL interface for Infiniband usage

Michal Ostrowski mostrows at watson.ibm.com
Fri Mar 31 06:13:25 EST 2006


For the sake of discussion...

A generic hcall wrapper through which any hcall may be made; an
alternative to having to wwrite-out each possible combination of
numbers of input and output arguments.

Needs the obvious fix to meek Heiko's requirements (9-in, 9-out).

Signed-off-by: Michal Ostrowski <mostrows at watson.ibm.com>


 arch/powerpc/platforms/pseries/hvCall.S |   45 ++++++++++++++++++++++++++++++++
 include/asm-powerpc/hvcall.h            |   10 +++++++
 2 files changed, 55 insertions(+)

diff --git a/arch/powerpc/platforms/pseries/hvCall.S b/arch/powerpc/platforms/pseries/hvCall.S
index 176e8da..7bb29b5 100644
--- a/arch/powerpc/platforms/pseries/hvCall.S
+++ b/arch/powerpc/platforms/pseries/hvCall.S
@@ -129,3 +129,48 @@ _GLOBAL(plpar_hcall_4out)
 
 	mtcrf	0xff,r0
 	blr				/* return r3 = status */
+
+/* long plpar_hcall_generic(unsigned long opcode,	R3
+			    unsigned long in_args[8],	R4
+			    unsigned long out_args[8])	R5
+*/
+_GLOBAL(plpar_hcall_generic)
+	mfcr	r0
+	std	r0,-8(r1)
+	stdu	r1,-48(r1)
+
+	std	r4,16(r1)
+	std	r5,8(r1)
+
+	mr	r12, r4			/* Load HCALL args into r4...r11. */
+	ld	r4, 0(r12)
+	ld	r5, 8(r12)
+	ld	r6, 16(r12)
+	ld	r7, 24(r12)
+	ld	r8, 32(r12)
+	ld	r9, 40(r12)
+	ld	r10, 48(r12)
+	ld	r11, 56(r12)
+
+	HVSC				/* Invoke the hypervisor. */
+
+	ld	r12, 8(r1)		/* Check if return args need	*/
+	cmpi	0, r12, 0		/* to be saved.			*/
+	beq	1f
+
+	std	r4, 0(r12)
+	std	r5, 8(r12)
+	std	r6, 16(r12)
+	std	r7, 24(r12)
+	std	r8, 32(r12)
+	std	r9, 40(r12)
+	std	r10, 48(r12)
+	std	r11, 56(r12)
+1:
+	ld	r1,0(r1) 
+	ld	r0,-8(r1)
+
+	mtcrf	0xff,r0
+	blr				/* return r3 = status */
+
+
diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h
index 38ca9ad..3bf6425 100644
--- a/include/asm-powerpc/hvcall.h
+++ b/include/asm-powerpc/hvcall.h
@@ -175,6 +175,16 @@ long plpar_hcall_4out(unsigned long opco
 		      unsigned long *out3,
 		      unsigned long *out4);
 
+/* plpar_hcall_generic()
+ * 
+ * generic hcall pass-thru mechanism
+ *
+ */
+long plpar_hcall_generic(unsigned long opcode, 
+			 unsigned long in_args[8],	
+			 unsigned long out_args[8]);
+
+
 #endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_HVCALL_H */



More information about the Linuxppc-dev mailing list