[ewg] [PATCH ofed-1.2-rc3 1/3] ehca: backport for rhel-4.5 - hvcall.h

Stefan Roscher ossrosch at linux.vnet.ibm.com
Thu May 10 05:41:43 PDT 2007


use kmem_cache_t instead of struct kmem_cache and update hvcall.h



Signed-off-by: Stefan Roscher <stefan.roscher at de.ibm.com>
---

drivers/infiniband/hw/ehca/ehca_av.c                         |    2
drivers/infiniband/hw/ehca/ehca_cq.c                         |    2
drivers/infiniband/hw/ehca/ehca_main.c                       |    2
drivers/infiniband/hw/ehca/ehca_mrmw.c                       |    4
drivers/infiniband/hw/ehca/ehca_pd.c                         |    2
drivers/infiniband/hw/ehca/ehca_qp.c                         |    2
kernel_addons/backport/2.6.9_U5/include/asm-powerpc/system.h |    1
kernel_addons/backport/2.6.9_U5/include/asm/hvcall.h         |  167 +++++++++++
8 files changed, 174 insertions(+), 8 deletions(-)



diff -Nurp ofa_kernel-1.2_old/drivers/infiniband/hw/ehca/ehca_av.c ofa_kernel-1.2_new/drivers/infiniband/hw/ehca/ehca_av.c
--- ofa_kernel-1.2_old/drivers/infiniband/hw/ehca/ehca_av.c	2007-05-09 12:42:01.000000000 +0200
+++ ofa_kernel-1.2_new/drivers/infiniband/hw/ehca/ehca_av.c	2007-05-09 12:42:34.000000000 +0200
@@ -48,7 +48,7 @@
 #include "ehca_iverbs.h"
 #include "hcp_if.h"
 
-static struct kmem_cache *av_cache;
+static kmem_cache_t *av_cache;
 
 struct ib_ah *ehca_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr)
 {
diff -Nurp ofa_kernel-1.2_old/drivers/infiniband/hw/ehca/ehca_cq.c ofa_kernel-1.2_new/drivers/infiniband/hw/ehca/ehca_cq.c
--- ofa_kernel-1.2_old/drivers/infiniband/hw/ehca/ehca_cq.c	2007-05-09 12:42:01.000000000 +0200
+++ ofa_kernel-1.2_new/drivers/infiniband/hw/ehca/ehca_cq.c	2007-05-09 12:42:34.000000000 +0200
@@ -50,7 +50,7 @@
 #include "ehca_irq.h"
 #include "hcp_if.h"
 
-static struct kmem_cache *cq_cache;
+static kmem_cache_t *cq_cache;
 
 int ehca_cq_assign_qp(struct ehca_cq *cq, struct ehca_qp *qp)
 {
diff -Nurp ofa_kernel-1.2_old/drivers/infiniband/hw/ehca/ehca_main.c ofa_kernel-1.2_new/drivers/infiniband/hw/ehca/ehca_main.c
--- ofa_kernel-1.2_old/drivers/infiniband/hw/ehca/ehca_main.c	2007-05-09 12:42:01.000000000 +0200
+++ ofa_kernel-1.2_new/drivers/infiniband/hw/ehca/ehca_main.c	2007-05-09 12:42:34.000000000 +0200
@@ -465,7 +465,6 @@ void ehca_remove_driver_sysfs(struct ibm
 
 #define EHCA_RESOURCE_ATTR(name)                                           \
 static ssize_t  ehca_show_##name(struct device *dev,                       \
-				 struct device_attribute *attr,            \
 				 char *buf)                                \
 {									   \
 	struct ehca_shca *shca;						   \
@@ -513,7 +512,6 @@ EHCA_RESOURCE_ATTR(max_pd);
 EHCA_RESOURCE_ATTR(max_ah);
 
 static ssize_t ehca_show_adapter_handle(struct device *dev,
-					struct device_attribute *attr,
 					char *buf)
 {
 	struct ehca_shca *shca = dev->driver_data;
diff -Nurp ofa_kernel-1.2_old/drivers/infiniband/hw/ehca/ehca_mrmw.c ofa_kernel-1.2_new/drivers/infiniband/hw/ehca/ehca_mrmw.c
--- ofa_kernel-1.2_old/drivers/infiniband/hw/ehca/ehca_mrmw.c	2007-05-09 12:42:01.000000000 +0200
+++ ofa_kernel-1.2_new/drivers/infiniband/hw/ehca/ehca_mrmw.c	2007-05-09 12:42:34.000000000 +0200
@@ -46,8 +46,8 @@
 #include "hcp_if.h"
 #include "hipz_hw.h"
 
-static struct kmem_cache *mr_cache;
-static struct kmem_cache *mw_cache;
+static kmem_cache_t *mr_cache;
+static kmem_cache_t *mw_cache;
 
 static struct ehca_mr *ehca_mr_new(void)
 {
diff -Nurp ofa_kernel-1.2_old/drivers/infiniband/hw/ehca/ehca_pd.c ofa_kernel-1.2_new/drivers/infiniband/hw/ehca/ehca_pd.c
--- ofa_kernel-1.2_old/drivers/infiniband/hw/ehca/ehca_pd.c	2007-05-09 12:42:01.000000000 +0200
+++ ofa_kernel-1.2_new/drivers/infiniband/hw/ehca/ehca_pd.c	2007-05-09 12:42:34.000000000 +0200
@@ -43,7 +43,7 @@
 #include "ehca_tools.h"
 #include "ehca_iverbs.h"
 
-static struct kmem_cache *pd_cache;
+static kmem_cache_t *pd_cache;
 
 struct ib_pd *ehca_alloc_pd(struct ib_device *device,
 			    struct ib_ucontext *context, struct ib_udata *udata)
diff -Nurp ofa_kernel-1.2_old/drivers/infiniband/hw/ehca/ehca_qp.c ofa_kernel-1.2_new/drivers/infiniband/hw/ehca/ehca_qp.c
--- ofa_kernel-1.2_old/drivers/infiniband/hw/ehca/ehca_qp.c	2007-05-09 12:42:01.000000000 +0200
+++ ofa_kernel-1.2_new/drivers/infiniband/hw/ehca/ehca_qp.c	2007-05-09 12:42:34.000000000 +0200
@@ -51,7 +51,7 @@
 #include "hcp_if.h"
 #include "hipz_fns.h"
 
-static struct kmem_cache *qp_cache;
+static kmem_cache_t *qp_cache;
 
 /*
  * attributes not supported by query qp
diff -Nurp ofa_kernel-1.2_old/kernel_addons/backport/2.6.9_U5/include/asm/hvcall.h ofa_kernel-1.2_new/kernel_addons/backport/2.6.9_U5/include/asm/hvcall.h
--- ofa_kernel-1.2_old/kernel_addons/backport/2.6.9_U5/include/asm/hvcall.h	2007-05-09 12:48:09.000000000 +0200
+++ ofa_kernel-1.2_new/kernel_addons/backport/2.6.9_U5/include/asm/hvcall.h	2007-05-09 12:51:00.000000000 +0200
@@ -137,6 +137,173 @@ inline static long plpar_hcall9(unsigned
 	return regs[0];
 }
 
+inline static long plpar_hcall_7arg_7ret(unsigned long opcode,
+					 unsigned long arg1,    /* <R4  */
+					 unsigned long arg2,	/* <R5  */
+					 unsigned long arg3,	/* <R6  */
+					 unsigned long arg4,	/* <R7  */
+					 unsigned long arg5,	/* <R8  */
+					 unsigned long arg6,	/* <R9  */
+					 unsigned long arg7,	/* <R10 */
+					 unsigned long *out1,	/* <R4  */
+					 unsigned long *out2,	/* <R5  */
+					 unsigned long *out3,	/* <R6  */
+					 unsigned long *out4,	/* <R7  */
+					 unsigned long *out5,	/* <R8  */
+					 unsigned long *out6,	/* <R9  */
+					 unsigned long *out7	/* <R10 */
+    )
+{
+	unsigned long regs[11] = {opcode,
+				  arg1, arg2, arg3, arg4, arg5, arg6, arg7};
+
+	__asm__ __volatile__("mr 3,%10\n"
+			     "mr 4,%11\n"
+			     "mr 5,%12\n"
+			     "mr 6,%13\n"
+			     "mr 7,%14\n"
+			     "mr 8,%15\n"
+			     "mr 9,%16\n"
+			     "mr 10,%17\n"
+			     "mr 11,%18\n"
+			     "mr 12,%19\n"
+			     ".long 0x44000022\n"
+			     "mr %0,3\n"
+			     "mr %1,4\n"
+			     "mr %2,5\n"
+			     "mr %3,6\n"
+			     "mr %4,7\n"
+			     "mr %5,8\n"
+			     "mr %6,9\n"
+			     "mr %7,10\n"
+			     "mr %8,11\n"
+			     "mr %9,12\n":"=r"(regs[0]),
+			     "=r"(regs[1]), "=r"(regs[2]),
+			     "=r"(regs[3]), "=r"(regs[4]),
+			     "=r"(regs[5]), "=r"(regs[6]),
+			     "=r"(regs[7]), "=r"(regs[8]),
+			     "=r"(regs[9])
+			     :"r"(regs[0]), "r"(regs[1]),
+			     "r"(regs[2]), "r"(regs[3]),
+			     "r"(regs[4]), "r"(regs[5]),
+			     "r"(regs[6]), "r"(regs[7]),
+			     "r"(regs[8]), "r"(regs[9])
+			     :"r0", "r2", "r3", "r4", "r5", "r6", "r7",
+			     "r8", "r9", "r10", "r11", "r12", "cc",
+			     "xer", "ctr", "lr", "cr0", "cr1", "cr5",
+			     "cr6", "cr7");
+	*out1 = regs[1];
+	*out2 = regs[2];
+	*out3 = regs[3];
+	*out4 = regs[4];
+	*out5 = regs[5];
+	*out6 = regs[6];
+	*out7 = regs[7];
+
+	if (!H_isLongBusy(regs[0]) && regs[0] < 0) {
+		printk(KERN_ERR "HCALL77_IN r3=%lx r4=%lx r5=%lx r6=%lx "
+		       "r7=%lx r8=%lx r9=%lx r10=%lx",
+		       opcode, arg1, arg2, arg3,
+		       arg4, arg5, arg6, arg7);
+		printk(KERN_ERR "HCALL77_OUT r3=%lx r4=%lx r5=%lx "
+		       "r6=%lx r7=%lx r8=%lx r9=%lx r10=%lx ",
+		       regs[0], regs[1],
+		       regs[2], regs[3],
+		       regs[4], regs[5],
+		       regs[6], regs[7]);
+	}
+	return regs[0];
+}
+
+inline static long plpar_hcall_9arg_9ret(unsigned long opcode,
+					 unsigned long arg1,	/* <R4  */
+					 unsigned long arg2,	/* <R5  */
+					 unsigned long arg3,	/* <R6  */
+					 unsigned long arg4,	/* <R7  */
+					 unsigned long arg5,	/* <R8  */
+					 unsigned long arg6,	/* <R9  */
+					 unsigned long arg7,	/* <R10 */
+					 unsigned long arg8,	/* <R11 */
+					 unsigned long arg9,	/* <R12 */
+					 unsigned long *out1,	/* <R4  */
+					 unsigned long *out2,	/* <R5  */
+					 unsigned long *out3,	/* <R6  */
+					 unsigned long *out4,	/* <R7  */
+					 unsigned long *out5,	/* <R8  */
+					 unsigned long *out6,	/* <R9  */
+					 unsigned long *out7,	/* <R10 */
+					 unsigned long *out8,	/* <R11 */
+					 unsigned long *out9	/* <R12 */
+    )
+{
+	unsigned long regs[11] = {opcode,
+				  arg1, arg2, arg3, arg4, arg5, arg6, arg7,
+				  arg8, arg9};
+
+	__asm__ __volatile__("mr 3,%10\n"
+			     "mr 4,%11\n"
+			     "mr 5,%12\n"
+			     "mr 6,%13\n"
+			     "mr 7,%14\n"
+			     "mr 8,%15\n"
+			     "mr 9,%16\n"
+			     "mr 10,%17\n"
+			     "mr 11,%18\n"
+			     "mr 12,%19\n"
+			     ".long 0x44000022\n"
+			     "mr %0,3\n"
+			     "mr %1,4\n"
+			     "mr %2,5\n"
+			     "mr %3,6\n"
+			     "mr %4,7\n"
+			     "mr %5,8\n"
+			     "mr %6,9\n"
+			     "mr %7,10\n"
+			     "mr %8,11\n"
+			     "mr %9,12\n":"=r"(regs[0]),
+			     "=r"(regs[1]), "=r"(regs[2]),
+			     "=r"(regs[3]), "=r"(regs[4]),
+			     "=r"(regs[5]), "=r"(regs[6]),
+			     "=r"(regs[7]), "=r"(regs[8]),
+			     "=r"(regs[9])
+			     :"r"(regs[0]), "r"(regs[1]),
+			     "r"(regs[2]), "r"(regs[3]),
+			     "r"(regs[4]), "r"(regs[5]),
+			     "r"(regs[6]), "r"(regs[7]),
+			     "r"(regs[8]), "r"(regs[9])
+			     :"r0", "r2", "r3", "r4", "r5", "r6", "r7",
+			     "r8", "r9", "r10", "r11", "r12", "cc",
+			     "xer", "ctr", "lr", "cr0", "cr1", "cr5",
+			     "cr6", "cr7");
+	*out1 = regs[1];
+	*out2 = regs[2];
+	*out3 = regs[3];
+	*out4 = regs[4];
+	*out5 = regs[5];
+	*out6 = regs[6];
+	*out7 = regs[7];
+	*out8 = regs[8];
+	*out9 = regs[9];
+
+	if (!H_isLongBusy(regs[0]) && regs[0] < 0) {
+		printk(KERN_ERR "HCALL99_IN r3=%lx r4=%lx r5=%lx r6=%lx "
+		       "r7=%lx r8=%lx r9=%lx r10=%lx "
+		       "r11=%lx r12=%lx",
+		       opcode, arg1, arg2, arg3,
+		       arg4, arg5, arg6, arg7,
+		       arg8, arg9);
+		printk(KERN_ERR "HCALL99_OUT r3=%lx r4=%lx r5=%lx "
+		       "r6=%lx r7=%lx r8=%lx r9=%lx r10=%lx "
+		       "r11=%lx r12=lx",
+		       regs[0], regs[1],
+		       regs[2], regs[3],
+		       regs[4], regs[5],
+		       regs[6], regs[7],
+		       regs[8]);
+	}
+	return regs[0];
+}
+
 #endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif
diff -Nurp ofa_kernel-1.2_old/kernel_addons/backport/2.6.9_U5/include/asm-powerpc/system.h ofa_kernel-1.2_new/kernel_addons/backport/2.6.9_U5/include/asm-powerpc/system.h
--- ofa_kernel-1.2_old/kernel_addons/backport/2.6.9_U5/include/asm-powerpc/system.h	1970-01-01 01:00:00.000000000 +0100
+++ ofa_kernel-1.2_new/kernel_addons/backport/2.6.9_U5/include/asm-powerpc/system.h	2007-05-09 12:49:46.000000000 +0200
@@ -0,0 +1 @@
+#include <asm-ppc64/system.h>






More information about the ewg mailing list