diff options
Diffstat (limited to 'include/asm-s390')
-rw-r--r-- | include/asm-s390/atomic.h | 2 | ||||
-rw-r--r-- | include/asm-s390/cache.h | 1 | ||||
-rw-r--r-- | include/asm-s390/elf.h | 2 | ||||
-rw-r--r-- | include/asm-s390/futex.h | 49 | ||||
-rw-r--r-- | include/asm-s390/ioctl.h | 89 | ||||
-rw-r--r-- | include/asm-s390/kexec.h | 5 | ||||
-rw-r--r-- | include/asm-s390/mutex.h | 9 | ||||
-rw-r--r-- | include/asm-s390/processor.h | 8 | ||||
-rw-r--r-- | include/asm-s390/s390_rdev.h | 2 | ||||
-rw-r--r-- | include/asm-s390/sigcontext.h | 2 | ||||
-rw-r--r-- | include/asm-s390/system.h | 15 | ||||
-rw-r--r-- | include/asm-s390/thread_info.h | 2 |
12 files changed, 37 insertions, 149 deletions
diff --git a/include/asm-s390/atomic.h b/include/asm-s390/atomic.h index d82aedf616f..be6fefe223d 100644 --- a/include/asm-s390/atomic.h +++ b/include/asm-s390/atomic.h @@ -75,6 +75,8 @@ static __inline__ void atomic_set_mask(unsigned long mask, atomic_t * v) __CS_LOOP(v, mask, "or"); } +#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) + static __inline__ int atomic_cmpxchg(atomic_t *v, int old, int new) { __asm__ __volatile__(" cs %0,%3,0(%2)\n" diff --git a/include/asm-s390/cache.h b/include/asm-s390/cache.h index 29845378b20..e20cdd9074d 100644 --- a/include/asm-s390/cache.h +++ b/include/asm-s390/cache.h @@ -13,7 +13,6 @@ #define L1_CACHE_BYTES 256 #define L1_CACHE_SHIFT 8 -#define L1_CACHE_SHIFT_MAX 8 /* largest L1 which this arch supports */ #define ARCH_KMALLOC_MINALIGN 8 diff --git a/include/asm-s390/elf.h b/include/asm-s390/elf.h index 372d51cccd5..710646e64f7 100644 --- a/include/asm-s390/elf.h +++ b/include/asm-s390/elf.h @@ -163,7 +163,7 @@ static inline int dump_regs(struct pt_regs *ptregs, elf_gregset_t *regs) static inline int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs) { - struct pt_regs *ptregs = __KSTK_PTREGS(tsk); + struct pt_regs *ptregs = task_pt_regs(tsk); memcpy(®s->psw, &ptregs->psw, sizeof(regs->psw)+sizeof(regs->gprs)); memcpy(regs->acrs, tsk->thread.acrs, sizeof(regs->acrs)); regs->orig_gpr2 = ptregs->orig_gpr2; diff --git a/include/asm-s390/futex.h b/include/asm-s390/futex.h index 9feff4ce142..6a332a9f099 100644 --- a/include/asm-s390/futex.h +++ b/include/asm-s390/futex.h @@ -1,53 +1,6 @@ #ifndef _ASM_FUTEX_H #define _ASM_FUTEX_H -#ifdef __KERNEL__ +#include <asm-generic/futex.h> -#include <linux/futex.h> -#include <asm/errno.h> -#include <asm/uaccess.h> - -static inline int -futex_atomic_op_inuser (int encoded_op, int __user *uaddr) -{ - int op = (encoded_op >> 28) & 7; - int cmp = (encoded_op >> 24) & 15; - int oparg = (encoded_op << 8) >> 20; - int cmparg = (encoded_op << 20) >> 20; - int oldval = 0, ret; - if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) - oparg = 1 << oparg; - - if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) - return -EFAULT; - - inc_preempt_count(); - - switch (op) { - case FUTEX_OP_SET: - case FUTEX_OP_ADD: - case FUTEX_OP_OR: - case FUTEX_OP_ANDN: - case FUTEX_OP_XOR: - default: - ret = -ENOSYS; - } - - dec_preempt_count(); - - if (!ret) { - switch (cmp) { - case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; - case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; - case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; - case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; - case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; - case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; - default: ret = -ENOSYS; - } - } - return ret; -} - -#endif #endif diff --git a/include/asm-s390/ioctl.h b/include/asm-s390/ioctl.h index df7394345ac..b279fe06dfe 100644 --- a/include/asm-s390/ioctl.h +++ b/include/asm-s390/ioctl.h @@ -1,88 +1 @@ -/* - * include/asm-s390/ioctl.h - * - * S390 version - * - * Derived from "include/asm-i386/ioctl.h" - */ - -#ifndef _S390_IOCTL_H -#define _S390_IOCTL_H - -/* ioctl command encoding: 32 bits total, command in lower 16 bits, - * size of the parameter structure in the lower 14 bits of the - * upper 16 bits. - * Encoding the size of the parameter structure in the ioctl request - * is useful for catching programs compiled with old versions - * and to avoid overwriting user space outside the user buffer area. - * The highest 2 bits are reserved for indicating the ``access mode''. - * NOTE: This limits the max parameter size to 16kB -1 ! - */ - -/* - * The following is for compatibility across the various Linux - * platforms. The i386 ioctl numbering scheme doesn't really enforce - * a type field. De facto, however, the top 8 bits of the lower 16 - * bits are indeed used as a type field, so we might just as well make - * this explicit here. Please be sure to use the decoding macros - * below from now on. - */ -#define _IOC_NRBITS 8 -#define _IOC_TYPEBITS 8 -#define _IOC_SIZEBITS 14 -#define _IOC_DIRBITS 2 - -#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) -#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) -#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) -#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) - -#define _IOC_NRSHIFT 0 -#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) -#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) -#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) - -/* - * Direction bits. - */ -#define _IOC_NONE 0U -#define _IOC_WRITE 1U -#define _IOC_READ 2U - -#define _IOC(dir,type,nr,size) \ - (((dir) << _IOC_DIRSHIFT) | \ - ((type) << _IOC_TYPESHIFT) | \ - ((nr) << _IOC_NRSHIFT) | \ - ((size) << _IOC_SIZESHIFT)) - -/* provoke compile error for invalid uses of size argument */ -extern unsigned long __invalid_size_argument_for_IOC; -#define _IOC_TYPECHECK(t) \ - ((sizeof(t) == sizeof(t[1]) && \ - sizeof(t) < (1 << _IOC_SIZEBITS)) ? \ - sizeof(t) : __invalid_size_argument_for_IOC) - -/* used to create numbers */ -#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) -#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size))) -#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) -#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) -#define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) -#define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) -#define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) - -/* used to decode ioctl numbers.. */ -#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) -#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) -#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) -#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) - -/* ...and for the drivers/sound files... */ - -#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) -#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) -#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) -#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) -#define IOCSIZE_SHIFT (_IOC_SIZESHIFT) - -#endif /* _S390_IOCTL_H */ +#include <asm-generic/ioctl.h> diff --git a/include/asm-s390/kexec.h b/include/asm-s390/kexec.h index 54cf7d9f251..ce28ddda0f5 100644 --- a/include/asm-s390/kexec.h +++ b/include/asm-s390/kexec.h @@ -35,8 +35,9 @@ #define KEXEC_ARCH KEXEC_ARCH_S390 #define MAX_NOTE_BYTES 1024 -typedef u32 note_buf_t[MAX_NOTE_BYTES/4]; -extern note_buf_t crash_notes[]; +/* Provide a dummy definition to avoid build failures. */ +static inline void crash_setup_regs(struct pt_regs *newregs, + struct pt_regs *oldregs) { } #endif /*_S390_KEXEC_H */ diff --git a/include/asm-s390/mutex.h b/include/asm-s390/mutex.h new file mode 100644 index 00000000000..458c1f7fbc1 --- /dev/null +++ b/include/asm-s390/mutex.h @@ -0,0 +1,9 @@ +/* + * Pull in the generic implementation for the mutex fastpath. + * + * TODO: implement optimized primitives instead, or leave the generic + * implementation in place, or pick the atomic_xchg() based generic + * implementation. (see asm-generic/mutex-xchg.h for details) + */ + +#include <asm-generic/mutex-dec.h> diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h index 4ec652ebb3b..c5cbc4bd841 100644 --- a/include/asm-s390/processor.h +++ b/include/asm-s390/processor.h @@ -191,10 +191,10 @@ extern void show_registers(struct pt_regs *regs); extern void show_trace(struct task_struct *task, unsigned long *sp); unsigned long get_wchan(struct task_struct *p); -#define __KSTK_PTREGS(tsk) ((struct pt_regs *) \ - ((unsigned long) tsk->thread_info + THREAD_SIZE - sizeof(struct pt_regs))) -#define KSTK_EIP(tsk) (__KSTK_PTREGS(tsk)->psw.addr) -#define KSTK_ESP(tsk) (__KSTK_PTREGS(tsk)->gprs[15]) +#define task_pt_regs(tsk) ((struct pt_regs *) \ + (task_stack_page(tsk) + THREAD_SIZE) - 1) +#define KSTK_EIP(tsk) (task_pt_regs(tsk)->psw.addr) +#define KSTK_ESP(tsk) (task_pt_regs(tsk)->gprs[15]) /* * Give up the time slice of the virtual PU. diff --git a/include/asm-s390/s390_rdev.h b/include/asm-s390/s390_rdev.h index 3ad78f2b9c4..6fa20442a48 100644 --- a/include/asm-s390/s390_rdev.h +++ b/include/asm-s390/s390_rdev.h @@ -2,7 +2,7 @@ * include/asm-s390/ccwdev.h * * Copyright (C) 2002,2005 IBM Deutschland Entwicklung GmbH, IBM Corporation - * Author(s): Cornelia Huck <cohuck@de.ibm.com> + * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com> * Carsten Otte <cotte@de.ibm.com> * * Interface for s390 root device diff --git a/include/asm-s390/sigcontext.h b/include/asm-s390/sigcontext.h index 803545351dd..aeb6e0b1332 100644 --- a/include/asm-s390/sigcontext.h +++ b/include/asm-s390/sigcontext.h @@ -8,6 +8,8 @@ #ifndef _ASM_S390_SIGCONTEXT_H #define _ASM_S390_SIGCONTEXT_H +#include <linux/compiler.h> + #define __NUM_GPRS 16 #define __NUM_FPRS 16 #define __NUM_ACRS 16 diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h index 864cae7e1fd..b2e65e8bf81 100644 --- a/include/asm-s390/system.h +++ b/include/asm-s390/system.h @@ -104,14 +104,25 @@ static inline void restore_access_regs(unsigned int *acrs) prev = __switch_to(prev,next); \ } while (0) +/* + * On SMP systems, when the scheduler does migration-cost autodetection, + * it needs a way to flush as much of the CPU's caches as possible. + * + * TODO: fill this in! + */ +static inline void sched_cacheflush(void) +{ +} + #ifdef CONFIG_VIRT_CPU_ACCOUNTING -extern void account_user_vtime(struct task_struct *); +extern void account_vtime(struct task_struct *); +extern void account_tick_vtime(struct task_struct *); extern void account_system_vtime(struct task_struct *); #endif #define finish_arch_switch(prev) do { \ set_fs(current->thread.mm_segment); \ - account_system_vtime(prev); \ + account_vtime(prev); \ } while (0) #define nop() __asm__ __volatile__ ("nop") diff --git a/include/asm-s390/thread_info.h b/include/asm-s390/thread_info.h index 6c18a3f2431..f3797a52c4e 100644 --- a/include/asm-s390/thread_info.h +++ b/include/asm-s390/thread_info.h @@ -81,8 +81,6 @@ static inline struct thread_info *current_thread_info(void) #define alloc_thread_info(tsk) ((struct thread_info *) \ __get_free_pages(GFP_KERNEL,THREAD_ORDER)) #define free_thread_info(ti) free_pages((unsigned long) (ti),THREAD_ORDER) -#define get_thread_info(ti) get_task_struct((ti)->task) -#define put_thread_info(ti) put_task_struct((ti)->task) #endif |