changeset 682:650bc638173a

installer: do not duplicate channel related definitions Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Tue, 06 Aug 2019 11:42:57 -0400
parents 140a3182a5b8
children 4fa3b09faa14
files installer/installer/loader.h installer/installer/loader_c.c
diffstat 2 files changed, 1 insertions(+), 190 deletions(-) [+]
line wrap: on
line diff
--- a/installer/installer/loader.h	Tue Aug 06 11:33:14 2019 -0400
+++ b/installer/installer/loader.h	Tue Aug 06 11:42:57 2019 -0400
@@ -2,6 +2,7 @@
 #define __LOADER_H
 
 #include <errno.h>
+#include <channel.h>
 
 /*
  * "Config" values
@@ -48,139 +49,6 @@
 	for(;;);
 }
 
-/*
- * I/O related structs, macros & variables
- */
-struct ccw {
-	u8 cmd;			/* Command code */
-	u8 flags;		/* Flags */
-	u16 count;		/* Count */
-	u32 addr;		/* Data Address */
-} __attribute__((packed,aligned(8)));
-
-#define CCW_FLAG_CD		0x80	/* Chain-Data */
-#define CCW_FLAG_CC		0x40	/* Chain-Command */
-#define CCW_FLAG_SLI		0x20	/* Suppress-Length-Indication */
-#define CCW_FLAG_SKP		0x10	/* Skip */
-#define CCW_FLAG_PCI		0x08	/* Program-Controlled-Interruption */
-#define CCW_FLAG_IDA		0x04	/* Indirect-Data-Address */
-#define CCW_FLAG_S		0x02	/* Suspend */
-#define CCW_FLAG_MIDA		0x01	/* Modified-Indirect-Data-Address */
-
-struct orb {
-	/* word 0 */
-	u32 param;		/* Interruption Parameter */
-
-	/* word 1 */
-	u8 key:4,		/* Subchannel Key */
-	   s:1,			/* Suspend */
-	   c:1,			/* Streaming-Mode Control */
-	   m:1,			/* Modification Control */
-	   y:1;			/* Synchronization Control */
-	u8 f:1,			/* Format Control */
-	   p:1,			/* Prefetch Control */
-	   i:1,			/* Initial-Status-Interruption Control */
-	   a:1,			/* Address-Limit-Checking control */
-	   u:1,			/* Suppress-Suspend-Interruption Control */
-	   __zero1:1,
-	   h:1,			/* Format-2-IDAW Control */
-	   t:1;			/* 2K-IDAW Control */
-	u8 lpm;			/* Logical-Path Mask */
-	u8 l:1,			/* Incorrect-Length-Suppression Mode */
-	   d:1,			/* Modified-CCW-Indirect-Data-Addressing Control */
-	   __zero2:5,
-	   x:1;			/* ORB-Extension Control */
-
-	/* word 2 */
-	u32 addr;		/* Channel-Program Address */
-
-	/* word 3 */
-	u8 css_prio;		/* Channel-Subsystem Priority */
-	u8 __reserved1;
-	u8 cu_prio;		/* Control-Unit Priority */
-	u8 __reserved2;
-
-	/* word 4 - 7 */
-	u32 __reserved3;
-	u32 __reserved4;
-	u32 __reserved5;
-	u32 __reserved6;
-} __attribute__((packed,aligned(4)));
-
-struct scsw {
-	/* word 0 */
-	u16 key:4,		/* Subchannel key */
-	    s:1,		/* Suspend control */
-	    l:1,		/* ESW format */
-	    cc:2,		/* Deferred condition code */
-	    f:1,		/* Format */
-	    p:1,		/* Prefetch */
-	    i:1,		/* Initial-status interruption control */
-	    a:1,		/* Address-limit-checking control */
-	    u:1,		/* Supress-suspended interruption */
-	    z:1,		/* Zero condition code */
-	    e:1,		/* Extended control */
-	    n:1;		/* Path no operational */
-	u16 __zero:1,
-	    fc:3,		/* Function control */
-	    ac:8,		/* Activity control */
-	    sc:4;		/* Status control */
-
-	/* word 1 */
-	u32 addr;		/* CCW Address */
-
-	/* word 2 */
-	u8 dev_status;		/* Device status */
-	u8 sch_status;		/* Subchannel status */
-	u16 count;		/* Count */
-} __attribute__((packed));
-
-/* Path Management Control Word */
-struct pmcw {
-	/* word 0 */
-	u32 interrupt_param;	/* Interruption Parameter */
-
-	/* word 1*/
-	u8 __zero1:2,
-	   isc:3,		/* I/O-Interruption-Subclass Code */
-	   __zero2:3;
-	u8 e:1,			/* Enabled */
-	   lm:2,		/* Limit Mode */
-	   mm:2,		/* Measurement-Mode Enable */
-	   d:1,			/* Multipath Mode */
-	   t:1,			/* Timing Facility */
-	   v:1;			/* Device Number Valid */
-	u16 dev_num;		/* Device Number */
-
-	/* word 2 */
-	u8 lpm;			/* Logical-Path Mask */
-	u8 pnom;		/* Path-Not-Operational Mask */
-	u8 lpum;		/* Last-Path-Used Mask */
-	u8 pim;			/* Path-Installed Mask */
-
-	/* word 3 */
-	u16 mbi;		/* Measurement-Block Index */
-	u8 pom;			/* Path-Operational Mask */
-	u8 pam;			/* Path-Available Mask */
-
-	/* word 4 & 5 */
-	u8 chpid[8];		/* Channel-Path Identifiers */
-
-	/* word 6 */
-	u16 __zero3;
-	u16 __zero4:13,
-	    f:1,		/* Measurement Block Format Control */
-	    x:1,		/* Extended Measurement Word Mode Enable */
-	    s:1;		/* Concurrent Sense */
-};
-
-struct schib {
-	struct pmcw pmcw;		/* Path Management Control Word */
-	struct scsw scsw;		/* Subchannel Status Word */
-	u32 w0, w1;
-	u32 model_dep_area;
-} __attribute__((packed,aligned(4)));
-
 #define ADDR31(x)	((u32) (u64) (x))
 
 extern void wto(char *str);
@@ -202,54 +70,6 @@
 extern u64 con_sch;
 extern u64 dasd_sch;
 
-static inline int store_sch(u32 sch, struct schib *schib)
-{
-	int cc;
-
-	asm volatile(
-		"lr	%%r1,%2\n"
-		"stsch	%1\n"
-		"ipm	%0\n"
-		"srl	%0,28\n"
-		: /* output */
-		  "=d" (cc),
-		  "=Q" (*schib)
-		: /* input */
-		  "d" (sch)
-		: /* clobbered */
-		  "cc", "r1", "memory"
-	);
-
-	if (cc == 3)
-		return -EINVAL;
-	return 0;
-}
-
-static inline int modify_sch(u32 sch, struct schib *schib)
-{
-	int cc;
-
-	asm volatile(
-		"lr	%%r1,%1\n"
-		"msch	%2\n"
-		"ipm	%0\n"
-		"srl	%0,28\n"
-		: /* output */
-		  "=d" (cc)
-		: /* input */
-		  "d" (sch),
-		  "m" (*schib)
-		: /* clobbered */
-		  "cc", "r1"
-	);
-
-	if (cc == 1 || cc == 2)
-		return -EBUSY;
-	if (cc == 3)
-		return -EINVAL;
-	return 0;
-}
-
 extern void unload_archive(void);
 
 /*
--- a/installer/installer/loader_c.c	Tue Aug 06 11:33:14 2019 -0400
+++ b/installer/installer/loader_c.c	Tue Aug 06 11:42:57 2019 -0400
@@ -87,15 +87,6 @@
 		die();
 }
 
-struct senseid_struct {
-	u8 __reserved;
-	u16 cu_type;
-	u8 cu_model;
-	u16 dev_type;
-	u8 dev_model;
-} __attribute__((packed));
-
-
 static int dev_dasd(void)
 {
 	int ret;