diff options
Diffstat (limited to 'include/asm-s390')
-rw-r--r-- | include/asm-s390/bug.h | 11 | ||||
-rw-r--r-- | include/asm-s390/ccwdev.h | 2 | ||||
-rw-r--r-- | include/asm-s390/cio.h | 2 | ||||
-rw-r--r-- | include/asm-s390/debug.h | 2 | ||||
-rw-r--r-- | include/asm-s390/elf.h | 28 | ||||
-rw-r--r-- | include/asm-s390/futex.h | 5 | ||||
-rw-r--r-- | include/asm-s390/irqflags.h | 18 | ||||
-rw-r--r-- | include/asm-s390/pgalloc.h | 2 | ||||
-rw-r--r-- | include/asm-s390/processor.h | 16 | ||||
-rw-r--r-- | include/asm-s390/setup.h | 3 | ||||
-rw-r--r-- | include/asm-s390/system.h | 10 | ||||
-rw-r--r-- | include/asm-s390/timex.h | 4 |
12 files changed, 62 insertions, 41 deletions
diff --git a/include/asm-s390/bug.h b/include/asm-s390/bug.h index 7ddaa05b98d8..876898363944 100644 --- a/include/asm-s390/bug.h +++ b/include/asm-s390/bug.h @@ -5,9 +5,18 @@ #ifdef CONFIG_BUG +static inline __attribute__((noreturn)) void __do_illegal_op(void) +{ +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) + __builtin_trap(); +#else + asm volatile(".long 0"); +#endif +} + #define BUG() do { \ printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ - __builtin_trap(); \ + __do_illegal_op(); \ } while (0) #define HAVE_ARCH_BUG diff --git a/include/asm-s390/ccwdev.h b/include/asm-s390/ccwdev.h index 12456cb2f882..58c70acffc73 100644 --- a/include/asm-s390/ccwdev.h +++ b/include/asm-s390/ccwdev.h @@ -63,7 +63,7 @@ ccw_device_id_match(const struct ccw_device_id *array, return id; } - return 0; + return NULL; } /* The struct ccw device is our replacement for the globally accessible diff --git a/include/asm-s390/cio.h b/include/asm-s390/cio.h index 2b1619306351..28fdd6e2b8ba 100644 --- a/include/asm-s390/cio.h +++ b/include/asm-s390/cio.h @@ -276,6 +276,8 @@ extern void wait_cons_dev(void); extern void clear_all_subchannels(void); +extern void cio_reset_channel_paths(void); + extern void css_schedule_reprobe(void); #endif diff --git a/include/asm-s390/debug.h b/include/asm-s390/debug.h index 7f1ef99fd1e1..c00dd2b3dc50 100644 --- a/include/asm-s390/debug.h +++ b/include/asm-s390/debug.h @@ -10,7 +10,6 @@ #define DEBUG_H #include <linux/fs.h> -#include <linux/string.h> /* Note: * struct __debug_entry must be defined outside of #ifdef __KERNEL__ @@ -35,6 +34,7 @@ struct __debug_entry{ #define __DEBUG_FEATURE_VERSION 2 /* version of debug feature */ #ifdef __KERNEL__ +#include <linux/string.h> #include <linux/spinlock.h> #include <linux/kernel.h> #include <linux/time.h> diff --git a/include/asm-s390/elf.h b/include/asm-s390/elf.h index 710646e64f7d..c0d629d61d3e 100644 --- a/include/asm-s390/elf.h +++ b/include/asm-s390/elf.h @@ -93,19 +93,6 @@ #define R_390_NUM 61 /* - * ELF register definitions.. - */ - -#include <linux/sched.h> /* for task_struct */ -#include <asm/ptrace.h> -#include <asm/user.h> -#include <asm/system.h> /* for save_access_regs */ - - -typedef s390_fp_regs elf_fpregset_t; -typedef s390_regs elf_gregset_t; - -/* * These are used to set parameters in the core dumps. */ #ifndef __s390x__ @@ -117,6 +104,20 @@ typedef s390_regs elf_gregset_t; #define ELF_ARCH EM_S390 /* + * ELF register definitions.. + */ + +#include <asm/ptrace.h> +#include <asm/user.h> + +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 */ + +/* * This is used to ensure we don't load something for the wrong architecture. */ #define elf_check_arch(x) \ @@ -198,7 +199,6 @@ static inline int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpregs) #define ELF_PLATFORM (NULL) -#ifdef __KERNEL__ #ifndef __s390x__ #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) #else /* __s390x__ */ diff --git a/include/asm-s390/futex.h b/include/asm-s390/futex.h index 1802775568b9..ffedf14f89f6 100644 --- a/include/asm-s390/futex.h +++ b/include/asm-s390/futex.h @@ -98,9 +98,10 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) return -EFAULT; - asm volatile(" cs %1,%4,0(%5)\n" + asm volatile(" sacf 256\n" + " cs %1,%4,0(%5)\n" "0: lr %0,%1\n" - "1:\n" + "1: sacf 0\n" #ifndef __s390x__ ".section __ex_table,\"a\"\n" " .align 4\n" diff --git a/include/asm-s390/irqflags.h b/include/asm-s390/irqflags.h index 65f4db627e7a..3b566a5b3cc7 100644 --- a/include/asm-s390/irqflags.h +++ b/include/asm-s390/irqflags.h @@ -25,16 +25,22 @@ __flags; \ }) -#define raw_local_save_flags(x) \ - __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x), "m" (x) ) - -#define raw_local_irq_restore(x) \ - __asm__ __volatile__("ssm 0(%0)" : : "a" (&x), "m" (x) : "memory") +#define raw_local_save_flags(x) \ +do { \ + typecheck(unsigned long, x); \ + __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x), "m" (x) ); \ +} while (0) + +#define raw_local_irq_restore(x) \ +do { \ + typecheck(unsigned long, x); \ + __asm__ __volatile__("ssm 0(%0)" : : "a" (&x), "m" (x) : "memory"); \ +} while (0) #define raw_irqs_disabled() \ ({ \ unsigned long flags; \ - local_save_flags(flags); \ + raw_local_save_flags(flags); \ !((flags >> __FLAG_SHIFT) & 3); \ }) diff --git a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h index 3002fda89d33..a78e853e0dd5 100644 --- a/include/asm-s390/pgalloc.h +++ b/include/asm-s390/pgalloc.h @@ -142,7 +142,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long vmaddr) pte_t *pte = pte_alloc_one_kernel(mm, vmaddr); if (pte) return virt_to_page(pte); - return 0; + return NULL; } static inline void pte_free_kernel(pte_t *pte) diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h index c5cbc4bd8414..5b71d3731723 100644 --- a/include/asm-s390/processor.h +++ b/include/asm-s390/processor.h @@ -199,15 +199,13 @@ unsigned long get_wchan(struct task_struct *p); /* * Give up the time slice of the virtual PU. */ -#ifndef __s390x__ -# define cpu_relax() asm volatile ("diag 0,0,68" : : : "memory") -#else /* __s390x__ */ -# define cpu_relax() \ - do { \ - if (MACHINE_HAS_DIAG44) \ - asm volatile ("diag 0,0,68" : : : "memory"); \ - } while (0) -#endif /* __s390x__ */ +static inline void cpu_relax(void) +{ + if (MACHINE_HAS_DIAG44) + asm volatile ("diag 0,0,68" : : : "memory"); + else + barrier(); +} /* * Set PSW to specified value. diff --git a/include/asm-s390/setup.h b/include/asm-s390/setup.h index da3fd4a7bb32..19e31979309a 100644 --- a/include/asm-s390/setup.h +++ b/include/asm-s390/setup.h @@ -40,15 +40,16 @@ extern unsigned long machine_flags; #define MACHINE_IS_VM (machine_flags & 1) #define MACHINE_IS_P390 (machine_flags & 4) #define MACHINE_HAS_MVPG (machine_flags & 16) -#define MACHINE_HAS_DIAG44 (machine_flags & 32) #define MACHINE_HAS_IDTE (machine_flags & 128) #ifndef __s390x__ #define MACHINE_HAS_IEEE (machine_flags & 2) #define MACHINE_HAS_CSP (machine_flags & 8) +#define MACHINE_HAS_DIAG44 (1) #else /* __s390x__ */ #define MACHINE_HAS_IEEE (1) #define MACHINE_HAS_CSP (1) +#define MACHINE_HAS_DIAG44 (machine_flags & 32) #endif /* __s390x__ */ diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h index 9ab186ffde23..16040048cd1b 100644 --- a/include/asm-s390/system.h +++ b/include/asm-s390/system.h @@ -128,8 +128,13 @@ extern void account_system_vtime(struct task_struct *); #define nop() __asm__ __volatile__ ("nop") -#define xchg(ptr,x) \ - ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(void *)(ptr),sizeof(*(ptr)))) +#define xchg(ptr,x) \ +({ \ + __typeof__(*(ptr)) __ret; \ + __ret = (__typeof__(*(ptr))) \ + __xchg((unsigned long)(x), (void *)(ptr),sizeof(*(ptr))); \ + __ret; \ +}) static inline unsigned long __xchg(unsigned long x, void * ptr, int size) { @@ -299,7 +304,6 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) #define set_mb(var, value) do { var = value; mb(); } while (0) -#define set_wmb(var, value) do { var = value; wmb(); } while (0) #ifdef __s390x__ diff --git a/include/asm-s390/timex.h b/include/asm-s390/timex.h index 4848057dafe4..5d0332a4c2bd 100644 --- a/include/asm-s390/timex.h +++ b/include/asm-s390/timex.h @@ -19,7 +19,7 @@ static inline cycles_t get_cycles(void) { cycles_t cycles; - __asm__("stck 0(%1)" : "=m" (cycles) : "a" (&cycles) : "cc"); + __asm__ __volatile__ ("stck 0(%1)" : "=m" (cycles) : "a" (&cycles) : "cc"); return cycles >> 2; } @@ -27,7 +27,7 @@ static inline unsigned long long get_clock (void) { unsigned long long clk; - __asm__("stck 0(%1)" : "=m" (clk) : "a" (&clk) : "cc"); + __asm__ __volatile__ ("stck 0(%1)" : "=m" (clk) : "a" (&clk) : "cc"); return clk; } |