aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-s390
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-s390')
-rw-r--r--include/asm-s390/a.out.h1
-rw-r--r--include/asm-s390/atomic.h26
-rw-r--r--include/asm-s390/bug.h2
-rw-r--r--include/asm-s390/cache.h2
-rw-r--r--include/asm-s390/ccwdev.h82
-rw-r--r--include/asm-s390/ccwgroup.h32
-rw-r--r--include/asm-s390/cio.h303
-rw-r--r--include/asm-s390/cmb.h73
-rw-r--r--include/asm-s390/diag.h39
-rw-r--r--include/asm-s390/kprobes.h2
-rw-r--r--include/asm-s390/page.h3
-rw-r--r--include/asm-s390/percpu.h7
-rw-r--r--include/asm-s390/pgalloc.h2
-rw-r--r--include/asm-s390/pgtable.h13
-rw-r--r--include/asm-s390/s390_ext.h10
-rw-r--r--include/asm-s390/smp.h11
-rw-r--r--include/asm-s390/system.h34
-rw-r--r--include/asm-s390/unistd.h2
-rw-r--r--include/asm-s390/zcrypt.h4
19 files changed, 384 insertions, 264 deletions
diff --git a/include/asm-s390/a.out.h b/include/asm-s390/a.out.h
index 72adee6ef338..46158dcaf517 100644
--- a/include/asm-s390/a.out.h
+++ b/include/asm-s390/a.out.h
@@ -32,6 +32,7 @@ struct exec
32#ifdef __KERNEL__ 32#ifdef __KERNEL__
33 33
34#define STACK_TOP TASK_SIZE 34#define STACK_TOP TASK_SIZE
35#define STACK_TOP_MAX DEFAULT_TASK_SIZE
35 36
36#endif 37#endif
37 38
diff --git a/include/asm-s390/atomic.h b/include/asm-s390/atomic.h
index ea486952f778..2d184655bc5d 100644
--- a/include/asm-s390/atomic.h
+++ b/include/asm-s390/atomic.h
@@ -67,8 +67,17 @@ typedef struct {
67 67
68#endif /* __GNUC__ */ 68#endif /* __GNUC__ */
69 69
70#define atomic_read(v) ((v)->counter) 70static inline int atomic_read(const atomic_t *v)
71#define atomic_set(v,i) (((v)->counter) = (i)) 71{
72 barrier();
73 return v->counter;
74}
75
76static inline void atomic_set(atomic_t *v, int i)
77{
78 v->counter = i;
79 barrier();
80}
72 81
73static __inline__ int atomic_add_return(int i, atomic_t * v) 82static __inline__ int atomic_add_return(int i, atomic_t * v)
74{ 83{
@@ -182,8 +191,17 @@ typedef struct {
182 191
183#endif /* __GNUC__ */ 192#endif /* __GNUC__ */
184 193
185#define atomic64_read(v) ((v)->counter) 194static inline long long atomic64_read(const atomic64_t *v)
186#define atomic64_set(v,i) (((v)->counter) = (i)) 195{
196 barrier();
197 return v->counter;
198}
199
200static inline void atomic64_set(atomic64_t *v, long long i)
201{
202 v->counter = i;
203 barrier();
204}
187 205
188static __inline__ long long atomic64_add_return(long long i, atomic64_t * v) 206static __inline__ long long atomic64_add_return(long long i, atomic64_t * v)
189{ 207{
diff --git a/include/asm-s390/bug.h b/include/asm-s390/bug.h
index 838684dc6d35..384e3621e341 100644
--- a/include/asm-s390/bug.h
+++ b/include/asm-s390/bug.h
@@ -50,7 +50,7 @@
50#define BUG() __EMIT_BUG(0) 50#define BUG() __EMIT_BUG(0)
51 51
52#define WARN_ON(x) ({ \ 52#define WARN_ON(x) ({ \
53 typeof(x) __ret_warn_on = (x); \ 53 int __ret_warn_on = !!(x); \
54 if (__builtin_constant_p(__ret_warn_on)) { \ 54 if (__builtin_constant_p(__ret_warn_on)) { \
55 if (__ret_warn_on) \ 55 if (__ret_warn_on) \
56 __EMIT_BUG(BUGFLAG_WARNING); \ 56 __EMIT_BUG(BUGFLAG_WARNING); \
diff --git a/include/asm-s390/cache.h b/include/asm-s390/cache.h
index cdf431b061bb..9b866816863c 100644
--- a/include/asm-s390/cache.h
+++ b/include/asm-s390/cache.h
@@ -14,8 +14,6 @@
14#define L1_CACHE_BYTES 256 14#define L1_CACHE_BYTES 256
15#define L1_CACHE_SHIFT 8 15#define L1_CACHE_SHIFT 8
16 16
17#define ARCH_KMALLOC_MINALIGN 8
18
19#define __read_mostly __attribute__((__section__(".data.read_mostly"))) 17#define __read_mostly __attribute__((__section__(".data.read_mostly")))
20 18
21#endif 19#endif
diff --git a/include/asm-s390/ccwdev.h b/include/asm-s390/ccwdev.h
index 4c2e1710f157..066aa70518ce 100644
--- a/include/asm-s390/ccwdev.h
+++ b/include/asm-s390/ccwdev.h
@@ -67,36 +67,55 @@ ccw_device_id_match(const struct ccw_device_id *array,
67 return NULL; 67 return NULL;
68} 68}
69 69
70/* The struct ccw device is our replacement for the globally accessible 70/**
71 * ioinfo array. ioinfo will mutate into a subchannel device later. 71 * struct ccw_device - channel attached device
72 * @ccwlock: pointer to device lock
73 * @id: id of this device
74 * @drv: ccw driver for this device
75 * @dev: embedded device structure
76 * @online: online status of device
77 * @handler: interrupt handler
72 * 78 *
73 * Reference: Documentation/s390/driver-model.txt */ 79 * @handler is a member of the device rather than the driver since a driver
80 * can have different interrupt handlers for different ccw devices
81 * (multi-subchannel drivers).
82 */
74struct ccw_device { 83struct ccw_device {
75 spinlock_t *ccwlock; 84 spinlock_t *ccwlock;
85/* private: */
76 struct ccw_device_private *private; /* cio private information */ 86 struct ccw_device_private *private; /* cio private information */
77 struct ccw_device_id id; /* id of this device, driver_info is 87/* public: */
78 set by ccw_find_driver */ 88 struct ccw_device_id id;
79 struct ccw_driver *drv; /* */ 89 struct ccw_driver *drv;
80 struct device dev; /* */ 90 struct device dev;
81 int online; 91 int online;
82 /* This is sick, but a driver can have different interrupt handlers
83 for different ccw_devices (multi-subchannel drivers)... */
84 void (*handler) (struct ccw_device *, unsigned long, struct irb *); 92 void (*handler) (struct ccw_device *, unsigned long, struct irb *);
85}; 93};
86 94
87 95
88/* Each ccw driver registers with the ccw root bus */ 96/**
97 * struct ccw driver - device driver for channel attached devices
98 * @owner: owning module
99 * @ids: ids supported by this driver
100 * @probe: function called on probe
101 * @remove: function called on remove
102 * @set_online: called when setting device online
103 * @set_offline: called when setting device offline
104 * @notify: notify driver of device state changes
105 * @shutdown: called at device shutdown
106 * @driver: embedded device driver structure
107 * @name: device driver name
108 */
89struct ccw_driver { 109struct ccw_driver {
90 struct module *owner; /* for automatic MOD_INC_USE_COUNT */ 110 struct module *owner;
91 struct ccw_device_id *ids; /* probe driver with these devs */ 111 struct ccw_device_id *ids;
92 int (*probe) (struct ccw_device *); /* ask driver to probe dev */ 112 int (*probe) (struct ccw_device *);
93 void (*remove) (struct ccw_device *); 113 void (*remove) (struct ccw_device *);
94 /* device is no longer available */
95 int (*set_online) (struct ccw_device *); 114 int (*set_online) (struct ccw_device *);
96 int (*set_offline) (struct ccw_device *); 115 int (*set_offline) (struct ccw_device *);
97 int (*notify) (struct ccw_device *, int); 116 int (*notify) (struct ccw_device *, int);
98 struct device_driver driver; /* higher level structure, don't init 117 void (*shutdown) (struct ccw_device *);
99 this from your driver */ 118 struct device_driver driver;
100 char *name; 119 char *name;
101}; 120};
102 121
@@ -124,36 +143,10 @@ extern void ccw_device_clear_options(struct ccw_device *, unsigned long);
124/* Allow forced onlining of boxed devices. */ 143/* Allow forced onlining of boxed devices. */
125#define CCWDEV_ALLOW_FORCE 0x0008 144#define CCWDEV_ALLOW_FORCE 0x0008
126 145
127/*
128 * ccw_device_start()
129 *
130 * Start a S/390 channel program. When the interrupt arrives, the
131 * IRQ handler is called, either immediately, delayed (dev-end missing,
132 * or sense required) or never (no IRQ handler registered).
133 * Depending on the action taken, ccw_device_start() returns:
134 * 0 - Success
135 * -EBUSY - Device busy, or status pending
136 * -ENODEV - Device not operational
137 * -EINVAL - Device invalid for operation
138 */
139extern int ccw_device_start(struct ccw_device *, struct ccw1 *, 146extern int ccw_device_start(struct ccw_device *, struct ccw1 *,
140 unsigned long, __u8, unsigned long); 147 unsigned long, __u8, unsigned long);
141/*
142 * ccw_device_start_timeout()
143 *
144 * This function notifies the device driver if the channel program has not
145 * completed during the specified time. If a timeout occurs, the channel
146 * program is terminated via xsch(), hsch() or csch().
147 */
148extern int ccw_device_start_timeout(struct ccw_device *, struct ccw1 *, 148extern int ccw_device_start_timeout(struct ccw_device *, struct ccw1 *,
149 unsigned long, __u8, unsigned long, int); 149 unsigned long, __u8, unsigned long, int);
150/*
151 * ccw_device_start_key()
152 * ccw_device_start_key_timeout()
153 *
154 * Same as ccw_device_start() and ccw_device_start_timeout(), except a
155 * storage key != default key can be provided for the I/O.
156 */
157extern int ccw_device_start_key(struct ccw_device *, struct ccw1 *, 150extern int ccw_device_start_key(struct ccw_device *, struct ccw1 *,
158 unsigned long, __u8, __u8, unsigned long); 151 unsigned long, __u8, __u8, unsigned long);
159extern int ccw_device_start_timeout_key(struct ccw_device *, struct ccw1 *, 152extern int ccw_device_start_timeout_key(struct ccw_device *, struct ccw1 *,
@@ -165,11 +158,6 @@ extern int ccw_device_resume(struct ccw_device *);
165extern int ccw_device_halt(struct ccw_device *, unsigned long); 158extern int ccw_device_halt(struct ccw_device *, unsigned long);
166extern int ccw_device_clear(struct ccw_device *, unsigned long); 159extern int ccw_device_clear(struct ccw_device *, unsigned long);
167 160
168extern int __deprecated read_dev_chars(struct ccw_device *cdev, void **buffer, int length);
169extern int __deprecated read_conf_data(struct ccw_device *cdev, void **buffer, int *length);
170extern int __deprecated read_conf_data_lpm(struct ccw_device *cdev, void **buffer,
171 int *length, __u8 lpm);
172
173extern int ccw_device_set_online(struct ccw_device *cdev); 161extern int ccw_device_set_online(struct ccw_device *cdev);
174extern int ccw_device_set_offline(struct ccw_device *cdev); 162extern int ccw_device_set_offline(struct ccw_device *cdev);
175 163
diff --git a/include/asm-s390/ccwgroup.h b/include/asm-s390/ccwgroup.h
index 925b3ddfa141..7109c7cab87e 100644
--- a/include/asm-s390/ccwgroup.h
+++ b/include/asm-s390/ccwgroup.h
@@ -4,19 +4,41 @@
4struct ccw_device; 4struct ccw_device;
5struct ccw_driver; 5struct ccw_driver;
6 6
7/**
8 * struct ccwgroup_device - ccw group device
9 * @creator_id: unique number of the driver
10 * @state: online/offline state
11 * @count: number of attached slave devices
12 * @dev: embedded device structure
13 * @cdev: variable number of slave devices, allocated as needed
14 */
7struct ccwgroup_device { 15struct ccwgroup_device {
8 unsigned long creator_id; /* unique number of the driver */ 16 unsigned long creator_id;
9 enum { 17 enum {
10 CCWGROUP_OFFLINE, 18 CCWGROUP_OFFLINE,
11 CCWGROUP_ONLINE, 19 CCWGROUP_ONLINE,
12 } state; 20 } state;
21/* private: */
13 atomic_t onoff; 22 atomic_t onoff;
14 struct mutex reg_mutex; 23 struct mutex reg_mutex;
15 unsigned int count; /* number of attached slave devices */ 24/* public: */
16 struct device dev; /* master device */ 25 unsigned int count;
17 struct ccw_device *cdev[0]; /* variable number, allocate as needed */ 26 struct device dev;
27 struct ccw_device *cdev[0];
18}; 28};
19 29
30/**
31 * struct ccwgroup_driver - driver for ccw group devices
32 * @owner: driver owner
33 * @name: driver name
34 * @max_slaves: maximum number of slave devices
35 * @driver_id: unique id
36 * @probe: function called on probe
37 * @remove: function called on remove
38 * @set_online: function called when device is set online
39 * @set_offline: function called when device is set offline
40 * @driver: embedded driver structure
41 */
20struct ccwgroup_driver { 42struct ccwgroup_driver {
21 struct module *owner; 43 struct module *owner;
22 char *name; 44 char *name;
@@ -28,7 +50,7 @@ struct ccwgroup_driver {
28 int (*set_online) (struct ccwgroup_device *); 50 int (*set_online) (struct ccwgroup_device *);
29 int (*set_offline) (struct ccwgroup_device *); 51 int (*set_offline) (struct ccwgroup_device *);
30 52
31 struct device_driver driver; /* this driver */ 53 struct device_driver driver;
32}; 54};
33 55
34extern int ccwgroup_driver_register (struct ccwgroup_driver *cdriver); 56extern int ccwgroup_driver_register (struct ccwgroup_driver *cdriver);
diff --git a/include/asm-s390/cio.h b/include/asm-s390/cio.h
index f738d2827582..2f08c16e44ad 100644
--- a/include/asm-s390/cio.h
+++ b/include/asm-s390/cio.h
@@ -15,30 +15,50 @@
15#define LPM_ANYPATH 0xff 15#define LPM_ANYPATH 0xff
16#define __MAX_CSSID 0 16#define __MAX_CSSID 0
17 17
18/* 18/**
19 * subchannel status word 19 * struct scsw - subchannel status word
20 * @key: subchannel key
21 * @sctl: suspend control
22 * @eswf: esw format
23 * @cc: deferred condition code
24 * @fmt: format
25 * @pfch: prefetch
26 * @isic: initial-status interruption control
27 * @alcc: adress-limit checking control
28 * @ssi: supress-suspended interruption
29 * @zcc: zero condition code
30 * @ectl: extended control
31 * @pno: path not operational
32 * @res: reserved
33 * @fctl: function control
34 * @actl: activity control
35 * @stctl: status control
36 * @cpa: channel program address
37 * @dstat: device status
38 * @cstat: subchannel status
39 * @count: residual count
20 */ 40 */
21struct scsw { 41struct scsw {
22 __u32 key : 4; /* subchannel key */ 42 __u32 key : 4;
23 __u32 sctl : 1; /* suspend control */ 43 __u32 sctl : 1;
24 __u32 eswf : 1; /* ESW format */ 44 __u32 eswf : 1;
25 __u32 cc : 2; /* deferred condition code */ 45 __u32 cc : 2;
26 __u32 fmt : 1; /* format */ 46 __u32 fmt : 1;
27 __u32 pfch : 1; /* prefetch */ 47 __u32 pfch : 1;
28 __u32 isic : 1; /* initial-status interruption control */ 48 __u32 isic : 1;
29 __u32 alcc : 1; /* address-limit checking control */ 49 __u32 alcc : 1;
30 __u32 ssi : 1; /* supress-suspended interruption */ 50 __u32 ssi : 1;
31 __u32 zcc : 1; /* zero condition code */ 51 __u32 zcc : 1;
32 __u32 ectl : 1; /* extended control */ 52 __u32 ectl : 1;
33 __u32 pno : 1; /* path not operational */ 53 __u32 pno : 1;
34 __u32 res : 1; /* reserved */ 54 __u32 res : 1;
35 __u32 fctl : 3; /* function control */ 55 __u32 fctl : 3;
36 __u32 actl : 7; /* activity control */ 56 __u32 actl : 7;
37 __u32 stctl : 5; /* status control */ 57 __u32 stctl : 5;
38 __u32 cpa; /* channel program address */ 58 __u32 cpa;
39 __u32 dstat : 8; /* device status */ 59 __u32 dstat : 8;
40 __u32 cstat : 8; /* subchannel status */ 60 __u32 cstat : 8;
41 __u32 count : 16; /* residual count */ 61 __u32 count : 16;
42} __attribute__ ((packed)); 62} __attribute__ ((packed));
43 63
44#define SCSW_FCTL_CLEAR_FUNC 0x1 64#define SCSW_FCTL_CLEAR_FUNC 0x1
@@ -110,11 +130,22 @@ struct scsw {
110#define SNS2_ENV_DATA_PRESENT 0x10 130#define SNS2_ENV_DATA_PRESENT 0x10
111#define SNS2_INPRECISE_END 0x04 131#define SNS2_INPRECISE_END 0x04
112 132
133/**
134 * struct ccw1 - channel command word
135 * @cmd_code: command code
136 * @flags: flags, like IDA adressing, etc.
137 * @count: byte count
138 * @cda: data address
139 *
140 * The ccw is the basic structure to build channel programs that perform
141 * operations with the device or the control unit. Only Format-1 channel
142 * command words are supported.
143 */
113struct ccw1 { 144struct ccw1 {
114 __u8 cmd_code; /* command code */ 145 __u8 cmd_code;
115 __u8 flags; /* flags, like IDA addressing, etc. */ 146 __u8 flags;
116 __u16 count; /* byte count */ 147 __u16 count;
117 __u32 cda; /* data address */ 148 __u32 cda;
118} __attribute__ ((packed,aligned(8))); 149} __attribute__ ((packed,aligned(8)));
119 150
120#define CCW_FLAG_DC 0x80 151#define CCW_FLAG_DC 0x80
@@ -140,102 +171,162 @@ struct ccw1 {
140 171
141#define SENSE_MAX_COUNT 0x20 172#define SENSE_MAX_COUNT 0x20
142 173
174/**
175 * struct erw - extended report word
176 * @res0: reserved
177 * @auth: authorization check
178 * @pvrf: path-verification-required flag
179 * @cpt: channel-path timeout
180 * @fsavf: failing storage address validity flag
181 * @cons: concurrent sense
182 * @scavf: secondary ccw address validity flag
183 * @fsaf: failing storage address format
184 * @scnt: sense count, if @cons == %1
185 * @res16: reserved
186 */
143struct erw { 187struct erw {
144 __u32 res0 : 3; /* reserved */ 188 __u32 res0 : 3;
145 __u32 auth : 1; /* Authorization check */ 189 __u32 auth : 1;
146 __u32 pvrf : 1; /* path-verification-required flag */ 190 __u32 pvrf : 1;
147 __u32 cpt : 1; /* channel-path timeout */ 191 __u32 cpt : 1;
148 __u32 fsavf : 1; /* Failing storage address validity flag */ 192 __u32 fsavf : 1;
149 __u32 cons : 1; /* concurrent-sense */ 193 __u32 cons : 1;
150 __u32 scavf : 1; /* Secondary ccw address validity flag */ 194 __u32 scavf : 1;
151 __u32 fsaf : 1; /* Failing storage address format */ 195 __u32 fsaf : 1;
152 __u32 scnt : 6; /* sense count if cons == 1 */ 196 __u32 scnt : 6;
153 __u32 res16 : 16; /* reserved */ 197 __u32 res16 : 16;
154} __attribute__ ((packed)); 198} __attribute__ ((packed));
155 199
156/* 200/**
157 * subchannel logout area 201 * struct sublog - subchannel logout area
202 * @res0: reserved
203 * @esf: extended status flags
204 * @lpum: last path used mask
205 * @arep: ancillary report
206 * @fvf: field-validity flags
207 * @sacc: storage access code
208 * @termc: termination code
209 * @devsc: device-status check
210 * @serr: secondary error
211 * @ioerr: i/o-error alert
212 * @seqc: sequence code
158 */ 213 */
159struct sublog { 214struct sublog {
160 __u32 res0 : 1; /* reserved */ 215 __u32 res0 : 1;
161 __u32 esf : 7; /* extended status flags */ 216 __u32 esf : 7;
162 __u32 lpum : 8; /* last path used mask */ 217 __u32 lpum : 8;
163 __u32 arep : 1; /* ancillary report */ 218 __u32 arep : 1;
164 __u32 fvf : 5; /* field-validity flags */ 219 __u32 fvf : 5;
165 __u32 sacc : 2; /* storage access code */ 220 __u32 sacc : 2;
166 __u32 termc : 2; /* termination code */ 221 __u32 termc : 2;
167 __u32 devsc : 1; /* device-status check */ 222 __u32 devsc : 1;
168 __u32 serr : 1; /* secondary error */ 223 __u32 serr : 1;
169 __u32 ioerr : 1; /* i/o-error alert */ 224 __u32 ioerr : 1;
170 __u32 seqc : 3; /* sequence code */ 225 __u32 seqc : 3;
171} __attribute__ ((packed)); 226} __attribute__ ((packed));
172 227
173/* 228/**
174 * Format 0 Extended Status Word (ESW) 229 * struct esw0 - Format 0 Extended Status Word (ESW)
230 * @sublog: subchannel logout
231 * @erw: extended report word
232 * @faddr: failing storage address
233 * @saddr: secondary ccw address
175 */ 234 */
176struct esw0 { 235struct esw0 {
177 struct sublog sublog; /* subchannel logout */ 236 struct sublog sublog;
178 struct erw erw; /* extended report word */ 237 struct erw erw;
179 __u32 faddr[2]; /* failing storage address */ 238 __u32 faddr[2];
180 __u32 saddr; /* secondary ccw address */ 239 __u32 saddr;
181} __attribute__ ((packed)); 240} __attribute__ ((packed));
182 241
183/* 242/**
184 * Format 1 Extended Status Word (ESW) 243 * struct esw1 - Format 1 Extended Status Word (ESW)
244 * @zero0: reserved zeros
245 * @lpum: last path used mask
246 * @zero16: reserved zeros
247 * @erw: extended report word
248 * @zeros: three fullwords of zeros
185 */ 249 */
186struct esw1 { 250struct esw1 {
187 __u8 zero0; /* reserved zeros */ 251 __u8 zero0;
188 __u8 lpum; /* last path used mask */ 252 __u8 lpum;
189 __u16 zero16; /* reserved zeros */ 253 __u16 zero16;
190 struct erw erw; /* extended report word */ 254 struct erw erw;
191 __u32 zeros[3]; /* 2 fullwords of zeros */ 255 __u32 zeros[3];
192} __attribute__ ((packed)); 256} __attribute__ ((packed));
193 257
194/* 258/**
195 * Format 2 Extended Status Word (ESW) 259 * struct esw2 - Format 2 Extended Status Word (ESW)
260 * @zero0: reserved zeros
261 * @lpum: last path used mask
262 * @dcti: device-connect-time interval
263 * @erw: extended report word
264 * @zeros: three fullwords of zeros
196 */ 265 */
197struct esw2 { 266struct esw2 {
198 __u8 zero0; /* reserved zeros */ 267 __u8 zero0;
199 __u8 lpum; /* last path used mask */ 268 __u8 lpum;
200 __u16 dcti; /* device-connect-time interval */ 269 __u16 dcti;
201 struct erw erw; /* extended report word */ 270 struct erw erw;
202 __u32 zeros[3]; /* 2 fullwords of zeros */ 271 __u32 zeros[3];
203} __attribute__ ((packed)); 272} __attribute__ ((packed));
204 273
205/* 274/**
206 * Format 3 Extended Status Word (ESW) 275 * struct esw3 - Format 3 Extended Status Word (ESW)
276 * @zero0: reserved zeros
277 * @lpum: last path used mask
278 * @res: reserved
279 * @erw: extended report word
280 * @zeros: three fullwords of zeros
207 */ 281 */
208struct esw3 { 282struct esw3 {
209 __u8 zero0; /* reserved zeros */ 283 __u8 zero0;
210 __u8 lpum; /* last path used mask */ 284 __u8 lpum;
211 __u16 res; /* reserved */ 285 __u16 res;
212 struct erw erw; /* extended report word */ 286 struct erw erw;
213 __u32 zeros[3]; /* 2 fullwords of zeros */ 287 __u32 zeros[3];
214} __attribute__ ((packed)); 288} __attribute__ ((packed));
215 289
216/* 290/**
217 * interruption response block 291 * struct irb - interruption response block
292 * @scsw: subchannel status word
293 * @esw: extened status word, 4 formats
294 * @ecw: extended control word
295 *
296 * The irb that is handed to the device driver when an interrupt occurs. For
297 * solicited interrupts, the common I/O layer already performs checks whether
298 * a field is valid; a field not being valid is always passed as %0.
299 * If a unit check occured, @ecw may contain sense data; this is retrieved
300 * by the common I/O layer itself if the device doesn't support concurrent
301 * sense (so that the device driver never needs to perform basic sene itself).
302 * For unsolicited interrupts, the irb is passed as-is (expect for sense data,
303 * if applicable).
218 */ 304 */
219struct irb { 305struct irb {
220 struct scsw scsw; /* subchannel status word */ 306 struct scsw scsw;
221 union { /* extended status word, 4 formats */ 307 union {
222 struct esw0 esw0; 308 struct esw0 esw0;
223 struct esw1 esw1; 309 struct esw1 esw1;
224 struct esw2 esw2; 310 struct esw2 esw2;
225 struct esw3 esw3; 311 struct esw3 esw3;
226 } esw; 312 } esw;
227 __u8 ecw[32]; /* extended control word */ 313 __u8 ecw[32];
228} __attribute__ ((packed,aligned(4))); 314} __attribute__ ((packed,aligned(4)));
229 315
230/* 316/**
231 * command information word (CIW) layout 317 * struct ciw - command information word (CIW) layout
318 * @et: entry type
319 * @reserved: reserved bits
320 * @ct: command type
321 * @cmd: command code
322 * @count: command count
232 */ 323 */
233struct ciw { 324struct ciw {
234 __u32 et : 2; /* entry type */ 325 __u32 et : 2;
235 __u32 reserved : 2; /* reserved */ 326 __u32 reserved : 2;
236 __u32 ct : 4; /* command type */ 327 __u32 ct : 4;
237 __u32 cmd : 8; /* command */ 328 __u32 cmd : 8;
238 __u32 count : 16; /* coun */ 329 __u32 count : 16;
239} __attribute__ ((packed)); 330} __attribute__ ((packed));
240 331
241#define CIW_TYPE_RCD 0x0 /* read configuration data */ 332#define CIW_TYPE_RCD 0x0 /* read configuration data */
@@ -258,24 +349,32 @@ struct ciw {
258/* Sick revalidation of device. */ 349/* Sick revalidation of device. */
259#define CIO_REVALIDATE 0x0008 350#define CIO_REVALIDATE 0x0008
260 351
261struct diag210 { 352/**
262 __u16 vrdcdvno : 16; /* device number (input) */ 353 * struct ccw_dev_id - unique identifier for ccw devices
263 __u16 vrdclen : 16; /* data block length (input) */ 354 * @ssid: subchannel set id
264 __u32 vrdcvcla : 8; /* virtual device class (output) */ 355 * @devno: device number
265 __u32 vrdcvtyp : 8; /* virtual device type (output) */ 356 *
266 __u32 vrdcvsta : 8; /* virtual device status (output) */ 357 * This structure is not directly based on any hardware structure. The
267 __u32 vrdcvfla : 8; /* virtual device flags (output) */ 358 * hardware identifies a device by its device number and its subchannel,
268 __u32 vrdcrccl : 8; /* real device class (output) */ 359 * which is in turn identified by its id. In order to get a unique identifier
269 __u32 vrdccrty : 8; /* real device type (output) */ 360 * for ccw devices across subchannel sets, @struct ccw_dev_id has been
270 __u32 vrdccrmd : 8; /* real device model (output) */ 361 * introduced.
271 __u32 vrdccrft : 8; /* real device feature (output) */ 362 */
272} __attribute__ ((packed,aligned(4)));
273
274struct ccw_dev_id { 363struct ccw_dev_id {
275 u8 ssid; 364 u8 ssid;
276 u16 devno; 365 u16 devno;
277}; 366};
278 367
368/**
369 * ccw_device_id_is_equal() - compare two ccw_dev_ids
370 * @dev_id1: a ccw_dev_id
371 * @dev_id2: another ccw_dev_id
372 * Returns:
373 * %1 if the two structures are equal field-by-field,
374 * %0 if not.
375 * Context:
376 * any
377 */
279static inline int ccw_dev_id_is_equal(struct ccw_dev_id *dev_id1, 378static inline int ccw_dev_id_is_equal(struct ccw_dev_id *dev_id1,
280 struct ccw_dev_id *dev_id2) 379 struct ccw_dev_id *dev_id2)
281{ 380{
@@ -285,8 +384,6 @@ static inline int ccw_dev_id_is_equal(struct ccw_dev_id *dev_id1,
285 return 0; 384 return 0;
286} 385}
287 386
288extern int diag210(struct diag210 *addr);
289
290extern void wait_cons_dev(void); 387extern void wait_cons_dev(void);
291 388
292extern void css_schedule_reprobe(void); 389extern void css_schedule_reprobe(void);
diff --git a/include/asm-s390/cmb.h b/include/asm-s390/cmb.h
index 021e7c3223ec..50196857d27a 100644
--- a/include/asm-s390/cmb.h
+++ b/include/asm-s390/cmb.h
@@ -1,29 +1,29 @@
1#ifndef S390_CMB_H 1#ifndef S390_CMB_H
2#define S390_CMB_H 2#define S390_CMB_H
3/** 3/**
4 * struct cmbdata -- channel measurement block data for user space 4 * struct cmbdata - channel measurement block data for user space
5 * @size: size of the stored data
6 * @elapsed_time: time since last sampling
7 * @ssch_rsch_count: number of ssch and rsch
8 * @sample_count: number of samples
9 * @device_connect_time: time of device connect
10 * @function_pending_time: time of function pending
11 * @device_disconnect_time: time of device disconnect
12 * @control_unit_queuing_time: time of control unit queuing
13 * @device_active_only_time: time of device active only
14 * @device_busy_time: time of device busy (ext. format)
15 * @initial_command_response_time: initial command response time (ext. format)
5 * 16 *
6 * @size: size of the stored data 17 * All values are stored as 64 bit for simplicity, especially
7 * @ssch_rsch_count: XXX
8 * @sample_count:
9 * @device_connect_time:
10 * @function_pending_time:
11 * @device_disconnect_time:
12 * @control_unit_queuing_time:
13 * @device_active_only_time:
14 * @device_busy_time:
15 * @initial_command_response_time:
16 *
17 * all values are stored as 64 bit for simplicity, especially
18 * in 32 bit emulation mode. All time values are normalized to 18 * in 32 bit emulation mode. All time values are normalized to
19 * nanoseconds. 19 * nanoseconds.
20 * Currently, two formats are known, which differ by the size of 20 * Currently, two formats are known, which differ by the size of
21 * this structure, i.e. the last two members are only set when 21 * this structure, i.e. the last two members are only set when
22 * the extended channel measurement facility (first shipped in 22 * the extended channel measurement facility (first shipped in
23 * z990 machines) is activated. 23 * z990 machines) is activated.
24 * Potentially, more fields could be added, which results in a 24 * Potentially, more fields could be added, which would result in a
25 * new ioctl number. 25 * new ioctl number.
26 **/ 26 */
27struct cmbdata { 27struct cmbdata {
28 __u64 size; 28 __u64 size;
29 __u64 elapsed_time; 29 __u64 elapsed_time;
@@ -41,53 +41,18 @@ struct cmbdata {
41}; 41};
42 42
43/* enable channel measurement */ 43/* enable channel measurement */
44#define BIODASDCMFENABLE _IO(DASD_IOCTL_LETTER,32) 44#define BIODASDCMFENABLE _IO(DASD_IOCTL_LETTER, 32)
45/* enable channel measurement */ 45/* enable channel measurement */
46#define BIODASDCMFDISABLE _IO(DASD_IOCTL_LETTER,33) 46#define BIODASDCMFDISABLE _IO(DASD_IOCTL_LETTER, 33)
47/* read channel measurement data */ 47/* read channel measurement data */
48#define BIODASDREADALLCMB _IOWR(DASD_IOCTL_LETTER,33,struct cmbdata) 48#define BIODASDREADALLCMB _IOWR(DASD_IOCTL_LETTER, 33, struct cmbdata)
49 49
50#ifdef __KERNEL__ 50#ifdef __KERNEL__
51struct ccw_device; 51struct ccw_device;
52/**
53 * enable_cmf() - switch on the channel measurement for a specific device
54 * @cdev: The ccw device to be enabled
55 * returns 0 for success or a negative error value.
56 *
57 * Context:
58 * non-atomic
59 **/
60extern int enable_cmf(struct ccw_device *cdev); 52extern int enable_cmf(struct ccw_device *cdev);
61
62/**
63 * disable_cmf() - switch off the channel measurement for a specific device
64 * @cdev: The ccw device to be disabled
65 * returns 0 for success or a negative error value.
66 *
67 * Context:
68 * non-atomic
69 **/
70extern int disable_cmf(struct ccw_device *cdev); 53extern int disable_cmf(struct ccw_device *cdev);
71
72/**
73 * cmf_read() - read one value from the current channel measurement block
74 * @cmf: the channel to be read
75 * @index: the name of the value that is read
76 *
77 * Context:
78 * any
79 **/
80
81extern u64 cmf_read(struct ccw_device *cdev, int index); 54extern u64 cmf_read(struct ccw_device *cdev, int index);
82/** 55extern int cmf_readall(struct ccw_device *cdev, struct cmbdata *data);
83 * cmf_readall() - read one value from the current channel measurement block
84 * @cmf: the channel to be read
85 * @data: a pointer to a data block that will be filled
86 *
87 * Context:
88 * any
89 **/
90extern int cmf_readall(struct ccw_device *cdev, struct cmbdata*data);
91 56
92#endif /* __KERNEL__ */ 57#endif /* __KERNEL__ */
93#endif /* S390_CMB_H */ 58#endif /* S390_CMB_H */
diff --git a/include/asm-s390/diag.h b/include/asm-s390/diag.h
new file mode 100644
index 000000000000..72b2e2f2d32d
--- /dev/null
+++ b/include/asm-s390/diag.h
@@ -0,0 +1,39 @@
1/*
2 * s390 diagnose functions
3 *
4 * Copyright IBM Corp. 2007
5 * Author(s): Michael Holzheu <holzheu@de.ibm.com>
6 */
7
8#ifndef _ASM_S390_DIAG_H
9#define _ASM_S390_DIAG_H
10
11/*
12 * Diagnose 10: Release pages
13 */
14extern void diag10(unsigned long addr);
15
16/*
17 * Diagnose 14: Input spool file manipulation
18 */
19extern int diag14(unsigned long rx, unsigned long ry1, unsigned long subcode);
20
21/*
22 * Diagnose 210: Get information about a virtual device
23 */
24struct diag210 {
25 u16 vrdcdvno; /* device number (input) */
26 u16 vrdclen; /* data block length (input) */
27 u8 vrdcvcla; /* virtual device class (output) */
28 u8 vrdcvtyp; /* virtual device type (output) */
29 u8 vrdcvsta; /* virtual device status (output) */
30 u8 vrdcvfla; /* virtual device flags (output) */
31 u8 vrdcrccl; /* real device class (output) */
32 u8 vrdccrty; /* real device type (output) */
33 u8 vrdccrmd; /* real device model (output) */
34 u8 vrdccrft; /* real device feature (output) */
35} __attribute__((packed, aligned(4)));
36
37extern int diag210(struct diag210 *addr);
38
39#endif /* _ASM_S390_DIAG_H */
diff --git a/include/asm-s390/kprobes.h b/include/asm-s390/kprobes.h
index 830fe4c4eea6..340ba10446ea 100644
--- a/include/asm-s390/kprobes.h
+++ b/include/asm-s390/kprobes.h
@@ -46,8 +46,6 @@ typedef u16 kprobe_opcode_t;
46 ? (MAX_STACK_SIZE) \ 46 ? (MAX_STACK_SIZE) \
47 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) 47 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
48 48
49#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)(pentry)
50
51#define ARCH_SUPPORTS_KRETPROBES 49#define ARCH_SUPPORTS_KRETPROBES
52#define ARCH_INACTIVE_KPROBE_COUNT 0 50#define ARCH_INACTIVE_KPROBE_COUNT 0
53 51
diff --git a/include/asm-s390/page.h b/include/asm-s390/page.h
index f326451ed6ec..ceec3826a67c 100644
--- a/include/asm-s390/page.h
+++ b/include/asm-s390/page.h
@@ -9,11 +9,12 @@
9#ifndef _S390_PAGE_H 9#ifndef _S390_PAGE_H
10#define _S390_PAGE_H 10#define _S390_PAGE_H
11 11
12#include <linux/const.h>
12#include <asm/types.h> 13#include <asm/types.h>
13 14
14/* PAGE_SHIFT determines the page size */ 15/* PAGE_SHIFT determines the page size */
15#define PAGE_SHIFT 12 16#define PAGE_SHIFT 12
16#define PAGE_SIZE (1UL << PAGE_SHIFT) 17#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
17#define PAGE_MASK (~(PAGE_SIZE-1)) 18#define PAGE_MASK (~(PAGE_SIZE-1))
18#define PAGE_DEFAULT_ACC 0 19#define PAGE_DEFAULT_ACC 0
19#define PAGE_DEFAULT_KEY (PAGE_DEFAULT_ACC << 4) 20#define PAGE_DEFAULT_KEY (PAGE_DEFAULT_ACC << 4)
diff --git a/include/asm-s390/percpu.h b/include/asm-s390/percpu.h
index 9ea7f1023e57..545857e64443 100644
--- a/include/asm-s390/percpu.h
+++ b/include/asm-s390/percpu.h
@@ -41,6 +41,11 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
41 __attribute__((__section__(".data.percpu"))) \ 41 __attribute__((__section__(".data.percpu"))) \
42 __typeof__(type) per_cpu__##name 42 __typeof__(type) per_cpu__##name
43 43
44#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
45 __attribute__((__section__(".data.percpu.shared_aligned"))) \
46 __typeof__(type) per_cpu__##name \
47 ____cacheline_aligned_in_smp
48
44#define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) 49#define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset)
45#define __raw_get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) 50#define __raw_get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset)
46#define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu]) 51#define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu])
@@ -59,6 +64,8 @@ do { \
59 64
60#define DEFINE_PER_CPU(type, name) \ 65#define DEFINE_PER_CPU(type, name) \
61 __typeof__(type) per_cpu__##name 66 __typeof__(type) per_cpu__##name
67#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
68 DEFINE_PER_CPU(type, name)
62 69
63#define __get_cpu_var(var) __reloc_hide(var,0) 70#define __get_cpu_var(var) __reloc_hide(var,0)
64#define __raw_get_cpu_var(var) __reloc_hide(var,0) 71#define __raw_get_cpu_var(var) __reloc_hide(var,0)
diff --git a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h
index 56c8a6c80e2e..e45d3c9a4b7e 100644
--- a/include/asm-s390/pgalloc.h
+++ b/include/asm-s390/pgalloc.h
@@ -19,8 +19,6 @@
19 19
20#define check_pgt_cache() do {} while (0) 20#define check_pgt_cache() do {} while (0)
21 21
22extern void diag10(unsigned long addr);
23
24/* 22/*
25 * Page allocation orders. 23 * Page allocation orders.
26 */ 24 */
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h
index 3208dc6c412c..39bb5192dc31 100644
--- a/include/asm-s390/pgtable.h
+++ b/include/asm-s390/pgtable.h
@@ -107,11 +107,18 @@ extern char empty_zero_page[PAGE_SIZE];
107 * any out-of-bounds memory accesses will hopefully be caught. 107 * any out-of-bounds memory accesses will hopefully be caught.
108 * The vmalloc() routines leaves a hole of 4kB between each vmalloced 108 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
109 * area for the same reason. ;) 109 * area for the same reason. ;)
110 * vmalloc area starts at 4GB to prevent syscall table entry exchanging
111 * from modules.
110 */ 112 */
111extern unsigned long vmalloc_end; 113extern unsigned long vmalloc_end;
112#define VMALLOC_OFFSET (8*1024*1024) 114
113#define VMALLOC_START (((unsigned long) high_memory + VMALLOC_OFFSET) \ 115#ifdef CONFIG_64BIT
114 & ~(VMALLOC_OFFSET-1)) 116#define VMALLOC_ADDR (max(0x100000000UL, (unsigned long) high_memory))
117#else
118#define VMALLOC_ADDR ((unsigned long) high_memory)
119#endif
120#define VMALLOC_OFFSET (8*1024*1024)
121#define VMALLOC_START ((VMALLOC_ADDR + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
115#define VMALLOC_END vmalloc_end 122#define VMALLOC_END vmalloc_end
116 123
117/* 124/*
diff --git a/include/asm-s390/s390_ext.h b/include/asm-s390/s390_ext.h
index df9b1017b703..2afc060266a2 100644
--- a/include/asm-s390/s390_ext.h
+++ b/include/asm-s390/s390_ext.h
@@ -5,22 +5,20 @@
5 * include/asm-s390/s390_ext.h 5 * include/asm-s390/s390_ext.h
6 * 6 *
7 * S390 version 7 * S390 version
8 * Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation 8 * Copyright IBM Corp. 1999,2007
9 * Author(s): Holger Smolinski (Holger.Smolinski@de.ibm.com), 9 * Author(s): Holger Smolinski (Holger.Smolinski@de.ibm.com),
10 * Martin Schwidefsky (schwidefsky@de.ibm.com) 10 * Martin Schwidefsky (schwidefsky@de.ibm.com)
11 */ 11 */
12 12
13#include <linux/types.h>
14
13typedef void (*ext_int_handler_t)(__u16 code); 15typedef void (*ext_int_handler_t)(__u16 code);
14 16
15/*
16 * Warning: if you change ext_int_info_t you have to change the
17 * external interrupt handler in entry.S too.
18 */
19typedef struct ext_int_info_t { 17typedef struct ext_int_info_t {
20 struct ext_int_info_t *next; 18 struct ext_int_info_t *next;
21 ext_int_handler_t handler; 19 ext_int_handler_t handler;
22 __u16 code; 20 __u16 code;
23} __attribute__ ((packed)) ext_int_info_t; 21} ext_int_info_t;
24 22
25extern ext_int_info_t *ext_int_hash[]; 23extern ext_int_info_t *ext_int_hash[];
26 24
diff --git a/include/asm-s390/smp.h b/include/asm-s390/smp.h
index 76e424f718c6..07708c07701e 100644
--- a/include/asm-s390/smp.h
+++ b/include/asm-s390/smp.h
@@ -36,8 +36,7 @@ extern void machine_halt_smp(void);
36extern void machine_power_off_smp(void); 36extern void machine_power_off_smp(void);
37 37
38extern void smp_setup_cpu_possible_map(void); 38extern void smp_setup_cpu_possible_map(void);
39extern int smp_call_function_on(void (*func) (void *info), void *info, 39
40 int nonatomic, int wait, int cpu);
41#define NO_PROC_ID 0xFF /* No processor magic marker */ 40#define NO_PROC_ID 0xFF /* No processor magic marker */
42 41
43/* 42/*
@@ -96,14 +95,6 @@ extern int __cpu_up (unsigned int cpu);
96#endif 95#endif
97 96
98#ifndef CONFIG_SMP 97#ifndef CONFIG_SMP
99static inline int
100smp_call_function_on(void (*func) (void *info), void *info,
101 int nonatomic, int wait, int cpu)
102{
103 func(info);
104 return 0;
105}
106
107static inline void smp_send_stop(void) 98static inline void smp_send_stop(void)
108{ 99{
109 /* Disable all interrupts/machine checks */ 100 /* Disable all interrupts/machine checks */
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h
index bbe137c3ed69..d866d3385556 100644
--- a/include/asm-s390/system.h
+++ b/include/asm-s390/system.h
@@ -97,16 +97,6 @@ static inline void restore_access_regs(unsigned int *acrs)
97 prev = __switch_to(prev,next); \ 97 prev = __switch_to(prev,next); \
98} while (0) 98} while (0)
99 99
100/*
101 * On SMP systems, when the scheduler does migration-cost autodetection,
102 * it needs a way to flush as much of the CPU's caches as possible.
103 *
104 * TODO: fill this in!
105 */
106static inline void sched_cacheflush(void)
107{
108}
109
110#ifdef CONFIG_VIRT_CPU_ACCOUNTING 100#ifdef CONFIG_VIRT_CPU_ACCOUNTING
111extern void account_vtime(struct task_struct *); 101extern void account_vtime(struct task_struct *);
112extern void account_tick_vtime(struct task_struct *); 102extern void account_tick_vtime(struct task_struct *);
@@ -140,6 +130,8 @@ extern void pfault_fini(void);
140 __ret; \ 130 __ret; \
141}) 131})
142 132
133extern void __xchg_called_with_bad_pointer(void);
134
143static inline unsigned long __xchg(unsigned long x, void * ptr, int size) 135static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
144{ 136{
145 unsigned long addr, old; 137 unsigned long addr, old;
@@ -160,8 +152,7 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
160 : "=&d" (old), "=m" (*(int *) addr) 152 : "=&d" (old), "=m" (*(int *) addr)
161 : "d" (x << shift), "d" (~(255 << shift)), "a" (addr), 153 : "d" (x << shift), "d" (~(255 << shift)), "a" (addr),
162 "m" (*(int *) addr) : "memory", "cc", "0"); 154 "m" (*(int *) addr) : "memory", "cc", "0");
163 x = old >> shift; 155 return old >> shift;
164 break;
165 case 2: 156 case 2:
166 addr = (unsigned long) ptr; 157 addr = (unsigned long) ptr;
167 shift = (2 ^ (addr & 2)) << 3; 158 shift = (2 ^ (addr & 2)) << 3;
@@ -176,8 +167,7 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
176 : "=&d" (old), "=m" (*(int *) addr) 167 : "=&d" (old), "=m" (*(int *) addr)
177 : "d" (x << shift), "d" (~(65535 << shift)), "a" (addr), 168 : "d" (x << shift), "d" (~(65535 << shift)), "a" (addr),
178 "m" (*(int *) addr) : "memory", "cc", "0"); 169 "m" (*(int *) addr) : "memory", "cc", "0");
179 x = old >> shift; 170 return old >> shift;
180 break;
181 case 4: 171 case 4:
182 asm volatile( 172 asm volatile(
183 " l %0,0(%3)\n" 173 " l %0,0(%3)\n"
@@ -186,8 +176,7 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
186 : "=&d" (old), "=m" (*(int *) ptr) 176 : "=&d" (old), "=m" (*(int *) ptr)
187 : "d" (x), "a" (ptr), "m" (*(int *) ptr) 177 : "d" (x), "a" (ptr), "m" (*(int *) ptr)
188 : "memory", "cc"); 178 : "memory", "cc");
189 x = old; 179 return old;
190 break;
191#ifdef __s390x__ 180#ifdef __s390x__
192 case 8: 181 case 8:
193 asm volatile( 182 asm volatile(
@@ -197,11 +186,11 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
197 : "=&d" (old), "=m" (*(long *) ptr) 186 : "=&d" (old), "=m" (*(long *) ptr)
198 : "d" (x), "a" (ptr), "m" (*(long *) ptr) 187 : "d" (x), "a" (ptr), "m" (*(long *) ptr)
199 : "memory", "cc"); 188 : "memory", "cc");
200 x = old; 189 return old;
201 break;
202#endif /* __s390x__ */ 190#endif /* __s390x__ */
203 } 191 }
204 return x; 192 __xchg_called_with_bad_pointer();
193 return x;
205} 194}
206 195
207/* 196/*
@@ -216,6 +205,8 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
216 ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ 205 ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
217 (unsigned long)(n),sizeof(*(ptr)))) 206 (unsigned long)(n),sizeof(*(ptr))))
218 207
208extern void __cmpxchg_called_with_bad_pointer(void);
209
219static inline unsigned long 210static inline unsigned long
220__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) 211__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
221{ 212{
@@ -280,7 +271,8 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
280 return prev; 271 return prev;
281#endif /* __s390x__ */ 272#endif /* __s390x__ */
282 } 273 }
283 return old; 274 __cmpxchg_called_with_bad_pointer();
275 return old;
284} 276}
285 277
286/* 278/*
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
index 790c1c557417..f04acb2670a8 100644
--- a/include/asm-s390/unistd.h
+++ b/include/asm-s390/unistd.h
@@ -251,7 +251,7 @@
251#define __NR_getcpu 311 251#define __NR_getcpu 311
252#define __NR_epoll_pwait 312 252#define __NR_epoll_pwait 312
253#define __NR_utimes 313 253#define __NR_utimes 313
254/* Number 314 is reserved for new sys_fallocate */ 254#define __NR_fallocate 314
255#define __NR_utimensat 315 255#define __NR_utimensat 315
256#define __NR_signalfd 316 256#define __NR_signalfd 316
257#define __NR_timerfd 317 257#define __NR_timerfd 317
diff --git a/include/asm-s390/zcrypt.h b/include/asm-s390/zcrypt.h
index b90e55888a55..a5dada617751 100644
--- a/include/asm-s390/zcrypt.h
+++ b/include/asm-s390/zcrypt.h
@@ -91,7 +91,7 @@ struct ica_rsa_modexpo_crt {
91 * VUD block 91 * VUD block
92 * key block 92 * key block
93 */ 93 */
94struct ica_CPRBX { 94struct CPRBX {
95 unsigned short cprb_len; /* CPRB length 220 */ 95 unsigned short cprb_len; /* CPRB length 220 */
96 unsigned char cprb_ver_id; /* CPRB version id. 0x02 */ 96 unsigned char cprb_ver_id; /* CPRB version id. 0x02 */
97 unsigned char pad_000[3]; /* Alignment pad bytes */ 97 unsigned char pad_000[3]; /* Alignment pad bytes */
@@ -130,7 +130,7 @@ struct ica_CPRBX {
130 unsigned char cntrl_domain[4];/* Control domain */ 130 unsigned char cntrl_domain[4];/* Control domain */
131 unsigned char S390enf_mask[4];/* S/390 enforcement mask */ 131 unsigned char S390enf_mask[4];/* S/390 enforcement mask */
132 unsigned char pad_004[36]; /* reserved */ 132 unsigned char pad_004[36]; /* reserved */
133}; 133} __attribute__((packed));
134 134
135/** 135/**
136 * xcRB 136 * xcRB