summaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-05-12 21:05:59 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-05-12 21:05:59 +0000
commitba2dacab305c598cd4c34a604f8e276bf5bab5ff (patch)
tree78670a0139bf4d5ace617b29b7eba82bbc74d602 /include/asm-sparc64
parentb77bf69998121e689c5e86cc5630d39a0a9ee6ca (diff)
Merge with Linux 2.3.99-pre7 and various other bits.
Diffstat (limited to 'include/asm-sparc64')
-rw-r--r--include/asm-sparc64/asm_offsets.h84
-rw-r--r--include/asm-sparc64/delay.h5
-rw-r--r--include/asm-sparc64/hardirq.h9
-rw-r--r--include/asm-sparc64/irq.h3
-rw-r--r--include/asm-sparc64/oplib.h3
-rw-r--r--include/asm-sparc64/pgalloc.h15
-rw-r--r--include/asm-sparc64/pgtable.h3
-rw-r--r--include/asm-sparc64/processor.h3
-rw-r--r--include/asm-sparc64/smp.h5
-rw-r--r--include/asm-sparc64/softirq.h3
-rw-r--r--include/asm-sparc64/string.h10
-rw-r--r--include/asm-sparc64/system.h60
-rw-r--r--include/asm-sparc64/timer.h4
13 files changed, 131 insertions, 76 deletions
diff --git a/include/asm-sparc64/asm_offsets.h b/include/asm-sparc64/asm_offsets.h
index f04220ee6..4507a6716 100644
--- a/include/asm-sparc64/asm_offsets.h
+++ b/include/asm-sparc64/asm_offsets.h
@@ -190,9 +190,9 @@
#define ASIZ_task_parent_exec_id 0x00000004
#define AOFF_task_self_exec_id 0x00000834
#define ASIZ_task_self_exec_id 0x00000004
-#define AOFF_task_exit_sem 0x00000838
-#define ASIZ_task_exit_sem 0x00000038
-#define ASIZ_task 0x00000870
+#define AOFF_task_alloc_lock 0x00000838
+#define ASIZ_task_alloc_lock 0x00000004
+#define ASIZ_task 0x00000840
#define AOFF_mm_mmap 0x00000000
#define ASIZ_mm_mmap 0x00000008
#define AOFF_mm_mmap_avl 0x00000008
@@ -235,27 +235,23 @@
#define ASIZ_mm_env_start 0x00000008
#define AOFF_mm_env_end 0x000000c8
#define ASIZ_mm_env_end 0x00000008
-#define AOFF_mm_min_flt 0x000000d0
-#define ASIZ_mm_min_flt 0x00000008
-#define AOFF_mm_maj_flt 0x000000d8
-#define ASIZ_mm_maj_flt 0x00000008
-#define AOFF_mm_rss 0x000000e0
+#define AOFF_mm_rss 0x000000d0
#define ASIZ_mm_rss 0x00000008
-#define AOFF_mm_total_vm 0x000000e8
+#define AOFF_mm_total_vm 0x000000d8
#define ASIZ_mm_total_vm 0x00000008
-#define AOFF_mm_locked_vm 0x000000f0
+#define AOFF_mm_locked_vm 0x000000e0
#define ASIZ_mm_locked_vm 0x00000008
-#define AOFF_mm_def_flags 0x000000f8
+#define AOFF_mm_def_flags 0x000000e8
#define ASIZ_mm_def_flags 0x00000008
-#define AOFF_mm_cpu_vm_mask 0x00000100
+#define AOFF_mm_cpu_vm_mask 0x000000f0
#define ASIZ_mm_cpu_vm_mask 0x00000008
-#define AOFF_mm_swap_cnt 0x00000108
+#define AOFF_mm_swap_cnt 0x000000f8
#define ASIZ_mm_swap_cnt 0x00000008
-#define AOFF_mm_swap_address 0x00000110
+#define AOFF_mm_swap_address 0x00000100
#define ASIZ_mm_swap_address 0x00000008
-#define AOFF_mm_segments 0x00000118
+#define AOFF_mm_segments 0x00000108
#define ASIZ_mm_segments 0x00000008
-#define ASIZ_mm 0x00000120
+#define ASIZ_mm 0x00000110
#define AOFF_thread_ksp 0x00000000
#define ASIZ_thread_ksp 0x00000008
#define AOFF_thread_wstate 0x00000008
@@ -488,9 +484,9 @@
#define ASIZ_task_parent_exec_id 0x00000004
#define AOFF_task_self_exec_id 0x00000a24
#define ASIZ_task_self_exec_id 0x00000004
-#define AOFF_task_exit_sem 0x00000a28
-#define ASIZ_task_exit_sem 0x00000038
-#define ASIZ_task 0x00000a60
+#define AOFF_task_alloc_lock 0x00000a28
+#define ASIZ_task_alloc_lock 0x00000001
+#define ASIZ_task 0x00000a30
#define AOFF_mm_mmap 0x00000000
#define ASIZ_mm_mmap 0x00000008
#define AOFF_mm_mmap_avl 0x00000008
@@ -533,27 +529,23 @@
#define ASIZ_mm_env_start 0x00000008
#define AOFF_mm_env_end 0x000000c8
#define ASIZ_mm_env_end 0x00000008
-#define AOFF_mm_min_flt 0x000000d0
-#define ASIZ_mm_min_flt 0x00000008
-#define AOFF_mm_maj_flt 0x000000d8
-#define ASIZ_mm_maj_flt 0x00000008
-#define AOFF_mm_rss 0x000000e0
+#define AOFF_mm_rss 0x000000d0
#define ASIZ_mm_rss 0x00000008
-#define AOFF_mm_total_vm 0x000000e8
+#define AOFF_mm_total_vm 0x000000d8
#define ASIZ_mm_total_vm 0x00000008
-#define AOFF_mm_locked_vm 0x000000f0
+#define AOFF_mm_locked_vm 0x000000e0
#define ASIZ_mm_locked_vm 0x00000008
-#define AOFF_mm_def_flags 0x000000f8
+#define AOFF_mm_def_flags 0x000000e8
#define ASIZ_mm_def_flags 0x00000008
-#define AOFF_mm_cpu_vm_mask 0x00000100
+#define AOFF_mm_cpu_vm_mask 0x000000f0
#define ASIZ_mm_cpu_vm_mask 0x00000008
-#define AOFF_mm_swap_cnt 0x00000108
+#define AOFF_mm_swap_cnt 0x000000f8
#define ASIZ_mm_swap_cnt 0x00000008
-#define AOFF_mm_swap_address 0x00000110
+#define AOFF_mm_swap_address 0x00000100
#define ASIZ_mm_swap_address 0x00000008
-#define AOFF_mm_segments 0x00000118
+#define AOFF_mm_segments 0x00000108
#define ASIZ_mm_segments 0x00000008
-#define ASIZ_mm 0x00000120
+#define ASIZ_mm 0x00000110
#define AOFF_thread_ksp 0x00000000
#define ASIZ_thread_ksp 0x00000008
#define AOFF_thread_wstate 0x00000008
@@ -784,9 +776,9 @@
#define ASIZ_task_parent_exec_id 0x00000004
#define AOFF_task_self_exec_id 0x00000a3c
#define ASIZ_task_self_exec_id 0x00000004
-#define AOFF_task_exit_sem 0x00000a40
-#define ASIZ_task_exit_sem 0x00000040
-#define ASIZ_task 0x00000a80
+#define AOFF_task_alloc_lock 0x00000a40
+#define ASIZ_task_alloc_lock 0x0000000c
+#define ASIZ_task 0x00000a50
#define AOFF_mm_mmap 0x00000000
#define ASIZ_mm_mmap 0x00000008
#define AOFF_mm_mmap_avl 0x00000008
@@ -829,27 +821,23 @@
#define ASIZ_mm_env_start 0x00000008
#define AOFF_mm_env_end 0x000000d8
#define ASIZ_mm_env_end 0x00000008
-#define AOFF_mm_min_flt 0x000000e0
-#define ASIZ_mm_min_flt 0x00000008
-#define AOFF_mm_maj_flt 0x000000e8
-#define ASIZ_mm_maj_flt 0x00000008
-#define AOFF_mm_rss 0x000000f0
+#define AOFF_mm_rss 0x000000e0
#define ASIZ_mm_rss 0x00000008
-#define AOFF_mm_total_vm 0x000000f8
+#define AOFF_mm_total_vm 0x000000e8
#define ASIZ_mm_total_vm 0x00000008
-#define AOFF_mm_locked_vm 0x00000100
+#define AOFF_mm_locked_vm 0x000000f0
#define ASIZ_mm_locked_vm 0x00000008
-#define AOFF_mm_def_flags 0x00000108
+#define AOFF_mm_def_flags 0x000000f8
#define ASIZ_mm_def_flags 0x00000008
-#define AOFF_mm_cpu_vm_mask 0x00000110
+#define AOFF_mm_cpu_vm_mask 0x00000100
#define ASIZ_mm_cpu_vm_mask 0x00000008
-#define AOFF_mm_swap_cnt 0x00000118
+#define AOFF_mm_swap_cnt 0x00000108
#define ASIZ_mm_swap_cnt 0x00000008
-#define AOFF_mm_swap_address 0x00000120
+#define AOFF_mm_swap_address 0x00000110
#define ASIZ_mm_swap_address 0x00000008
-#define AOFF_mm_segments 0x00000128
+#define AOFF_mm_segments 0x00000118
#define ASIZ_mm_segments 0x00000008
-#define ASIZ_mm 0x00000130
+#define ASIZ_mm 0x00000120
#define AOFF_thread_ksp 0x00000000
#define ASIZ_thread_ksp 0x00000008
#define AOFF_thread_wstate 0x00000008
diff --git a/include/asm-sparc64/delay.h b/include/asm-sparc64/delay.h
index 6d93fde96..4a9bfdb1c 100644
--- a/include/asm-sparc64/delay.h
+++ b/include/asm-sparc64/delay.h
@@ -7,7 +7,8 @@
#ifndef __SPARC64_DELAY_H
#define __SPARC64_DELAY_H
-#ifdef __SMP__
+#include <linux/config.h>
+#ifdef CONFIG_SMP
#include <linux/sched.h>
#include <asm/smp.h>
#endif
@@ -39,7 +40,7 @@ extern __inline__ void __udelay(unsigned long usecs, unsigned long lps)
__delay(usecs);
}
-#ifdef __SMP__
+#ifdef CONFIG_SMP
#define __udelay_val cpu_data[smp_processor_id()].udelay_val
#else
#define __udelay_val loops_per_sec
diff --git a/include/asm-sparc64/hardirq.h b/include/asm-sparc64/hardirq.h
index fac8894e1..92b419aff 100644
--- a/include/asm-sparc64/hardirq.h
+++ b/include/asm-sparc64/hardirq.h
@@ -6,11 +6,12 @@
#ifndef __SPARC64_HARDIRQ_H
#define __SPARC64_HARDIRQ_H
+#include <linux/config.h>
#include <linux/threads.h>
#include <linux/brlock.h>
#include <linux/spinlock.h>
-#ifndef __SMP__
+#ifndef CONFIG_SMP
extern unsigned int local_irq_count;
#define irq_enter(cpu, irq) (local_irq_count++)
#define irq_exit(cpu, irq) (local_irq_count--)
@@ -29,7 +30,7 @@ extern unsigned int local_irq_count;
/* This tests only the local processors hw IRQ context disposition. */
#define in_irq() (local_irq_count != 0)
-#ifndef __SMP__
+#ifndef CONFIG_SMP
#define hardirq_trylock(cpu) ((void)(cpu), local_irq_count == 0)
#define hardirq_endlock(cpu) do { (void)(cpu); } while(0)
@@ -39,7 +40,7 @@ extern unsigned int local_irq_count;
#define synchronize_irq() barrier()
-#else /* (__SMP__) */
+#else /* (CONFIG_SMP) */
static __inline__ int irqs_running(void)
{
@@ -74,6 +75,6 @@ static inline int hardirq_trylock(int cpu)
extern void synchronize_irq(void);
-#endif /* __SMP__ */
+#endif /* CONFIG_SMP */
#endif /* !(__SPARC64_HARDIRQ_H) */
diff --git a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h
index 53124b0ea..cff5236ed 100644
--- a/include/asm-sparc64/irq.h
+++ b/include/asm-sparc64/irq.h
@@ -8,6 +8,7 @@
#ifndef _SPARC64_IRQ_H
#define _SPARC64_IRQ_H
+#include <linux/config.h>
#include <linux/linkage.h>
#include <linux/kernel.h>
@@ -113,7 +114,7 @@ extern unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigne
extern unsigned int sbus_build_irq(void *sbus, unsigned int ino);
extern unsigned int psycho_build_irq(void *psycho, int imap_off, int ino, int need_dma_sync);
-#ifdef __SMP__
+#ifdef CONFIG_SMP
extern void set_cpu_int(int, int);
extern void clear_cpu_int(int, int);
extern void set_irq_udt(int);
diff --git a/include/asm-sparc64/oplib.h b/include/asm-sparc64/oplib.h
index 7036f6e82..963ce73e4 100644
--- a/include/asm-sparc64/oplib.h
+++ b/include/asm-sparc64/oplib.h
@@ -9,6 +9,7 @@
#ifndef __SPARC64_OPLIB_H
#define __SPARC64_OPLIB_H
+#include <linux/config.h>
#include <asm/openprom.h>
/* Enumeration to describe the prom major version we have detected. */
@@ -175,7 +176,7 @@ enum prom_output_device {
extern enum prom_output_device prom_query_output_device(void);
/* Multiprocessor operations... */
-#ifdef __SMP__
+#ifdef CONFIG_SMP
/* Start the CPU with the given device tree node, context table, and context
* at the passed program counter.
*/
diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h
index 9a0d67494..7ca23a02e 100644
--- a/include/asm-sparc64/pgalloc.h
+++ b/include/asm-sparc64/pgalloc.h
@@ -2,6 +2,7 @@
#ifndef _SPARC64_PGALLOC_H
#define _SPARC64_PGALLOC_H
+#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
@@ -32,7 +33,7 @@ extern void __flush_tlb_range(unsigned long context, unsigned long start,
unsigned long pgsz, unsigned long size);
extern void __flush_tlb_page(unsigned long context, unsigned long page, unsigned long r);
-#ifndef __SMP__
+#ifndef CONFIG_SMP
#define flush_cache_all() __flush_cache_all()
#define flush_tlb_all() __flush_tlb_all()
@@ -59,7 +60,7 @@ do { struct mm_struct *__mm = (vma)->vm_mm; \
SECONDARY_CONTEXT); \
} while(0)
-#else /* __SMP__ */
+#else /* CONFIG_SMP */
extern void smp_flush_cache_all(void);
extern void smp_flush_tlb_all(void);
@@ -76,7 +77,7 @@ extern void smp_flush_tlb_page(struct mm_struct *mm, unsigned long page);
#define flush_tlb_page(vma, page) \
smp_flush_tlb_page((vma)->vm_mm, page)
-#endif /* ! __SMP__ */
+#endif /* ! CONFIG_SMP */
/* This will change for Cheetah and later chips. */
#define VPTE_BASE 0xfffffffe00000000
@@ -101,7 +102,7 @@ extern __inline__ void flush_tlb_pgtables(struct mm_struct *mm, unsigned long st
}
/* Page table allocation/freeing. */
-#ifdef __SMP__
+#ifdef CONFIG_SMP
/* Sliiiicck */
#define pgt_quicklists cpu_data[smp_processor_id()]
#else
@@ -118,7 +119,7 @@ extern struct pgtable_cache_struct {
#define pgtable_cache_size (pgt_quicklists.pgcache_size)
#define pgd_cache_size (pgt_quicklists.pgdcache_size)
-#ifndef __SMP__
+#ifndef CONFIG_SMP
extern __inline__ void free_pgd_fast(pgd_t *pgd)
{
@@ -167,7 +168,7 @@ extern __inline__ pgd_t *get_pgd_fast(void)
return (pgd_t *)ret;
}
-#else /* __SMP__ */
+#else /* CONFIG_SMP */
extern __inline__ void free_pgd_fast(pgd_t *pgd)
{
@@ -197,7 +198,7 @@ extern __inline__ void free_pgd_slow(pgd_t *pgd)
free_page((unsigned long)pgd);
}
-#endif /* __SMP__ */
+#endif /* CONFIG_SMP */
extern pmd_t *get_pmd_slow(pgd_t *pgd, unsigned long address_premasked);
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
index f368d64b3..ed35381bc 100644
--- a/include/asm-sparc64/pgtable.h
+++ b/include/asm-sparc64/pgtable.h
@@ -1,4 +1,4 @@
-/* $Id: pgtable.h,v 1.125 2000/04/12 08:10:26 davem Exp $
+/* $Id: pgtable.h,v 1.126 2000/05/05 21:57:03 davem Exp $
* pgtable.h: SpitFire page table operations.
*
* Copyright 1996,1997 David S. Miller (davem@caip.rutgers.edu)
@@ -196,6 +196,7 @@ extern inline pte_t pte_modify(pte_t orig_pte, pgprot_t new_prot)
* Undefined behaviour if not..
*/
#define pte_read(pte) (pte_val(pte) & _PAGE_READ)
+#define pte_exec(pte) pte_read(pte)
#define pte_write(pte) (pte_val(pte) & _PAGE_WRITE)
#define pte_dirty(pte) (pte_val(pte) & _PAGE_MODIFIED)
#define pte_young(pte) (pte_val(pte) & _PAGE_ACCESSED)
diff --git a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h
index 7237736fe..b731a18aa 100644
--- a/include/asm-sparc64/processor.h
+++ b/include/asm-sparc64/processor.h
@@ -13,6 +13,7 @@
*/
#define current_text_addr() ({ void *pc; __asm__("rd %%pc, %0" : "=r" (pc)); pc; })
+#include <linux/config.h>
#include <asm/asi.h>
#include <asm/a.out.h>
#include <asm/pstate.h>
@@ -127,7 +128,7 @@ extern __inline__ unsigned long thread_saved_pc(struct thread_struct *t)
}
/* On Uniprocessor, even in RMO processes see TSO semantics */
-#ifdef __SMP__
+#ifdef CONFIG_SMP
#define TSTATE_INITIAL_MM TSTATE_TSO
#else
#define TSTATE_INITIAL_MM TSTATE_RMO
diff --git a/include/asm-sparc64/smp.h b/include/asm-sparc64/smp.h
index 7bb2b3250..c70b95dad 100644
--- a/include/asm-sparc64/smp.h
+++ b/include/asm-sparc64/smp.h
@@ -6,6 +6,7 @@
#ifndef _SPARC64_SMP_H
#define _SPARC64_SMP_H
+#include <linux/config.h>
#include <linux/threads.h>
#include <asm/asi.h>
@@ -24,7 +25,7 @@ extern struct prom_cpuinfo linux_cpus[64];
#endif /* !(__ASSEMBLY__) */
-#ifdef __SMP__
+#ifdef CONFIG_SMP
#ifndef __ASSEMBLY__
@@ -122,7 +123,7 @@ extern __inline__ void smp_send_stop(void) { }
#define PROC_CHANGE_PENALTY 20
-#endif /* !(__SMP__) */
+#endif /* !(CONFIG_SMP) */
#define NO_PROC_ID 0xFF
diff --git a/include/asm-sparc64/softirq.h b/include/asm-sparc64/softirq.h
index 460c96633..9a4f442ff 100644
--- a/include/asm-sparc64/softirq.h
+++ b/include/asm-sparc64/softirq.h
@@ -6,11 +6,12 @@
#ifndef __SPARC64_SOFTIRQ_H
#define __SPARC64_SOFTIRQ_H
+#include <linux/config.h>
#include <asm/atomic.h>
#include <asm/hardirq.h>
#include <asm/system.h> /* for membar() */
-#ifndef __SMP__
+#ifndef CONFIG_SMP
extern unsigned int local_bh_count;
#else
#define local_bh_count (cpu_data[smp_processor_id()].bh_count)
diff --git a/include/asm-sparc64/string.h b/include/asm-sparc64/string.h
index f6b69aa53..31bbf32e7 100644
--- a/include/asm-sparc64/string.h
+++ b/include/asm-sparc64/string.h
@@ -1,4 +1,4 @@
-/* $Id: string.h,v 1.15 1999/12/23 17:02:20 jj Exp $
+/* $Id: string.h,v 1.16 2000/05/02 01:47:01 davem Exp $
* string.h: External definitions for optimized assembly string
* routines for the Linux Kernel.
*
@@ -41,7 +41,7 @@ extern void *__builtin_memset(void *,int,__kernel_size_t);
#define __HAVE_ARCH_MEMCPY
-extern inline void *__constant_memcpy(void *to, const void *from, __kernel_size_t n)
+static inline void *__constant_memcpy(void *to, const void *from, __kernel_size_t n)
{
if(n) {
if(n <= 32) {
@@ -53,7 +53,7 @@ extern inline void *__constant_memcpy(void *to, const void *from, __kernel_size_
return to;
}
-extern inline void *__nonconstant_memcpy(void *to, const void *from, __kernel_size_t n)
+static inline void *__nonconstant_memcpy(void *to, const void *from, __kernel_size_t n)
{
__memcpy(to, from, n);
return to;
@@ -67,7 +67,7 @@ extern inline void *__nonconstant_memcpy(void *to, const void *from, __kernel_si
#define __HAVE_ARCH_MEMSET
-extern inline void *__constant_memset(void *s, int c, __kernel_size_t count)
+static inline void *__constant_memset(void *s, int c, __kernel_size_t count)
{
extern __kernel_size_t __bzero(void *, __kernel_size_t);
@@ -127,7 +127,7 @@ extern __kernel_size_t strlen(const char *);
extern int __strncmp(const char *, const char *, __kernel_size_t);
-extern inline int __constant_strncmp(const char *src, const char *dest, __kernel_size_t count)
+static inline int __constant_strncmp(const char *src, const char *dest, __kernel_size_t count)
{
register int retval;
switch(count) {
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h
index 1429e7772..895cd74df 100644
--- a/include/asm-sparc64/system.h
+++ b/include/asm-sparc64/system.h
@@ -1,7 +1,8 @@
-/* $Id: system.h,v 1.57 2000/03/27 10:38:57 davem Exp $ */
+/* $Id: system.h,v 1.58 2000/05/05 18:47:41 davem Exp $ */
#ifndef __SPARC64_SYSTEM_H
#define __SPARC64_SYSTEM_H
+#include <linux/config.h>
#include <asm/ptrace.h>
#include <asm/processor.h>
#include <asm/asm_offsets.h>
@@ -71,7 +72,7 @@ extern unsigned long empty_zero_page;
#define local_irq_save(flags) __save_and_cli(flags)
#define local_irq_restore(flags) __restore_flags(flags)
-#ifndef __SMP__
+#ifndef CONFIG_SMP
#define cli() __cli()
#define sti() __sti()
#define save_flags(x) __save_flags(x)
@@ -257,6 +258,61 @@ static __inline__ unsigned long __xchg(unsigned long x, __volatile__ void * ptr,
extern void die_if_kernel(char *str, struct pt_regs *regs) __attribute__ ((noreturn));
+/*
+ * Atomic compare and exchange. Compare OLD with MEM, if identical,
+ * store NEW in MEM. Return the initial value in MEM. Success is
+ * indicated by comparing RETURN with OLD.
+ */
+
+#define __HAVE_ARCH_CMPXCHG 1
+
+extern __inline__ unsigned long
+__cmpxchg_u32(volatile int *m, int old, int new)
+{
+ __asm__ __volatile__("cas [%2], %3, %0"
+ : "=&r" (new)
+ : "0" (new), "r" (m), "r" (old)
+ : "memory");
+
+ return new;
+}
+
+extern __inline__ unsigned long
+__cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new)
+{
+ __asm__ __volatile__("casx [%2], %3, %0"
+ : "=&r" (new)
+ : "0" (new), "r" (m), "r" (old)
+ : "memory");
+
+ return new;
+}
+
+/* This function doesn't exist, so you'll get a linker error
+ if something tries to do an invalid cmpxchg(). */
+extern void __cmpxchg_called_with_bad_pointer(void);
+
+static __inline__ unsigned long
+__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
+{
+ switch (size) {
+ case 4:
+ return __cmpxchg_u32(ptr, old, new);
+ case 8:
+ return __cmpxchg_u64(ptr, old, new);
+ }
+ __cmpxchg_called_with_bad_pointer();
+ 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))); \
+ })
+
#endif /* !(__ASSEMBLY__) */
#endif /* !(__SPARC64_SYSTEM_H) */
diff --git a/include/asm-sparc64/timer.h b/include/asm-sparc64/timer.h
index 2d1067c7d..8eb30d7d8 100644
--- a/include/asm-sparc64/timer.h
+++ b/include/asm-sparc64/timer.h
@@ -23,6 +23,8 @@
* and also profiling if enabled.
*/
+#include <linux/config.h>
+
/* Two timers, traditionally steered to PIL's 10 and 14 respectively.
* But since INO packets are used on sun5, we could use any PIL level
* we like, however for now we use the normal ones.
@@ -48,7 +50,7 @@ struct sun5_timer {
*/
#define SUN5_HZ_TO_LIMIT(__hz) (1000000/(__hz))
-#ifdef __SMP__
+#ifdef CONFIG_SMP
extern unsigned long timer_tick_offset;
extern void timer_tick_interrupt(struct pt_regs *);
#endif