cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
016a62
From fc07c126ddd0796c1996b2e527e69486c9c848b9 Mon Sep 17 00:00:00 2001
016a62
From: Thomas Huth <thuth@redhat.com>
016a62
Date: Mon, 14 Oct 2019 10:06:33 +0100
016a62
Subject: [PATCH 08/21] s390-bios: Clean up cio.h
016a62
016a62
RH-Author: Thomas Huth <thuth@redhat.com>
016a62
Message-id: <20191014100645.22862-6-thuth@redhat.com>
016a62
Patchwork-id: 91782
016a62
O-Subject: [RHEL-8.2.0 qemu-kvm PATCH v2 05/17] s390-bios: Clean up cio.h
016a62
Bugzilla: 1664376
016a62
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
016a62
RH-Acked-by: David Hildenbrand <david@redhat.com>
016a62
RH-Acked-by: Jens Freimann <jfreimann@redhat.com>
016a62
016a62
From: "Jason J. Herne" <jjherne@linux.ibm.com>
016a62
016a62
Add proper typedefs to all structs and modify all bit fields to use consistent
016a62
formatting.
016a62
016a62
Signed-off-by: Jason J. Herne <jjherne@linux.ibm.com>
016a62
Reviewed-by: Collin Walling <walling@linux.ibm.com>
016a62
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
016a62
Acked-by: Cornelia Huck <cohuck@redhat.com>
016a62
Reviewed-by: Thomas Huth <thuth@redhat.com>
016a62
Message-Id: <1554388475-18329-5-git-send-email-jjherne@linux.ibm.com>
016a62
Signed-off-by: Thomas Huth <thuth@redhat.com>
016a62
(cherry picked from commit d96c5db77f1058ee9509554f43b945c66b3aa7c9)
016a62
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
016a62
---
016a62
 pc-bios/s390-ccw/cio.h      | 114 ++++++++++++++++++++++----------------------
016a62
 pc-bios/s390-ccw/s390-ccw.h |   8 ----
016a62
 2 files changed, 57 insertions(+), 65 deletions(-)
016a62
016a62
diff --git a/pc-bios/s390-ccw/cio.h b/pc-bios/s390-ccw/cio.h
016a62
index 1a0795f..ed5b2cb 100644
016a62
--- a/pc-bios/s390-ccw/cio.h
016a62
+++ b/pc-bios/s390-ccw/cio.h
016a62
@@ -17,35 +17,35 @@
016a62
  * path management control word
016a62
  */
016a62
 struct pmcw {
016a62
-    __u32 intparm;        /* interruption parameter */
016a62
-    __u32 qf      : 1;    /* qdio facility */
016a62
-    __u32 w       : 1;
016a62
-    __u32 isc     : 3;    /* interruption sublass */
016a62
-    __u32 res5    : 3;    /* reserved zeros */
016a62
-    __u32 ena     : 1;    /* enabled */
016a62
-    __u32 lm      : 2;    /* limit mode */
016a62
-    __u32 mme     : 2;    /* measurement-mode enable */
016a62
-    __u32 mp      : 1;    /* multipath mode */
016a62
-    __u32 tf      : 1;    /* timing facility */
016a62
-    __u32 dnv     : 1;    /* device number valid */
016a62
-    __u32 dev     : 16;   /* device number */
016a62
-    __u8  lpm;            /* logical path mask */
016a62
-    __u8  pnom;           /* path not operational mask */
016a62
-    __u8  lpum;           /* last path used mask */
016a62
-    __u8  pim;            /* path installed mask */
016a62
-    __u16 mbi;            /* measurement-block index */
016a62
-    __u8  pom;            /* path operational mask */
016a62
-    __u8  pam;            /* path available mask */
016a62
-    __u8  chpid[8];       /* CHPID 0-7 (if available) */
016a62
-    __u32 unused1 : 8;    /* reserved zeros */
016a62
-    __u32 st      : 3;    /* subchannel type */
016a62
-    __u32 unused2 : 18;   /* reserved zeros */
016a62
-    __u32 mbfc    : 1;    /* measurement block format control */
016a62
-    __u32 xmwme   : 1;    /* extended measurement word mode enable */
016a62
-    __u32 csense  : 1;    /* concurrent sense; can be enabled ...*/
016a62
-                /*  ... per MSCH, however, if facility */
016a62
-                /*  ... is not installed, this results */
016a62
-                /*  ... in an operand exception.       */
016a62
+    __u32 intparm;      /* interruption parameter */
016a62
+    __u32 qf:1;         /* qdio facility */
016a62
+    __u32 w:1;
016a62
+    __u32 isc:3;        /* interruption sublass */
016a62
+    __u32 res5:3;       /* reserved zeros */
016a62
+    __u32 ena:1;        /* enabled */
016a62
+    __u32 lm:2;         /* limit mode */
016a62
+    __u32 mme:2;        /* measurement-mode enable */
016a62
+    __u32 mp:1;         /* multipath mode */
016a62
+    __u32 tf:1;         /* timing facility */
016a62
+    __u32 dnv:1;        /* device number valid */
016a62
+    __u32 dev:16;       /* device number */
016a62
+    __u8  lpm;          /* logical path mask */
016a62
+    __u8  pnom;         /* path not operational mask */
016a62
+    __u8  lpum;         /* last path used mask */
016a62
+    __u8  pim;          /* path installed mask */
016a62
+    __u16 mbi;          /* measurement-block index */
016a62
+    __u8  pom;          /* path operational mask */
016a62
+    __u8  pam;          /* path available mask */
016a62
+    __u8  chpid[8];     /* CHPID 0-7 (if available) */
016a62
+    __u32 unused1:8;    /* reserved zeros */
016a62
+    __u32 st:3;         /* subchannel type */
016a62
+    __u32 unused2:18;   /* reserved zeros */
016a62
+    __u32 mbfc:1;       /* measurement block format control */
016a62
+    __u32 xmwme:1;      /* extended measurement word mode enable */
016a62
+    __u32 csense:1;     /* concurrent sense; can be enabled ...*/
016a62
+                        /*  ... per MSCH, however, if facility */
016a62
+                        /*  ... is not installed, this results */
016a62
+                        /*  ... in an operand exception.       */
016a62
 } __attribute__ ((packed));
016a62
 
016a62
 /* Target SCHIB configuration. */
016a62
@@ -77,28 +77,28 @@ struct scsw {
016a62
 /*
016a62
  * subchannel information block
016a62
  */
016a62
-struct schib {
016a62
+typedef struct schib {
016a62
     struct pmcw pmcw;     /* path management control word */
016a62
     struct scsw scsw;     /* subchannel status word */
016a62
     __u64 mba;            /* measurement block address */
016a62
     __u8 mda[4];          /* model dependent area */
016a62
-} __attribute__ ((packed,aligned(4)));
016a62
-
016a62
-struct subchannel_id {
016a62
-        __u32 cssid  : 8;
016a62
-        __u32        : 4;
016a62
-        __u32 m      : 1;
016a62
-        __u32 ssid   : 2;
016a62
-        __u32 one    : 1;
016a62
-        __u32 sch_no : 16;
016a62
-} __attribute__ ((packed, aligned(4)));
016a62
+} __attribute__ ((packed, aligned(4))) Schib;
016a62
+
016a62
+typedef struct subchannel_id {
016a62
+        __u32 cssid:8;
016a62
+        __u32:4;
016a62
+        __u32 m:1;
016a62
+        __u32 ssid:2;
016a62
+        __u32 one:1;
016a62
+        __u32 sch_no:16;
016a62
+} __attribute__ ((packed, aligned(4))) SubChannelId;
016a62
 
016a62
 struct chsc_header {
016a62
     __u16 length;
016a62
     __u16 code;
016a62
 } __attribute__((packed));
016a62
 
016a62
-struct chsc_area_sda {
016a62
+typedef struct chsc_area_sda {
016a62
     struct chsc_header request;
016a62
     __u8 reserved1:4;
016a62
     __u8 format:4;
016a62
@@ -111,29 +111,29 @@ struct chsc_area_sda {
016a62
     __u32 reserved5:4;
016a62
     __u32 format2:4;
016a62
     __u32 reserved6:24;
016a62
-} __attribute__((packed));
016a62
+} __attribute__((packed)) ChscAreaSda;
016a62
 
016a62
 /*
016a62
  * TPI info structure
016a62
  */
016a62
 struct tpi_info {
016a62
     struct subchannel_id schid;
016a62
-    __u32 intparm;         /* interruption parameter */
016a62
-    __u32 adapter_IO : 1;
016a62
-    __u32 reserved2  : 1;
016a62
-    __u32 isc        : 3;
016a62
-    __u32 reserved3  : 12;
016a62
-    __u32 int_type   : 3;
016a62
-    __u32 reserved4  : 12;
016a62
+    __u32 intparm;      /* interruption parameter */
016a62
+    __u32 adapter_IO:1;
016a62
+    __u32 reserved2:1;
016a62
+    __u32 isc:3;
016a62
+    __u32 reserved3:12;
016a62
+    __u32 int_type:3;
016a62
+    __u32 reserved4:12;
016a62
 } __attribute__ ((packed, aligned(4)));
016a62
 
016a62
 /* channel command word (type 1) */
016a62
-struct ccw1 {
016a62
+typedef struct ccw1 {
016a62
     __u8 cmd_code;
016a62
     __u8 flags;
016a62
     __u16 count;
016a62
     __u32 cda;
016a62
-} __attribute__ ((packed, aligned(8)));
016a62
+} __attribute__ ((packed, aligned(8))) Ccw1;
016a62
 
016a62
 #define CCW_FLAG_DC              0x80
016a62
 #define CCW_FLAG_CC              0x40
016a62
@@ -162,7 +162,7 @@ struct ccw1 {
016a62
 /*
016a62
  * Command-mode operation request block
016a62
  */
016a62
-struct cmd_orb {
016a62
+typedef struct cmd_orb {
016a62
     __u32 intparm;    /* interruption parameter */
016a62
     __u32 key:4;      /* flags, like key, suspend control, etc. */
016a62
     __u32 spnd:1;     /* suspend control */
016a62
@@ -182,7 +182,7 @@ struct cmd_orb {
016a62
     __u32 zero:6;     /* reserved zeros */
016a62
     __u32 orbx:1;     /* ORB extension control */
016a62
     __u32 cpa;    /* channel program address */
016a62
-}  __attribute__ ((packed, aligned(4)));
016a62
+}  __attribute__ ((packed, aligned(4))) CmdOrb;
016a62
 
016a62
 struct ciw {
016a62
     __u8 type;
016a62
@@ -193,7 +193,7 @@ struct ciw {
016a62
 /*
016a62
  * sense-id response buffer layout
016a62
  */
016a62
-struct senseid {
016a62
+typedef struct senseid {
016a62
     /* common part */
016a62
     __u8  reserved;   /* always 0x'FF' */
016a62
     __u16 cu_type;    /* control unit type */
016a62
@@ -203,15 +203,15 @@ struct senseid {
016a62
     __u8  unused;     /* padding byte */
016a62
     /* extended part */
016a62
     struct ciw ciw[62];
016a62
-}  __attribute__ ((packed, aligned(4)));
016a62
+}  __attribute__ ((packed, aligned(4))) SenseId;
016a62
 
016a62
 /* interruption response block */
016a62
-struct irb {
016a62
+typedef struct irb {
016a62
     struct scsw scsw;
016a62
     __u32 esw[5];
016a62
     __u32 ecw[8];
016a62
     __u32 emw[8];
016a62
-}  __attribute__ ((packed, aligned(4)));
016a62
+}  __attribute__ ((packed, aligned(4))) Irb;
016a62
 
016a62
 /*
016a62
  * Some S390 specific IO instructions as inline
016a62
diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
016a62
index 9828aa2..241c6d0 100644
016a62
--- a/pc-bios/s390-ccw/s390-ccw.h
016a62
+++ b/pc-bios/s390-ccw/s390-ccw.h
016a62
@@ -49,14 +49,6 @@ typedef unsigned long long __u64;
016a62
 #include "cio.h"
016a62
 #include "iplb.h"
016a62
 
016a62
-typedef struct irb Irb;
016a62
-typedef struct ccw1 Ccw1;
016a62
-typedef struct cmd_orb CmdOrb;
016a62
-typedef struct schib Schib;
016a62
-typedef struct chsc_area_sda ChscAreaSda;
016a62
-typedef struct senseid SenseId;
016a62
-typedef struct subchannel_id SubChannelId;
016a62
-
016a62
 /* start.s */
016a62
 void disabled_wait(void);
016a62
 void consume_sclp_int(void);
016a62
-- 
016a62
1.8.3.1
016a62