瀏覽代碼

s390/cio: Consolidate inline assemblies and related data definitions

Replace the current semi-arbitrary distribution of inline assemblies:
 - Inline assemblies used by CIO go into ioasm.h
 - Data definitions used by inline assemblies go into cio.h

Beyond cleaning up the current structure this is also required for
use of tracepoints in inline assemblies introduced by a follow-on
patch.

Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Acked-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Peter Oberparleiter 9 年之前
父節點
當前提交
2ab59de7c5
共有 5 個文件被更改,包括 73 次插入74 次删除
  1. 0 14
      arch/s390/include/asm/crw.h
  2. 12 0
      drivers/s390/cio/cio.h
  3. 1 0
      drivers/s390/cio/crw.c
  4. 0 45
      drivers/s390/cio/io_sch.h
  5. 60 15
      drivers/s390/cio/ioasm.h

+ 0 - 14
arch/s390/include/asm/crw.h

@@ -52,18 +52,4 @@ void crw_wait_for_channel_report(void);
 #define CRW_ERC_PERRI	 0x07 /* perm. error, facility init */
 #define CRW_ERC_PERRI	 0x07 /* perm. error, facility init */
 #define CRW_ERC_PMOD	 0x08 /* installed parameters modified */
 #define CRW_ERC_PMOD	 0x08 /* installed parameters modified */
 
 
-static inline int stcrw(struct crw *pcrw)
-{
-	int ccode;
-
-	asm volatile(
-		"	stcrw	0(%2)\n"
-		"	ipm	%0\n"
-		"	srl	%0,28\n"
-		: "=d" (ccode), "=m" (*pcrw)
-		: "a" (pcrw)
-		: "cc" );
-	return ccode;
-}
-
 #endif /* _ASM_S390_CRW_H */
 #endif /* _ASM_S390_CRW_H */

+ 12 - 0
drivers/s390/cio/cio.h

@@ -45,6 +45,18 @@ struct pmcw {
 				/*  ... in an operand exception.       */
 				/*  ... in an operand exception.       */
 } __attribute__ ((packed));
 } __attribute__ ((packed));
 
 
+/* I/O-Interruption Code as stored by TEST PENDING INTERRUPTION (TPI). */
+struct tpi_info {
+	struct subchannel_id schid;
+	u32 intparm;
+	u32 adapter_IO:1;
+	u32 :1;
+	u32 isc:3;
+	u32 :27;
+	u32 type:3;
+	u32 :12;
+} __packed __aligned(4);
+
 /* Target SCHIB configuration. */
 /* Target SCHIB configuration. */
 struct schib_config {
 struct schib_config {
 	u64 mba;
 	u64 mba;

+ 1 - 0
drivers/s390/cio/crw.c

@@ -14,6 +14,7 @@
 #include <linux/wait.h>
 #include <linux/wait.h>
 #include <asm/crw.h>
 #include <asm/crw.h>
 #include <asm/ctl_reg.h>
 #include <asm/ctl_reg.h>
+#include "ioasm.h"
 
 
 static DEFINE_MUTEX(crw_handler_mutex);
 static DEFINE_MUTEX(crw_handler_mutex);
 static crw_handler_t crw_handlers[NR_RSCS];
 static crw_handler_t crw_handlers[NR_RSCS];

+ 0 - 45
drivers/s390/cio/io_sch.h

@@ -169,49 +169,4 @@ struct ccw_device_private {
 	enum interruption_class int_class;
 	enum interruption_class int_class;
 };
 };
 
 
-static inline int rsch(struct subchannel_id schid)
-{
-	register struct subchannel_id reg1 asm("1") = schid;
-	int ccode;
-
-	asm volatile(
-		"	rsch\n"
-		"	ipm	%0\n"
-		"	srl	%0,28"
-		: "=d" (ccode)
-		: "d" (reg1)
-		: "cc", "memory");
-	return ccode;
-}
-
-static inline int hsch(struct subchannel_id schid)
-{
-	register struct subchannel_id reg1 asm("1") = schid;
-	int ccode;
-
-	asm volatile(
-		"	hsch\n"
-		"	ipm	%0\n"
-		"	srl	%0,28"
-		: "=d" (ccode)
-		: "d" (reg1)
-		: "cc");
-	return ccode;
-}
-
-static inline int xsch(struct subchannel_id schid)
-{
-	register struct subchannel_id reg1 asm("1") = schid;
-	int ccode;
-
-	asm volatile(
-		"	xsch\n"
-		"	ipm	%0\n"
-		"	srl	%0,28"
-		: "=d" (ccode)
-		: "d" (reg1)
-		: "cc");
-	return ccode;
-}
-
 #endif
 #endif

+ 60 - 15
drivers/s390/cio/ioasm.h

@@ -3,24 +3,10 @@
 
 
 #include <asm/chpid.h>
 #include <asm/chpid.h>
 #include <asm/schid.h>
 #include <asm/schid.h>
+#include <asm/crw.h>
 #include "orb.h"
 #include "orb.h"
 #include "cio.h"
 #include "cio.h"
 
 
-/*
- * TPI info structure
- */
-struct tpi_info {
-	struct subchannel_id schid;
-	__u32 intparm;		 /* interruption parameter */
-	__u32 adapter_IO : 1;
-	__u32 reserved2	 : 1;
-	__u32 isc	 : 3;
-	__u32 reserved3	 : 12;
-	__u32 int_type	 : 3;
-	__u32 reserved4	 : 12;
-} __attribute__ ((packed));
-
-
 /*
 /*
  * Some S390 specific IO instructions as inline
  * Some S390 specific IO instructions as inline
  */
  */
@@ -149,4 +135,63 @@ static inline int rchp(struct chp_id chpid)
 	return ccode;
 	return ccode;
 }
 }
 
 
+static inline int rsch(struct subchannel_id schid)
+{
+	register struct subchannel_id reg1 asm("1") = schid;
+	int ccode;
+
+	asm volatile(
+		"	rsch\n"
+		"	ipm	%0\n"
+		"	srl	%0,28"
+		: "=d" (ccode)
+		: "d" (reg1)
+		: "cc", "memory");
+	return ccode;
+}
+
+static inline int hsch(struct subchannel_id schid)
+{
+	register struct subchannel_id reg1 asm("1") = schid;
+	int ccode;
+
+	asm volatile(
+		"	hsch\n"
+		"	ipm	%0\n"
+		"	srl	%0,28"
+		: "=d" (ccode)
+		: "d" (reg1)
+		: "cc");
+	return ccode;
+}
+
+static inline int xsch(struct subchannel_id schid)
+{
+	register struct subchannel_id reg1 asm("1") = schid;
+	int ccode;
+
+	asm volatile(
+		"	xsch\n"
+		"	ipm	%0\n"
+		"	srl	%0,28"
+		: "=d" (ccode)
+		: "d" (reg1)
+		: "cc");
+	return ccode;
+}
+
+static inline int stcrw(struct crw *crw)
+{
+	int ccode;
+
+	asm volatile(
+		"	stcrw	0(%2)\n"
+		"	ipm	%0\n"
+		"	srl	%0,28\n"
+		: "=d" (ccode), "=m" (*crw)
+		: "a" (crw)
+		: "cc");
+	return ccode;
+}
+
 #endif
 #endif