aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-07-30 18:14:15 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-07-30 18:14:15 -0400
commita670fcb43f01a67ef56176afc76e5d43d128b25c (patch)
tree09c9411c78a33ff980e9ea871bc7686e7589abbf /arch/s390
parent327309e899662b482c58cf25f574513d38b5788c (diff)
parentb0825488a642cadcf39709961dde61440cb0731c (diff)
/spare/repo/netdev-2.6 branch 'master'
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/appldata/appldata_base.c6
-rw-r--r--arch/s390/defconfig253
-rw-r--r--arch/s390/kernel/compat_linux.c38
-rw-r--r--arch/s390/kernel/compat_wrapper.S4
-rw-r--r--arch/s390/kernel/entry.S6
-rw-r--r--arch/s390/kernel/entry64.S6
-rw-r--r--arch/s390/kernel/head.S16
-rw-r--r--arch/s390/kernel/head64.S12
-rw-r--r--arch/s390/kernel/s390_ext.c16
-rw-r--r--arch/s390/kernel/setup.c12
-rw-r--r--arch/s390/kernel/smp.c10
-rw-r--r--arch/s390/lib/Makefile4
-rw-r--r--arch/s390/lib/spinlock.c133
13 files changed, 365 insertions, 151 deletions
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index c067435bae45..c9f2f60cfa58 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -232,7 +232,11 @@ static int appldata_diag(char record_nr, u16 function, unsigned long buffer,
232 ry = -1; 232 ry = -1;
233 asm volatile( 233 asm volatile(
234 "diag %1,%0,0xDC\n\t" 234 "diag %1,%0,0xDC\n\t"
235 : "=d" (ry) : "d" (&(appldata_parameter_list)) : "cc"); 235 : "=d" (ry)
236 : "d" (&appldata_parameter_list),
237 "m" (appldata_parameter_list),
238 "m" (appldata_product_id)
239 : "cc");
236 return (int) ry; 240 return (int) ry;
237} 241}
238/************************ timer, work, DIAG <END> ****************************/ 242/************************ timer, work, DIAG <END> ****************************/
diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index 89850b2c27ea..0865251a3f44 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc3 3# Linux kernel version: 2.6.13-rc4
4# Fri Apr 22 15:30:58 2005 4# Fri Jul 29 14:49:30 2005
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_RWSEM_XCHGADD_ALGORITHM=y 7CONFIG_RWSEM_XCHGADD_ALGORITHM=y
@@ -23,10 +23,11 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
23CONFIG_LOCALVERSION="" 23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y 24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y 25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set 26CONFIG_POSIX_MQUEUE=y
27# CONFIG_BSD_PROCESS_ACCT is not set 27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y 28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set 29CONFIG_AUDIT=y
30# CONFIG_AUDITSYSCALL is not set
30CONFIG_HOTPLUG=y 31CONFIG_HOTPLUG=y
31CONFIG_KOBJECT_UEVENT=y 32CONFIG_KOBJECT_UEVENT=y
32CONFIG_IKCONFIG=y 33CONFIG_IKCONFIG=y
@@ -36,6 +37,8 @@ CONFIG_IKCONFIG_PROC=y
36CONFIG_KALLSYMS=y 37CONFIG_KALLSYMS=y
37# CONFIG_KALLSYMS_ALL is not set 38# CONFIG_KALLSYMS_ALL is not set
38# CONFIG_KALLSYMS_EXTRA_PASS is not set 39# CONFIG_KALLSYMS_EXTRA_PASS is not set
40CONFIG_PRINTK=y
41CONFIG_BUG=y
39CONFIG_BASE_FULL=y 42CONFIG_BASE_FULL=y
40CONFIG_FUTEX=y 43CONFIG_FUTEX=y
41CONFIG_EPOLL=y 44CONFIG_EPOLL=y
@@ -51,9 +54,10 @@ CONFIG_BASE_SMALL=0
51# Loadable module support 54# Loadable module support
52# 55#
53CONFIG_MODULES=y 56CONFIG_MODULES=y
54# CONFIG_MODULE_UNLOAD is not set 57CONFIG_MODULE_UNLOAD=y
58# CONFIG_MODULE_FORCE_UNLOAD is not set
55CONFIG_OBSOLETE_MODPARM=y 59CONFIG_OBSOLETE_MODPARM=y
56# CONFIG_MODVERSIONS is not set 60CONFIG_MODVERSIONS=y
57# CONFIG_MODULE_SRCVERSION_ALL is not set 61# CONFIG_MODULE_SRCVERSION_ALL is not set
58CONFIG_KMOD=y 62CONFIG_KMOD=y
59CONFIG_STOP_MACHINE=y 63CONFIG_STOP_MACHINE=y
@@ -81,8 +85,15 @@ CONFIG_MARCH_G5=y
81# CONFIG_MARCH_Z990 is not set 85# CONFIG_MARCH_Z990 is not set
82CONFIG_PACK_STACK=y 86CONFIG_PACK_STACK=y
83# CONFIG_SMALL_STACK is not set 87# CONFIG_SMALL_STACK is not set
84# CONFIG_CHECK_STACK is not set 88CONFIG_CHECK_STACK=y
89CONFIG_STACK_GUARD=256
85# CONFIG_WARN_STACK is not set 90# CONFIG_WARN_STACK is not set
91CONFIG_SELECT_MEMORY_MODEL=y
92CONFIG_FLATMEM_MANUAL=y
93# CONFIG_DISCONTIGMEM_MANUAL is not set
94# CONFIG_SPARSEMEM_MANUAL is not set
95CONFIG_FLATMEM=y
96CONFIG_FLAT_NODE_MEM_MAP=y
86 97
87# 98#
88# I/O subsystem configuration 99# I/O subsystem configuration
@@ -95,7 +106,7 @@ CONFIG_QDIO=y
95# 106#
96# Misc 107# Misc
97# 108#
98# CONFIG_PREEMPT is not set 109CONFIG_PREEMPT=y
99CONFIG_IPL=y 110CONFIG_IPL=y
100# CONFIG_IPL_TAPE is not set 111# CONFIG_IPL_TAPE is not set
101CONFIG_IPL_VM=y 112CONFIG_IPL_VM=y
@@ -105,9 +116,110 @@ CONFIG_BINFMT_MISC=m
105CONFIG_PFAULT=y 116CONFIG_PFAULT=y
106# CONFIG_SHARED_KERNEL is not set 117# CONFIG_SHARED_KERNEL is not set
107# CONFIG_CMM is not set 118# CONFIG_CMM is not set
108# CONFIG_VIRT_TIMER is not set 119CONFIG_VIRT_TIMER=y
120CONFIG_VIRT_CPU_ACCOUNTING=y
121# CONFIG_APPLDATA_BASE is not set
109CONFIG_NO_IDLE_HZ=y 122CONFIG_NO_IDLE_HZ=y
110CONFIG_NO_IDLE_HZ_INIT=y 123CONFIG_NO_IDLE_HZ_INIT=y
124# CONFIG_KEXEC is not set
125
126#
127# Networking
128#
129CONFIG_NET=y
130
131#
132# Networking options
133#
134CONFIG_PACKET=y
135# CONFIG_PACKET_MMAP is not set
136CONFIG_UNIX=y
137CONFIG_XFRM=y
138# CONFIG_XFRM_USER is not set
139CONFIG_NET_KEY=y
140CONFIG_INET=y
141CONFIG_IP_MULTICAST=y
142# CONFIG_IP_ADVANCED_ROUTER is not set
143CONFIG_IP_FIB_HASH=y
144# CONFIG_IP_PNP is not set
145# CONFIG_NET_IPIP is not set
146# CONFIG_NET_IPGRE is not set
147# CONFIG_IP_MROUTE is not set
148# CONFIG_ARPD is not set
149# CONFIG_SYN_COOKIES is not set
150# CONFIG_INET_AH is not set
151# CONFIG_INET_ESP is not set
152# CONFIG_INET_IPCOMP is not set
153# CONFIG_INET_TUNNEL is not set
154CONFIG_IP_TCPDIAG=y
155CONFIG_IP_TCPDIAG_IPV6=y
156# CONFIG_TCP_CONG_ADVANCED is not set
157CONFIG_TCP_CONG_BIC=y
158CONFIG_IPV6=y
159# CONFIG_IPV6_PRIVACY is not set
160# CONFIG_INET6_AH is not set
161# CONFIG_INET6_ESP is not set
162# CONFIG_INET6_IPCOMP is not set
163# CONFIG_INET6_TUNNEL is not set
164# CONFIG_IPV6_TUNNEL is not set
165# CONFIG_NETFILTER is not set
166
167#
168# SCTP Configuration (EXPERIMENTAL)
169#
170# CONFIG_IP_SCTP is not set
171# CONFIG_ATM is not set
172# CONFIG_BRIDGE is not set
173# CONFIG_VLAN_8021Q is not set
174# CONFIG_DECNET is not set
175# CONFIG_LLC2 is not set
176# CONFIG_IPX is not set
177# CONFIG_ATALK is not set
178# CONFIG_X25 is not set
179# CONFIG_LAPB is not set
180# CONFIG_NET_DIVERT is not set
181# CONFIG_ECONET is not set
182# CONFIG_WAN_ROUTER is not set
183CONFIG_NET_SCHED=y
184CONFIG_NET_SCH_CLK_JIFFIES=y
185# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
186# CONFIG_NET_SCH_CLK_CPU is not set
187CONFIG_NET_SCH_CBQ=m
188# CONFIG_NET_SCH_HTB is not set
189# CONFIG_NET_SCH_HFSC is not set
190CONFIG_NET_SCH_PRIO=m
191CONFIG_NET_SCH_RED=m
192CONFIG_NET_SCH_SFQ=m
193CONFIG_NET_SCH_TEQL=m
194CONFIG_NET_SCH_TBF=m
195CONFIG_NET_SCH_GRED=m
196CONFIG_NET_SCH_DSMARK=m
197# CONFIG_NET_SCH_NETEM is not set
198# CONFIG_NET_SCH_INGRESS is not set
199CONFIG_NET_QOS=y
200CONFIG_NET_ESTIMATOR=y
201CONFIG_NET_CLS=y
202# CONFIG_NET_CLS_BASIC is not set
203CONFIG_NET_CLS_TCINDEX=m
204CONFIG_NET_CLS_ROUTE4=m
205CONFIG_NET_CLS_ROUTE=y
206CONFIG_NET_CLS_FW=m
207CONFIG_NET_CLS_U32=m
208# CONFIG_CLS_U32_PERF is not set
209# CONFIG_NET_CLS_IND is not set
210CONFIG_NET_CLS_RSVP=m
211CONFIG_NET_CLS_RSVP6=m
212# CONFIG_NET_EMATCH is not set
213# CONFIG_NET_CLS_ACT is not set
214CONFIG_NET_CLS_POLICE=y
215
216#
217# Network testing
218#
219# CONFIG_NET_PKTGEN is not set
220# CONFIG_HAMRADIO is not set
221# CONFIG_IRDA is not set
222# CONFIG_BT is not set
111# CONFIG_PCMCIA is not set 223# CONFIG_PCMCIA is not set
112 224
113# 225#
@@ -133,6 +245,7 @@ CONFIG_CHR_DEV_ST=y
133CONFIG_BLK_DEV_SR=y 245CONFIG_BLK_DEV_SR=y
134CONFIG_BLK_DEV_SR_VENDOR=y 246CONFIG_BLK_DEV_SR_VENDOR=y
135CONFIG_CHR_DEV_SG=y 247CONFIG_CHR_DEV_SG=y
248# CONFIG_CHR_DEV_SCH is not set
136 249
137# 250#
138# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 251# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -205,7 +318,13 @@ CONFIG_MD_RAID5=m
205# CONFIG_MD_RAID6 is not set 318# CONFIG_MD_RAID6 is not set
206CONFIG_MD_MULTIPATH=m 319CONFIG_MD_MULTIPATH=m
207# CONFIG_MD_FAULTY is not set 320# CONFIG_MD_FAULTY is not set
208# CONFIG_BLK_DEV_DM is not set 321CONFIG_BLK_DEV_DM=y
322CONFIG_DM_CRYPT=y
323CONFIG_DM_SNAPSHOT=y
324CONFIG_DM_MIRROR=y
325CONFIG_DM_ZERO=y
326CONFIG_DM_MULTIPATH=y
327# CONFIG_DM_MULTIPATH_EMC is not set
209 328
210# 329#
211# Character device drivers 330# Character device drivers
@@ -231,7 +350,8 @@ CONFIG_CCW_CONSOLE=y
231CONFIG_SCLP=y 350CONFIG_SCLP=y
232CONFIG_SCLP_TTY=y 351CONFIG_SCLP_TTY=y
233CONFIG_SCLP_CONSOLE=y 352CONFIG_SCLP_CONSOLE=y
234# CONFIG_SCLP_VT220_TTY is not set 353CONFIG_SCLP_VT220_TTY=y
354CONFIG_SCLP_VT220_CONSOLE=y
235CONFIG_SCLP_CPI=m 355CONFIG_SCLP_CPI=m
236CONFIG_S390_TAPE=m 356CONFIG_S390_TAPE=m
237 357
@@ -255,105 +375,8 @@ CONFIG_S390_TAPE_34XX=m
255CONFIG_Z90CRYPT=m 375CONFIG_Z90CRYPT=m
256 376
257# 377#
258# Networking support 378# Network device support
259#
260CONFIG_NET=y
261
262#
263# Networking options
264#
265CONFIG_PACKET=y
266# CONFIG_PACKET_MMAP is not set
267CONFIG_UNIX=y
268CONFIG_NET_KEY=y
269CONFIG_INET=y
270CONFIG_IP_MULTICAST=y
271# CONFIG_IP_ADVANCED_ROUTER is not set
272# CONFIG_IP_PNP is not set
273# CONFIG_NET_IPIP is not set
274# CONFIG_NET_IPGRE is not set
275# CONFIG_IP_MROUTE is not set
276# CONFIG_ARPD is not set
277# CONFIG_SYN_COOKIES is not set
278# CONFIG_INET_AH is not set
279# CONFIG_INET_ESP is not set
280# CONFIG_INET_IPCOMP is not set
281# CONFIG_INET_TUNNEL is not set
282CONFIG_IP_TCPDIAG=y
283CONFIG_IP_TCPDIAG_IPV6=y
284CONFIG_IPV6=y
285# CONFIG_IPV6_PRIVACY is not set
286# CONFIG_INET6_AH is not set
287# CONFIG_INET6_ESP is not set
288# CONFIG_INET6_IPCOMP is not set
289# CONFIG_INET6_TUNNEL is not set
290# CONFIG_IPV6_TUNNEL is not set
291# CONFIG_NETFILTER is not set
292CONFIG_XFRM=y
293# CONFIG_XFRM_USER is not set
294
295#
296# SCTP Configuration (EXPERIMENTAL)
297#
298# CONFIG_IP_SCTP is not set
299# CONFIG_ATM is not set
300# CONFIG_BRIDGE is not set
301# CONFIG_VLAN_8021Q is not set
302# CONFIG_DECNET is not set
303# CONFIG_LLC2 is not set
304# CONFIG_IPX is not set
305# CONFIG_ATALK is not set
306# CONFIG_X25 is not set
307# CONFIG_LAPB is not set
308# CONFIG_NET_DIVERT is not set
309# CONFIG_ECONET is not set
310# CONFIG_WAN_ROUTER is not set
311
312#
313# QoS and/or fair queueing
314#
315CONFIG_NET_SCHED=y
316CONFIG_NET_SCH_CLK_JIFFIES=y
317# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
318# CONFIG_NET_SCH_CLK_CPU is not set
319CONFIG_NET_SCH_CBQ=m
320# CONFIG_NET_SCH_HTB is not set
321# CONFIG_NET_SCH_HFSC is not set
322CONFIG_NET_SCH_PRIO=m
323CONFIG_NET_SCH_RED=m
324CONFIG_NET_SCH_SFQ=m
325CONFIG_NET_SCH_TEQL=m
326CONFIG_NET_SCH_TBF=m
327CONFIG_NET_SCH_GRED=m
328CONFIG_NET_SCH_DSMARK=m
329# CONFIG_NET_SCH_NETEM is not set
330# CONFIG_NET_SCH_INGRESS is not set
331CONFIG_NET_QOS=y
332CONFIG_NET_ESTIMATOR=y
333CONFIG_NET_CLS=y
334# CONFIG_NET_CLS_BASIC is not set
335CONFIG_NET_CLS_TCINDEX=m
336CONFIG_NET_CLS_ROUTE4=m
337CONFIG_NET_CLS_ROUTE=y
338CONFIG_NET_CLS_FW=m
339CONFIG_NET_CLS_U32=m
340# CONFIG_CLS_U32_PERF is not set
341# CONFIG_NET_CLS_IND is not set
342CONFIG_NET_CLS_RSVP=m
343CONFIG_NET_CLS_RSVP6=m
344# CONFIG_NET_EMATCH is not set
345# CONFIG_NET_CLS_ACT is not set
346CONFIG_NET_CLS_POLICE=y
347
348#
349# Network testing
350# 379#
351# CONFIG_NET_PKTGEN is not set
352# CONFIG_NETPOLL is not set
353# CONFIG_NET_POLL_CONTROLLER is not set
354# CONFIG_HAMRADIO is not set
355# CONFIG_IRDA is not set
356# CONFIG_BT is not set
357CONFIG_NETDEVICES=y 380CONFIG_NETDEVICES=y
358CONFIG_DUMMY=m 381CONFIG_DUMMY=m
359CONFIG_BONDING=m 382CONFIG_BONDING=m
@@ -411,12 +434,15 @@ CONFIG_CCWGROUP=y
411# CONFIG_SLIP is not set 434# CONFIG_SLIP is not set
412# CONFIG_SHAPER is not set 435# CONFIG_SHAPER is not set
413# CONFIG_NETCONSOLE is not set 436# CONFIG_NETCONSOLE is not set
437# CONFIG_NETPOLL is not set
438# CONFIG_NET_POLL_CONTROLLER is not set
414 439
415# 440#
416# File systems 441# File systems
417# 442#
418CONFIG_EXT2_FS=y 443CONFIG_EXT2_FS=y
419# CONFIG_EXT2_FS_XATTR is not set 444# CONFIG_EXT2_FS_XATTR is not set
445# CONFIG_EXT2_FS_XIP is not set
420CONFIG_EXT3_FS=y 446CONFIG_EXT3_FS=y
421CONFIG_EXT3_FS_XATTR=y 447CONFIG_EXT3_FS_XATTR=y
422# CONFIG_EXT3_FS_POSIX_ACL is not set 448# CONFIG_EXT3_FS_POSIX_ACL is not set
@@ -426,6 +452,7 @@ CONFIG_JBD=y
426CONFIG_FS_MBCACHE=y 452CONFIG_FS_MBCACHE=y
427# CONFIG_REISERFS_FS is not set 453# CONFIG_REISERFS_FS is not set
428# CONFIG_JFS_FS is not set 454# CONFIG_JFS_FS is not set
455# CONFIG_FS_POSIX_ACL is not set
429 456
430# 457#
431# XFS support 458# XFS support
@@ -433,6 +460,7 @@ CONFIG_FS_MBCACHE=y
433# CONFIG_XFS_FS is not set 460# CONFIG_XFS_FS is not set
434# CONFIG_MINIX_FS is not set 461# CONFIG_MINIX_FS is not set
435# CONFIG_ROMFS_FS is not set 462# CONFIG_ROMFS_FS is not set
463CONFIG_INOTIFY=y
436# CONFIG_QUOTA is not set 464# CONFIG_QUOTA is not set
437CONFIG_DNOTIFY=y 465CONFIG_DNOTIFY=y
438# CONFIG_AUTOFS_FS is not set 466# CONFIG_AUTOFS_FS is not set
@@ -457,7 +485,6 @@ CONFIG_DNOTIFY=y
457CONFIG_PROC_FS=y 485CONFIG_PROC_FS=y
458CONFIG_PROC_KCORE=y 486CONFIG_PROC_KCORE=y
459CONFIG_SYSFS=y 487CONFIG_SYSFS=y
460# CONFIG_DEVFS_FS is not set
461# CONFIG_DEVPTS_FS_XATTR is not set 488# CONFIG_DEVPTS_FS_XATTR is not set
462CONFIG_TMPFS=y 489CONFIG_TMPFS=y
463# CONFIG_TMPFS_XATTR is not set 490# CONFIG_TMPFS_XATTR is not set
@@ -486,15 +513,18 @@ CONFIG_RAMFS=y
486# 513#
487CONFIG_NFS_FS=y 514CONFIG_NFS_FS=y
488CONFIG_NFS_V3=y 515CONFIG_NFS_V3=y
516# CONFIG_NFS_V3_ACL is not set
489# CONFIG_NFS_V4 is not set 517# CONFIG_NFS_V4 is not set
490# CONFIG_NFS_DIRECTIO is not set 518# CONFIG_NFS_DIRECTIO is not set
491CONFIG_NFSD=y 519CONFIG_NFSD=y
492CONFIG_NFSD_V3=y 520CONFIG_NFSD_V3=y
521# CONFIG_NFSD_V3_ACL is not set
493# CONFIG_NFSD_V4 is not set 522# CONFIG_NFSD_V4 is not set
494CONFIG_NFSD_TCP=y 523CONFIG_NFSD_TCP=y
495CONFIG_LOCKD=y 524CONFIG_LOCKD=y
496CONFIG_LOCKD_V4=y 525CONFIG_LOCKD_V4=y
497CONFIG_EXPORTFS=y 526CONFIG_EXPORTFS=y
527CONFIG_NFS_COMMON=y
498CONFIG_SUNRPC=y 528CONFIG_SUNRPC=y
499# CONFIG_RPCSEC_GSS_KRB5 is not set 529# CONFIG_RPCSEC_GSS_KRB5 is not set
500# CONFIG_RPCSEC_GSS_SPKM3 is not set 530# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -544,11 +574,12 @@ CONFIG_MAGIC_SYSRQ=y
544CONFIG_LOG_BUF_SHIFT=17 574CONFIG_LOG_BUF_SHIFT=17
545# CONFIG_SCHEDSTATS is not set 575# CONFIG_SCHEDSTATS is not set
546# CONFIG_DEBUG_SLAB is not set 576# CONFIG_DEBUG_SLAB is not set
577CONFIG_DEBUG_PREEMPT=y
547# CONFIG_DEBUG_SPINLOCK is not set 578# CONFIG_DEBUG_SPINLOCK is not set
548# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 579# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
549# CONFIG_DEBUG_KOBJECT is not set 580# CONFIG_DEBUG_KOBJECT is not set
550# CONFIG_DEBUG_INFO is not set 581# CONFIG_DEBUG_INFO is not set
551# CONFIG_DEBUG_FS is not set 582CONFIG_DEBUG_FS=y
552 583
553# 584#
554# Security options 585# Security options
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index 614056222875..18610cea03a2 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -58,6 +58,7 @@
58#include <linux/compat.h> 58#include <linux/compat.h>
59#include <linux/vfs.h> 59#include <linux/vfs.h>
60#include <linux/ptrace.h> 60#include <linux/ptrace.h>
61#include <linux/fadvise.h>
61 62
62#include <asm/types.h> 63#include <asm/types.h>
63#include <asm/ipc.h> 64#include <asm/ipc.h>
@@ -1043,3 +1044,40 @@ sys32_timer_create(clockid_t which_clock, struct compat_sigevent *se32,
1043 1044
1044 return ret; 1045 return ret;
1045} 1046}
1047
1048/*
1049 * 31 bit emulation wrapper functions for sys_fadvise64/fadvise64_64.
1050 * These need to rewrite the advise values for POSIX_FADV_{DONTNEED,NOREUSE}
1051 * because the 31 bit values differ from the 64 bit values.
1052 */
1053
1054asmlinkage long
1055sys32_fadvise64(int fd, loff_t offset, size_t len, int advise)
1056{
1057 if (advise == 4)
1058 advise = POSIX_FADV_DONTNEED;
1059 else if (advise == 5)
1060 advise = POSIX_FADV_NOREUSE;
1061 return sys_fadvise64(fd, offset, len, advise);
1062}
1063
1064struct fadvise64_64_args {
1065 int fd;
1066 long long offset;
1067 long long len;
1068 int advice;
1069};
1070
1071asmlinkage long
1072sys32_fadvise64_64(struct fadvise64_64_args __user *args)
1073{
1074 struct fadvise64_64_args a;
1075
1076 if ( copy_from_user(&a, args, sizeof(a)) )
1077 return -EFAULT;
1078 if (a.advice == 4)
1079 a.advice = POSIX_FADV_DONTNEED;
1080 else if (a.advice == 5)
1081 a.advice = POSIX_FADV_NOREUSE;
1082 return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice);
1083}
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index bf529739c8ab..799a98eac92d 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -1251,12 +1251,12 @@ sys32_fadvise64_wrapper:
1251 or %r3,%r4 # get low word of 64bit loff_t 1251 or %r3,%r4 # get low word of 64bit loff_t
1252 llgfr %r4,%r5 # size_t (unsigned long) 1252 llgfr %r4,%r5 # size_t (unsigned long)
1253 lgfr %r5,%r6 # int 1253 lgfr %r5,%r6 # int
1254 jg sys_fadvise64 1254 jg sys32_fadvise64
1255 1255
1256 .globl sys32_fadvise64_64_wrapper 1256 .globl sys32_fadvise64_64_wrapper
1257sys32_fadvise64_64_wrapper: 1257sys32_fadvise64_64_wrapper:
1258 llgtr %r2,%r2 # struct fadvise64_64_args * 1258 llgtr %r2,%r2 # struct fadvise64_64_args *
1259 jg s390_fadvise64_64 1259 jg sys32_fadvise64_64
1260 1260
1261 .globl sys32_clock_settime_wrapper 1261 .globl sys32_clock_settime_wrapper
1262sys32_clock_settime_wrapper: 1262sys32_clock_settime_wrapper:
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index 5b262b5d869f..1a271b16cb5c 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -690,9 +690,9 @@ mcck_int_handler:
690 bo BASED(0f) 690 bo BASED(0f)
691 spt __LC_LAST_UPDATE_TIMER # revalidate cpu timer 691 spt __LC_LAST_UPDATE_TIMER # revalidate cpu timer
692#ifdef CONFIG_VIRT_CPU_ACCOUNTING 692#ifdef CONFIG_VIRT_CPU_ACCOUNTING
693 mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER 693 mvc __LC_ASYNC_ENTER_TIMER(8),__LC_LAST_UPDATE_TIMER
694 mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER 694 mvc __LC_SYNC_ENTER_TIMER(8),__LC_LAST_UPDATE_TIMER
695 mvc __LC_LAST_UPDATE_TIMER(8),__LC_EXIT_TIMER 695 mvc __LC_EXIT_TIMER(8),__LC_LAST_UPDATE_TIMER
6960: tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid? 6960: tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid?
697 bno BASED(mcck_no_vtime) # no -> skip cleanup critical 697 bno BASED(mcck_no_vtime) # no -> skip cleanup critical
698 tm __LC_MCK_OLD_PSW+1,0x01 # interrupting from user ? 698 tm __LC_MCK_OLD_PSW+1,0x01 # interrupting from user ?
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index 57ca75d0ad7f..d9f22915008c 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -727,9 +727,9 @@ mcck_int_handler:
727 jo 0f 727 jo 0f
728 spt __LC_LAST_UPDATE_TIMER 728 spt __LC_LAST_UPDATE_TIMER
729#ifdef CONFIG_VIRT_CPU_ACCOUNTING 729#ifdef CONFIG_VIRT_CPU_ACCOUNTING
730 mvc __LC_LAST_UPDATE_TIMER(8),__LC_ASYNC_ENTER_TIMER 730 mvc __LC_ASYNC_ENTER_TIMER(8),__LC_LAST_UPDATE_TIMER
731 mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER 731 mvc __LC_SYNC_ENTER_TIMER(8),__LC_LAST_UPDATE_TIMER
732 mvc __LC_LAST_UPDATE_TIMER(8),__LC_EXIT_TIMER 732 mvc __LC_EXIT_TIMER(8),__LC_LAST_UPDATE_TIMER
7330: tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid? 7330: tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid?
734 jno mcck_no_vtime # no -> no timer update 734 jno mcck_no_vtime # no -> no timer update
735 tm __LC_MCK_OLD_PSW+1,0x01 # interrupting from user ? 735 tm __LC_MCK_OLD_PSW+1,0x01 # interrupting from user ?
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
index fc8bf5e285f6..2710e66fefba 100644
--- a/arch/s390/kernel/head.S
+++ b/arch/s390/kernel/head.S
@@ -346,6 +346,13 @@ iplstart:
346 la %r2,.Lreset 346 la %r2,.Lreset
347 lhi %r3,26 347 lhi %r3,26
348 diag %r2,%r3,8 348 diag %r2,%r3,8
349 la %r5,.Lirb
350 stsch 0(%r5) # check if irq is pending
351 tm 30(%r5),0x0f # by verifying if any of the
352 bnz .Lwaitforirq # activity or status control
353 tm 31(%r5),0xff # bits is set in the schib
354 bz .Lnoreset
355.Lwaitforirq:
349 mvc 0x78(8),.Lrdrnewpsw # set up IO interrupt psw 356 mvc 0x78(8),.Lrdrnewpsw # set up IO interrupt psw
350.Lwaitrdrirq: 357.Lwaitrdrirq:
351 lpsw .Lrdrwaitpsw 358 lpsw .Lrdrwaitpsw
@@ -535,8 +542,13 @@ startup:basr %r13,0 # get base
535 lhi %r1,0 542 lhi %r1,0
536 icm %r1,3,.Lscpincr1-PARMAREA(%r4) # use this one if != 0 543 icm %r1,3,.Lscpincr1-PARMAREA(%r4) # use this one if != 0
537 jnz .Lscnd 544 jnz .Lscnd
538 l %r1,.Lscpincr2-PARMAREA+4(%r4) # otherwise use this one 545 lhi %r1,0x800 # otherwise report 2GB
539.Lscnd: 546.Lscnd:
547 lhi %r3,0x800 # limit reported memory size to 2GB
548 cr %r1,%r3
549 jl .Lno2gb
550 lr %r1,%r3
551.Lno2gb:
540 xr %r3,%r3 # same logic 552 xr %r3,%r3 # same logic
541 ic %r3,.Lscpa1-PARMAREA(%r4) 553 ic %r3,.Lscpa1-PARMAREA(%r4)
542 chi %r3,0x00 554 chi %r3,0x00
@@ -765,7 +777,7 @@ _stext: basr %r13,0 # get base
765 777
766# check control registers 778# check control registers
767 stctl %c0,%c15,0(%r15) 779 stctl %c0,%c15,0(%r15)
768 oi 2(%r15),0x20 # enable sigp external interrupts 780 oi 2(%r15),0x40 # enable sigp emergency signal
769 oi 0(%r15),0x10 # switch on low address protection 781 oi 0(%r15),0x10 # switch on low address protection
770 lctl %c0,%c15,0(%r15) 782 lctl %c0,%c15,0(%r15)
771 783
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index f525c0c21250..9a8263a153cb 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -345,6 +345,13 @@ iplstart:
345 la %r2,.Lreset 345 la %r2,.Lreset
346 lhi %r3,26 346 lhi %r3,26
347 diag %r2,%r3,8 347 diag %r2,%r3,8
348 la %r5,.Lirb
349 stsch 0(%r5) # check if irq is pending
350 tm 30(%r5),0x0f # by verifying if any of the
351 bnz .Lwaitforirq # activity or status control
352 tm 31(%r5),0xff # bits is set in the schib
353 bz .Lnoreset
354.Lwaitforirq:
348 mvc 0x78(8),.Lrdrnewpsw # set up IO interrupt psw 355 mvc 0x78(8),.Lrdrnewpsw # set up IO interrupt psw
349.Lwaitrdrirq: 356.Lwaitrdrirq:
350 lpsw .Lrdrwaitpsw 357 lpsw .Lrdrwaitpsw
@@ -658,10 +665,8 @@ startup:basr %r13,0 # get base
658# 665#
659 la %r1,0f-.LPG1(%r13) # set program check address 666 la %r1,0f-.LPG1(%r13) # set program check address
660 stg %r1,__LC_PGM_NEW_PSW+8 667 stg %r1,__LC_PGM_NEW_PSW+8
661 mvc __LC_DIAG44_OPCODE(8),.Lnop-.LPG1(%r13)
662 diag 0,0,0x44 # test diag 0x44 668 diag 0,0,0x44 # test diag 0x44
663 oi 7(%r12),32 # set diag44 flag 669 oi 7(%r12),32 # set diag44 flag
664 mvc __LC_DIAG44_OPCODE(8),.Ldiag44-.LPG1(%r13)
6650: 6700:
666 671
667# 672#
@@ -702,7 +707,6 @@ startup:basr %r13,0 # get base
702.L4malign:.quad 0xffffffffffc00000 707.L4malign:.quad 0xffffffffffc00000
703.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8 708.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8
704.Lnop: .long 0x07000700 709.Lnop: .long 0x07000700
705.Ldiag44:.long 0x83000044
706 710
707 .org PARMAREA-64 711 .org PARMAREA-64
708.Lduct: .long 0,0,0,0,0,0,0,0 712.Lduct: .long 0,0,0,0,0,0,0,0
@@ -765,7 +769,7 @@ _stext: basr %r13,0 # get base
765 769
766# check control registers 770# check control registers
767 stctg %c0,%c15,0(%r15) 771 stctg %c0,%c15,0(%r15)
768 oi 6(%r15),0x20 # enable sigp external interrupts 772 oi 6(%r15),0x40 # enable sigp emergency signal
769 oi 4(%r15),0x10 # switch on low address proctection 773 oi 4(%r15),0x10 # switch on low address proctection
770 lctlg %c0,%c15,0(%r15) 774 lctlg %c0,%c15,0(%r15)
771 775
diff --git a/arch/s390/kernel/s390_ext.c b/arch/s390/kernel/s390_ext.c
index 3bdd38ec71da..207bc511a6e3 100644
--- a/arch/s390/kernel/s390_ext.c
+++ b/arch/s390/kernel/s390_ext.c
@@ -19,7 +19,6 @@
19#include <asm/irq.h> 19#include <asm/irq.h>
20 20
21/* 21/*
22 * Simple hash strategy: index = code & 0xff;
23 * ext_int_hash[index] is the start of the list for all external interrupts 22 * ext_int_hash[index] is the start of the list for all external interrupts
24 * that hash to this index. With the current set of external interrupts 23 * that hash to this index. With the current set of external interrupts
25 * (0x1202 external call, 0x1004 cpu timer, 0x2401 hwc console, 0x4000 24 * (0x1202 external call, 0x1004 cpu timer, 0x2401 hwc console, 0x4000
@@ -27,6 +26,11 @@
27 */ 26 */
28ext_int_info_t *ext_int_hash[256] = { 0, }; 27ext_int_info_t *ext_int_hash[256] = { 0, };
29 28
29static inline int ext_hash(__u16 code)
30{
31 return (code + (code >> 9)) & 0xff;
32}
33
30int register_external_interrupt(__u16 code, ext_int_handler_t handler) 34int register_external_interrupt(__u16 code, ext_int_handler_t handler)
31{ 35{
32 ext_int_info_t *p; 36 ext_int_info_t *p;
@@ -37,7 +41,7 @@ int register_external_interrupt(__u16 code, ext_int_handler_t handler)
37 return -ENOMEM; 41 return -ENOMEM;
38 p->code = code; 42 p->code = code;
39 p->handler = handler; 43 p->handler = handler;
40 index = code & 0xff; 44 index = ext_hash(code);
41 p->next = ext_int_hash[index]; 45 p->next = ext_int_hash[index];
42 ext_int_hash[index] = p; 46 ext_int_hash[index] = p;
43 return 0; 47 return 0;
@@ -52,7 +56,7 @@ int register_early_external_interrupt(__u16 code, ext_int_handler_t handler,
52 return -EINVAL; 56 return -EINVAL;
53 p->code = code; 57 p->code = code;
54 p->handler = handler; 58 p->handler = handler;
55 index = code & 0xff; 59 index = ext_hash(code);
56 p->next = ext_int_hash[index]; 60 p->next = ext_int_hash[index];
57 ext_int_hash[index] = p; 61 ext_int_hash[index] = p;
58 return 0; 62 return 0;
@@ -63,7 +67,7 @@ int unregister_external_interrupt(__u16 code, ext_int_handler_t handler)
63 ext_int_info_t *p, *q; 67 ext_int_info_t *p, *q;
64 int index; 68 int index;
65 69
66 index = code & 0xff; 70 index = ext_hash(code);
67 q = NULL; 71 q = NULL;
68 p = ext_int_hash[index]; 72 p = ext_int_hash[index];
69 while (p != NULL) { 73 while (p != NULL) {
@@ -90,7 +94,7 @@ int unregister_early_external_interrupt(__u16 code, ext_int_handler_t handler,
90 94
91 if (p == NULL || p->code != code || p->handler != handler) 95 if (p == NULL || p->code != code || p->handler != handler)
92 return -EINVAL; 96 return -EINVAL;
93 index = code & 0xff; 97 index = ext_hash(code);
94 q = ext_int_hash[index]; 98 q = ext_int_hash[index];
95 if (p != q) { 99 if (p != q) {
96 while (q != NULL) { 100 while (q != NULL) {
@@ -120,7 +124,7 @@ void do_extint(struct pt_regs *regs, unsigned short code)
120 */ 124 */
121 account_ticks(regs); 125 account_ticks(regs);
122 kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++; 126 kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++;
123 index = code & 0xff; 127 index = ext_hash(code);
124 for (p = ext_int_hash[index]; p; p = p->next) { 128 for (p = ext_int_hash[index]; p; p = p->next) {
125 if (likely(p->code == code)) { 129 if (likely(p->code == code)) {
126 if (likely(p->handler)) 130 if (likely(p->handler))
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index b6d740ac0e6e..5ba5a5485da9 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -299,24 +299,18 @@ void machine_restart(char *command)
299 _machine_restart(command); 299 _machine_restart(command);
300} 300}
301 301
302EXPORT_SYMBOL(machine_restart);
303
304void machine_halt(void) 302void machine_halt(void)
305{ 303{
306 console_unblank(); 304 console_unblank();
307 _machine_halt(); 305 _machine_halt();
308} 306}
309 307
310EXPORT_SYMBOL(machine_halt);
311
312void machine_power_off(void) 308void machine_power_off(void)
313{ 309{
314 console_unblank(); 310 console_unblank();
315 _machine_power_off(); 311 _machine_power_off();
316} 312}
317 313
318EXPORT_SYMBOL(machine_power_off);
319
320static void __init 314static void __init
321add_memory_hole(unsigned long start, unsigned long end) 315add_memory_hole(unsigned long start, unsigned long end)
322{ 316{
@@ -437,12 +431,6 @@ setup_lowcore(void)
437 ctl_set_bit(14, 29); 431 ctl_set_bit(14, 29);
438 } 432 }
439#endif 433#endif
440#ifdef CONFIG_ARCH_S390X
441 if (MACHINE_HAS_DIAG44)
442 lc->diag44_opcode = 0x83000044;
443 else
444 lc->diag44_opcode = 0x07000700;
445#endif /* CONFIG_ARCH_S390X */
446 set_prefix((u32)(unsigned long) lc); 434 set_prefix((u32)(unsigned long) lc);
447} 435}
448 436
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 642572a8e334..da77f001af8d 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -375,7 +375,7 @@ static void smp_ext_bitcall(int cpu, ec_bit_sig sig)
375 * Set signaling bit in lowcore of target cpu and kick it 375 * Set signaling bit in lowcore of target cpu and kick it
376 */ 376 */
377 set_bit(sig, (unsigned long *) &lowcore_ptr[cpu]->ext_call_fast); 377 set_bit(sig, (unsigned long *) &lowcore_ptr[cpu]->ext_call_fast);
378 while(signal_processor(cpu, sigp_external_call) == sigp_busy) 378 while(signal_processor(cpu, sigp_emergency_signal) == sigp_busy)
379 udelay(10); 379 udelay(10);
380} 380}
381 381
@@ -394,7 +394,7 @@ static void smp_ext_bitcall_others(ec_bit_sig sig)
394 * Set signaling bit in lowcore of target cpu and kick it 394 * Set signaling bit in lowcore of target cpu and kick it
395 */ 395 */
396 set_bit(sig, (unsigned long *) &lowcore_ptr[cpu]->ext_call_fast); 396 set_bit(sig, (unsigned long *) &lowcore_ptr[cpu]->ext_call_fast);
397 while (signal_processor(cpu, sigp_external_call) == sigp_busy) 397 while (signal_processor(cpu, sigp_emergency_signal) == sigp_busy)
398 udelay(10); 398 udelay(10);
399 } 399 }
400} 400}
@@ -751,9 +751,9 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
751 unsigned int cpu; 751 unsigned int cpu;
752 int i; 752 int i;
753 753
754 /* request the 0x1202 external interrupt */ 754 /* request the 0x1201 emergency signal external interrupt */
755 if (register_external_interrupt(0x1202, do_ext_call_interrupt) != 0) 755 if (register_external_interrupt(0x1201, do_ext_call_interrupt) != 0)
756 panic("Couldn't request external interrupt 0x1202"); 756 panic("Couldn't request external interrupt 0x1201");
757 smp_check_cpus(max_cpus); 757 smp_check_cpus(max_cpus);
758 memset(lowcore_ptr,0,sizeof(lowcore_ptr)); 758 memset(lowcore_ptr,0,sizeof(lowcore_ptr));
759 /* 759 /*
diff --git a/arch/s390/lib/Makefile b/arch/s390/lib/Makefile
index a8758b1d20a9..b701efa1f00e 100644
--- a/arch/s390/lib/Makefile
+++ b/arch/s390/lib/Makefile
@@ -5,5 +5,5 @@
5EXTRA_AFLAGS := -traditional 5EXTRA_AFLAGS := -traditional
6 6
7lib-y += delay.o string.o 7lib-y += delay.o string.o
8lib-$(CONFIG_ARCH_S390_31) += uaccess.o 8lib-$(CONFIG_ARCH_S390_31) += uaccess.o spinlock.o
9lib-$(CONFIG_ARCH_S390X) += uaccess64.o 9lib-$(CONFIG_ARCH_S390X) += uaccess64.o spinlock.o
diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c
new file mode 100644
index 000000000000..888b5596c195
--- /dev/null
+++ b/arch/s390/lib/spinlock.c
@@ -0,0 +1,133 @@
1/*
2 * arch/s390/lib/spinlock.c
3 * Out of line spinlock code.
4 *
5 * S390 version
6 * Copyright (C) 2004 IBM Deutschland Entwicklung GmbH, IBM Corporation
7 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
8 */
9
10#include <linux/types.h>
11#include <linux/module.h>
12#include <linux/spinlock.h>
13#include <linux/init.h>
14#include <asm/io.h>
15
16atomic_t spin_retry_counter;
17int spin_retry = 1000;
18
19/**
20 * spin_retry= parameter
21 */
22static int __init spin_retry_setup(char *str)
23{
24 spin_retry = simple_strtoul(str, &str, 0);
25 return 1;
26}
27__setup("spin_retry=", spin_retry_setup);
28
29static inline void
30_diag44(void)
31{
32#ifdef __s390x__
33 if (MACHINE_HAS_DIAG44)
34#endif
35 asm volatile("diag 0,0,0x44");
36}
37
38void
39_raw_spin_lock_wait(spinlock_t *lp, unsigned int pc)
40{
41 int count = spin_retry;
42
43 while (1) {
44 if (count-- <= 0) {
45 _diag44();
46 count = spin_retry;
47 }
48 atomic_inc(&spin_retry_counter);
49 if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0)
50 return;
51 }
52}
53EXPORT_SYMBOL(_raw_spin_lock_wait);
54
55int
56_raw_spin_trylock_retry(spinlock_t *lp, unsigned int pc)
57{
58 int count = spin_retry;
59
60 while (count-- > 0) {
61 atomic_inc(&spin_retry_counter);
62 if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0)
63 return 1;
64 }
65 return 0;
66}
67EXPORT_SYMBOL(_raw_spin_trylock_retry);
68
69void
70_raw_read_lock_wait(rwlock_t *rw)
71{
72 unsigned int old;
73 int count = spin_retry;
74
75 while (1) {
76 if (count-- <= 0) {
77 _diag44();
78 count = spin_retry;
79 }
80 atomic_inc(&spin_retry_counter);
81 old = rw->lock & 0x7fffffffU;
82 if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old)
83 return;
84 }
85}
86EXPORT_SYMBOL(_raw_read_lock_wait);
87
88int
89_raw_read_trylock_retry(rwlock_t *rw)
90{
91 unsigned int old;
92 int count = spin_retry;
93
94 while (count-- > 0) {
95 atomic_inc(&spin_retry_counter);
96 old = rw->lock & 0x7fffffffU;
97 if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old)
98 return 1;
99 }
100 return 0;
101}
102EXPORT_SYMBOL(_raw_read_trylock_retry);
103
104void
105_raw_write_lock_wait(rwlock_t *rw)
106{
107 int count = spin_retry;
108
109 while (1) {
110 if (count-- <= 0) {
111 _diag44();
112 count = spin_retry;
113 }
114 atomic_inc(&spin_retry_counter);
115 if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0)
116 return;
117 }
118}
119EXPORT_SYMBOL(_raw_write_lock_wait);
120
121int
122_raw_write_trylock_retry(rwlock_t *rw)
123{
124 int count = spin_retry;
125
126 while (count-- > 0) {
127 atomic_inc(&spin_retry_counter);
128 if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0)
129 return 1;
130 }
131 return 0;
132}
133EXPORT_SYMBOL(_raw_write_trylock_retry);