diff options
Diffstat (limited to 'include/asm-sparc')
-rw-r--r-- | include/asm-sparc/atomic.h | 1 | ||||
-rw-r--r-- | include/asm-sparc/mutex.h | 9 | ||||
-rw-r--r-- | include/asm-sparc/system.h | 12 | ||||
-rw-r--r-- | include/asm-sparc/thread_info.h | 3 |
4 files changed, 21 insertions, 4 deletions
diff --git a/include/asm-sparc/atomic.h b/include/asm-sparc/atomic.h index accb4967e9d..e1033170bd3 100644 --- a/include/asm-sparc/atomic.h +++ b/include/asm-sparc/atomic.h @@ -20,6 +20,7 @@ typedef struct { volatile int counter; } atomic_t; extern int __atomic_add_return(int, atomic_t *); extern int atomic_cmpxchg(atomic_t *, int, int); +#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) extern int atomic_add_unless(atomic_t *, int, int); extern void atomic_set(atomic_t *, int); diff --git a/include/asm-sparc/mutex.h b/include/asm-sparc/mutex.h new file mode 100644 index 00000000000..458c1f7fbc1 --- /dev/null +++ b/include/asm-sparc/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-sparc/system.h b/include/asm-sparc/system.h index 1f6b71f9e1b..58dd162927b 100644 --- a/include/asm-sparc/system.h +++ b/include/asm-sparc/system.h @@ -155,7 +155,7 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr, "here:\n" \ : "=&r" (last) \ : "r" (&(current_set[hard_smp_processor_id()])), \ - "r" ((next)->thread_info), \ + "r" (task_thread_info(next)), \ "i" (TI_KPSR), \ "i" (TI_KSP), \ "i" (TI_TASK) \ @@ -166,6 +166,16 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr, } 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) +{ +} + +/* * Changing the IRQ level on the Sparc. */ extern void local_irq_restore(unsigned long); diff --git a/include/asm-sparc/thread_info.h b/include/asm-sparc/thread_info.h index ff6ccb3d24c..65f060b040a 100644 --- a/include/asm-sparc/thread_info.h +++ b/include/asm-sparc/thread_info.h @@ -92,9 +92,6 @@ BTFIXUPDEF_CALL(struct thread_info *, alloc_thread_info, void) BTFIXUPDEF_CALL(void, free_thread_info, struct thread_info *) #define free_thread_info(ti) BTFIXUP_CALL(free_thread_info)(ti) -#define get_thread_info(ti) get_task_struct((ti)->task) -#define put_thread_info(ti) put_task_struct((ti)->task) - #endif /* __ASSEMBLY__ */ /* |