summaryrefslogtreecommitdiffstats
path: root/include/asm-s390
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-s390')
-rw-r--r--include/asm-s390/elf.h2
-rw-r--r--include/asm-s390/kexec.h2
-rw-r--r--include/asm-s390/page.h3
-rw-r--r--include/asm-s390/system.h44
-rw-r--r--include/asm-s390/user.h3
5 files changed, 44 insertions, 10 deletions
diff --git a/include/asm-s390/elf.h b/include/asm-s390/elf.h
index 91d06325cc79..b73a424d0f97 100644
--- a/include/asm-s390/elf.h
+++ b/include/asm-s390/elf.h
@@ -113,7 +113,6 @@
typedef s390_fp_regs elf_fpregset_t;
typedef s390_regs elf_gregset_t;
-#ifdef __KERNEL__
#include <linux/sched.h> /* for task_struct */
#include <asm/system.h> /* for save_access_regs */
@@ -214,6 +213,5 @@ do { \
clear_thread_flag(TIF_31BIT); \
} while (0)
#endif /* __s390x__ */
-#endif
#endif
diff --git a/include/asm-s390/kexec.h b/include/asm-s390/kexec.h
index 7592af708b41..f219c6411e0b 100644
--- a/include/asm-s390/kexec.h
+++ b/include/asm-s390/kexec.h
@@ -10,7 +10,9 @@
#ifndef _S390_KEXEC_H
#define _S390_KEXEC_H
+#ifdef __KERNEL__
#include <asm/page.h>
+#endif
#include <asm/processor.h>
/*
* KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
diff --git a/include/asm-s390/page.h b/include/asm-s390/page.h
index 584d0ee3c7f6..a55f9d979dfb 100644
--- a/include/asm-s390/page.h
+++ b/include/asm-s390/page.h
@@ -19,7 +19,6 @@
#define PAGE_DEFAULT_ACC 0
#define PAGE_DEFAULT_KEY (PAGE_DEFAULT_ACC << 4)
-#ifdef __KERNEL__
#include <asm/setup.h>
#ifndef __ASSEMBLY__
@@ -172,6 +171,4 @@ static inline int pfn_valid(unsigned long pfn)
#include <asm-generic/memory_model.h>
#include <asm-generic/page.h>
-#endif /* __KERNEL__ */
-
#endif /* _S390_PAGE_H */
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h
index 44bda786eef7..15aba30601a3 100644
--- a/include/asm-s390/system.h
+++ b/include/asm-s390/system.h
@@ -201,9 +201,9 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
#define __HAVE_ARCH_CMPXCHG 1
-#define cmpxchg(ptr,o,n)\
- ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
- (unsigned long)(n),sizeof(*(ptr))))
+#define cmpxchg(ptr, o, n) \
+ ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \
+ (unsigned long)(n), sizeof(*(ptr))))
extern void __cmpxchg_called_with_bad_pointer(void);
@@ -355,6 +355,44 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
#include <linux/irqflags.h>
+#include <asm-generic/cmpxchg-local.h>
+
+static inline unsigned long __cmpxchg_local(volatile void *ptr,
+ unsigned long old,
+ unsigned long new, int size)
+{
+ switch (size) {
+ case 1:
+ case 2:
+ case 4:
+#ifdef __s390x__
+ case 8:
+#endif
+ return __cmpxchg(ptr, old, new, size);
+ default:
+ return __cmpxchg_local_generic(ptr, old, new, size);
+ }
+
+ return old;
+}
+
+/*
+ * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
+ * them available.
+ */
+#define cmpxchg_local(ptr, o, n) \
+ ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \
+ (unsigned long)(n), sizeof(*(ptr))))
+#ifdef __s390x__
+#define cmpxchg64_local(ptr, o, n) \
+ ({ \
+ BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
+ cmpxchg_local((ptr), (o), (n)); \
+ })
+#else
+#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
+#endif
+
/*
* Use to set psw mask except for the first byte which
* won't be changed by this function.
diff --git a/include/asm-s390/user.h b/include/asm-s390/user.h
index 1dc74baf03c4..1b050e35fdc6 100644
--- a/include/asm-s390/user.h
+++ b/include/asm-s390/user.h
@@ -63,8 +63,7 @@ struct user {
the top of the stack is always found in the
esp register. */
long int signal; /* Signal that caused the core dump. */
- struct user_regs_struct *u_ar0;
- /* Used by gdb to help find the values for */
+ unsigned long u_ar0; /* Used by gdb to help find the values for */
/* the registers. */
unsigned long magic; /* To uniquely identify a core file */
char u_comm[32]; /* User command that was responsible */