aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/ioasm.h
diff options
context:
space:
mode:
authorCornelia Huck <cohuck@de.ibm.com>2006-01-06 03:19:21 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 11:33:51 -0500
commita8237fc4108060402d904bea5e1062e22e731969 (patch)
treefc19e33ea8bbe664c33fba6c78b34e497f2cc478 /drivers/s390/cio/ioasm.h
parent8129ee164267dc030b8e1d541ee3643c0b9f2fa1 (diff)
[PATCH] s390: introduce struct subchannel_id
This patch introduces a struct subchannel_id containing the subchannel number (formerly referred to as "irq") and switches code formerly relying on the subchannel number over to it. While we're touching inline assemblies anyway, make sure they have correct memory constraints. Signed-off-by: Cornelia Huck <cohuck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390/cio/ioasm.h')
-rw-r--r--drivers/s390/cio/ioasm.h55
1 files changed, 31 insertions, 24 deletions
diff --git a/drivers/s390/cio/ioasm.h b/drivers/s390/cio/ioasm.h
index 45480a2bc4c0..66c882e52f32 100644
--- a/drivers/s390/cio/ioasm.h
+++ b/drivers/s390/cio/ioasm.h
@@ -1,12 +1,13 @@
1#ifndef S390_CIO_IOASM_H 1#ifndef S390_CIO_IOASM_H
2#define S390_CIO_IOASM_H 2#define S390_CIO_IOASM_H
3 3
4#include "schid.h"
5
4/* 6/*
5 * TPI info structure 7 * TPI info structure
6 */ 8 */
7struct tpi_info { 9struct tpi_info {
8 __u32 reserved1 : 16; /* reserved 0x00000001 */ 10 struct subchannel_id schid;
9 __u32 irq : 16; /* aka. subchannel number */
10 __u32 intparm; /* interruption parameter */ 11 __u32 intparm; /* interruption parameter */
11 __u32 adapter_IO : 1; 12 __u32 adapter_IO : 1;
12 __u32 reserved2 : 1; 13 __u32 reserved2 : 1;
@@ -21,7 +22,8 @@ struct tpi_info {
21 * Some S390 specific IO instructions as inline 22 * Some S390 specific IO instructions as inline
22 */ 23 */
23 24
24static inline int stsch(int irq, volatile struct schib *addr) 25static inline int stsch(struct subchannel_id schid,
26 volatile struct schib *addr)
25{ 27{
26 int ccode; 28 int ccode;
27 29
@@ -31,12 +33,13 @@ static inline int stsch(int irq, volatile struct schib *addr)
31 " ipm %0\n" 33 " ipm %0\n"
32 " srl %0,28" 34 " srl %0,28"
33 : "=d" (ccode) 35 : "=d" (ccode)
34 : "d" (irq | 0x10000), "a" (addr) 36 : "d" (schid), "a" (addr), "m" (*addr)
35 : "cc", "1" ); 37 : "cc", "1" );
36 return ccode; 38 return ccode;
37} 39}
38 40
39static inline int msch(int irq, volatile struct schib *addr) 41static inline int msch(struct subchannel_id schid,
42 volatile struct schib *addr)
40{ 43{
41 int ccode; 44 int ccode;
42 45
@@ -46,12 +49,13 @@ static inline int msch(int irq, volatile struct schib *addr)
46 " ipm %0\n" 49 " ipm %0\n"
47 " srl %0,28" 50 " srl %0,28"
48 : "=d" (ccode) 51 : "=d" (ccode)
49 : "d" (irq | 0x10000L), "a" (addr) 52 : "d" (schid), "a" (addr), "m" (*addr)
50 : "cc", "1" ); 53 : "cc", "1" );
51 return ccode; 54 return ccode;
52} 55}
53 56
54static inline int msch_err(int irq, volatile struct schib *addr) 57static inline int msch_err(struct subchannel_id schid,
58 volatile struct schib *addr)
55{ 59{
56 int ccode; 60 int ccode;
57 61
@@ -74,12 +78,13 @@ static inline int msch_err(int irq, volatile struct schib *addr)
74 ".previous" 78 ".previous"
75#endif 79#endif
76 : "=&d" (ccode) 80 : "=&d" (ccode)
77 : "d" (irq | 0x10000L), "a" (addr), "K" (-EIO) 81 : "d" (schid), "a" (addr), "K" (-EIO), "m" (*addr)
78 : "cc", "1" ); 82 : "cc", "1" );
79 return ccode; 83 return ccode;
80} 84}
81 85
82static inline int tsch(int irq, volatile struct irb *addr) 86static inline int tsch(struct subchannel_id schid,
87 volatile struct irb *addr)
83{ 88{
84 int ccode; 89 int ccode;
85 90
@@ -89,7 +94,7 @@ static inline int tsch(int irq, volatile struct irb *addr)
89 " ipm %0\n" 94 " ipm %0\n"
90 " srl %0,28" 95 " srl %0,28"
91 : "=d" (ccode) 96 : "=d" (ccode)
92 : "d" (irq | 0x10000L), "a" (addr) 97 : "d" (schid), "a" (addr), "m" (*addr)
93 : "cc", "1" ); 98 : "cc", "1" );
94 return ccode; 99 return ccode;
95} 100}
@@ -103,12 +108,13 @@ static inline int tpi( volatile struct tpi_info *addr)
103 " ipm %0\n" 108 " ipm %0\n"
104 " srl %0,28" 109 " srl %0,28"
105 : "=d" (ccode) 110 : "=d" (ccode)
106 : "a" (addr) 111 : "a" (addr), "m" (*addr)
107 : "cc", "1" ); 112 : "cc", "1" );
108 return ccode; 113 return ccode;
109} 114}
110 115
111static inline int ssch(int irq, volatile struct orb *addr) 116static inline int ssch(struct subchannel_id schid,
117 volatile struct orb *addr)
112{ 118{
113 int ccode; 119 int ccode;
114 120
@@ -118,12 +124,12 @@ static inline int ssch(int irq, volatile struct orb *addr)
118 " ipm %0\n" 124 " ipm %0\n"
119 " srl %0,28" 125 " srl %0,28"
120 : "=d" (ccode) 126 : "=d" (ccode)
121 : "d" (irq | 0x10000L), "a" (addr) 127 : "d" (schid), "a" (addr), "m" (*addr)
122 : "cc", "1" ); 128 : "cc", "1" );
123 return ccode; 129 return ccode;
124} 130}
125 131
126static inline int rsch(int irq) 132static inline int rsch(struct subchannel_id schid)
127{ 133{
128 int ccode; 134 int ccode;
129 135
@@ -133,12 +139,12 @@ static inline int rsch(int irq)
133 " ipm %0\n" 139 " ipm %0\n"
134 " srl %0,28" 140 " srl %0,28"
135 : "=d" (ccode) 141 : "=d" (ccode)
136 : "d" (irq | 0x10000L) 142 : "d" (schid)
137 : "cc", "1" ); 143 : "cc", "1" );
138 return ccode; 144 return ccode;
139} 145}
140 146
141static inline int csch(int irq) 147static inline int csch(struct subchannel_id schid)
142{ 148{
143 int ccode; 149 int ccode;
144 150
@@ -148,12 +154,12 @@ static inline int csch(int irq)
148 " ipm %0\n" 154 " ipm %0\n"
149 " srl %0,28" 155 " srl %0,28"
150 : "=d" (ccode) 156 : "=d" (ccode)
151 : "d" (irq | 0x10000L) 157 : "d" (schid)
152 : "cc", "1" ); 158 : "cc", "1" );
153 return ccode; 159 return ccode;
154} 160}
155 161
156static inline int hsch(int irq) 162static inline int hsch(struct subchannel_id schid)
157{ 163{
158 int ccode; 164 int ccode;
159 165
@@ -163,12 +169,12 @@ static inline int hsch(int irq)
163 " ipm %0\n" 169 " ipm %0\n"
164 " srl %0,28" 170 " srl %0,28"
165 : "=d" (ccode) 171 : "=d" (ccode)
166 : "d" (irq | 0x10000L) 172 : "d" (schid)
167 : "cc", "1" ); 173 : "cc", "1" );
168 return ccode; 174 return ccode;
169} 175}
170 176
171static inline int xsch(int irq) 177static inline int xsch(struct subchannel_id schid)
172{ 178{
173 int ccode; 179 int ccode;
174 180
@@ -178,21 +184,22 @@ static inline int xsch(int irq)
178 " ipm %0\n" 184 " ipm %0\n"
179 " srl %0,28" 185 " srl %0,28"
180 : "=d" (ccode) 186 : "=d" (ccode)
181 : "d" (irq | 0x10000L) 187 : "d" (schid)
182 : "cc", "1" ); 188 : "cc", "1" );
183 return ccode; 189 return ccode;
184} 190}
185 191
186static inline int chsc(void *chsc_area) 192static inline int chsc(void *chsc_area)
187{ 193{
194 typedef struct { char _[4096]; } addr_type;
188 int cc; 195 int cc;
189 196
190 __asm__ __volatile__ ( 197 __asm__ __volatile__ (
191 ".insn rre,0xb25f0000,%1,0 \n\t" 198 ".insn rre,0xb25f0000,%2,0 \n\t"
192 "ipm %0 \n\t" 199 "ipm %0 \n\t"
193 "srl %0,28 \n\t" 200 "srl %0,28 \n\t"
194 : "=d" (cc) 201 : "=d" (cc), "=m" (*(addr_type *) chsc_area)
195 : "d" (chsc_area) 202 : "d" (chsc_area), "m" (*(addr_type *) chsc_area)
196 : "cc" ); 203 : "cc" );
197 204
198 return cc; 205 return cc;