diff options
Diffstat (limited to 'include/asm-sparc')
-rw-r--r-- | include/asm-sparc/atomic.h | 38 | ||||
-rw-r--r-- | include/asm-sparc/kdebug.h | 4 | ||||
-rw-r--r-- | include/asm-sparc/pgtable.h | 11 | ||||
-rw-r--r-- | include/asm-sparc/poll.h | 14 | ||||
-rw-r--r-- | include/asm-sparc/smp.h | 1 | ||||
-rw-r--r-- | include/asm-sparc/system.h | 2 | ||||
-rw-r--r-- | include/asm-sparc/unistd.h | 6 |
7 files changed, 61 insertions, 15 deletions
diff --git a/include/asm-sparc/atomic.h b/include/asm-sparc/atomic.h index 731fa56e0c37..bdca5416d8b0 100644 --- a/include/asm-sparc/atomic.h +++ b/include/asm-sparc/atomic.h @@ -2,6 +2,7 @@ * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 2000 Anton Blanchard (anton@linuxcare.com.au) + * Copyright (C) 2007 Kyle McMartin (kyle@parisc-linux.org) * * Additions by Keith M Wesolowski (wesolows@foobazco.org) based * on asm-parisc/atomic.h Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>. @@ -10,11 +11,48 @@ #ifndef __ARCH_SPARC_ATOMIC__ #define __ARCH_SPARC_ATOMIC__ +#include <linux/types.h> typedef struct { volatile int counter; } atomic_t; #ifdef __KERNEL__ +/* Emulate cmpxchg() the same way we emulate atomics, + * by hashing the object address and indexing into an array + * of spinlocks to get a bit of performance... + * + * See arch/sparc/lib/atomic32.c for implementation. + * + * Cribbed from <asm-parisc/atomic.h> + */ +#define __HAVE_ARCH_CMPXCHG 1 + +/* bug catcher for when unsupported size is used - won't link */ +extern void __cmpxchg_called_with_bad_pointer(void); +/* we only need to support cmpxchg of a u32 on sparc */ +extern unsigned long __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_); + +/* don't worry...optimizer will get rid of most of this */ +static __inline__ unsigned long +__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size) +{ + switch(size) { + case 4: + return __cmpxchg_u32((u32 *)ptr, (u32)old, (u32)new_); + default: + __cmpxchg_called_with_bad_pointer(); + break; + } + return old; +} + +#define cmpxchg(ptr,o,n) ({ \ + __typeof__(*(ptr)) _o_ = (o); \ + __typeof__(*(ptr)) _n_ = (n); \ + (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \ + (unsigned long)_n_, sizeof(*(ptr))); \ +}) + #define ATOMIC_INIT(i) { (i) } extern int __atomic_add_return(int, atomic_t *); diff --git a/include/asm-sparc/kdebug.h b/include/asm-sparc/kdebug.h index fba92485fdba..631f15ffef73 100644 --- a/include/asm-sparc/kdebug.h +++ b/include/asm-sparc/kdebug.h @@ -58,6 +58,10 @@ static inline void sp_enter_debugger(void) sp_enter_debugger(); \ } while(0) +enum die_val { + DIE_UNUSED, +}; + #endif /* !(__ASSEMBLY__) */ /* Some nice offset defines for assembler code. */ diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h index 4f0a5ba0d6a0..59229aeba27b 100644 --- a/include/asm-sparc/pgtable.h +++ b/include/asm-sparc/pgtable.h @@ -446,6 +446,17 @@ extern int io_remap_pfn_range(struct vm_area_struct *vma, #define GET_IOSPACE(pfn) (pfn >> (BITS_PER_LONG - 4)) #define GET_PFN(pfn) (pfn & 0x0fffffffUL) +#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS +#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ +({ \ + int __changed = !pte_same(*(__ptep), __entry); \ + if (__changed) { \ + set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \ + flush_tlb_page(__vma, __address); \ + } \ + (sparc_cpu_model == sun4c) || __changed; \ +}) + #include <asm-generic/pgtable.h> #endif /* !(__ASSEMBLY__) */ diff --git a/include/asm-sparc/poll.h b/include/asm-sparc/poll.h index 26f13fb35497..091d3ad2e830 100644 --- a/include/asm-sparc/poll.h +++ b/include/asm-sparc/poll.h @@ -1,24 +1,12 @@ #ifndef __SPARC_POLL_H #define __SPARC_POLL_H -#define POLLIN 1 -#define POLLPRI 2 -#define POLLOUT 4 -#define POLLERR 8 -#define POLLHUP 16 -#define POLLNVAL 32 -#define POLLRDNORM 64 #define POLLWRNORM POLLOUT -#define POLLRDBAND 128 #define POLLWRBAND 256 #define POLLMSG 512 #define POLLREMOVE 1024 #define POLLRDHUP 2048 -struct pollfd { - int fd; - short events; - short revents; -}; +#include <asm-generic/poll.h> #endif diff --git a/include/asm-sparc/smp.h b/include/asm-sparc/smp.h index b9da9a600e35..b3f492208fd2 100644 --- a/include/asm-sparc/smp.h +++ b/include/asm-sparc/smp.h @@ -165,6 +165,7 @@ void smp_setup_cpu_possible_map(void); #else /* SMP */ +#define hard_smp_processor_id() 0 #define smp_setup_cpu_possible_map() do { } while (0) #endif /* !(SMP) */ diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h index 100c3eaf3c1f..8b4e23b3bb38 100644 --- a/include/asm-sparc/system.h +++ b/include/asm-sparc/system.h @@ -11,6 +11,7 @@ #include <asm/psr.h> #include <asm/ptrace.h> #include <asm/btfixup.h> +#include <asm/smp.h> #ifndef __ASSEMBLY__ @@ -241,7 +242,6 @@ static inline unsigned long xchg_u32(__volatile__ unsigned long *m, unsigned lon } #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) -#define tas(ptr) (xchg((ptr),1)) extern void __xchg_called_with_bad_pointer(void); diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h index e43ed1d63a9d..64471bcd96f9 100644 --- a/include/asm-sparc/unistd.h +++ b/include/asm-sparc/unistd.h @@ -326,8 +326,12 @@ #define __NR_move_pages 307 #define __NR_getcpu 308 #define __NR_epoll_pwait 309 +#define __NR_utimensat 310 +#define __NR_signalfd 311 +#define __NR_timerfd 312 +#define __NR_eventfd 313 -#define NR_SYSCALLS 310 +#define NR_SYSCALLS 314 #ifdef __KERNEL__ #define __ARCH_WANT_IPC_PARSE_VERSION |