android_kernel_motorola_sm6225/include/asm-ia64/percpu.h
travis@sgi.com 05991bef10 ia64: use generic percpu
ia64 has a special processor specific mapping that can be used to locate the
offset for the current per cpu area.

Cc: linux-ia64@vger.kernel.org
Signed-off-by: Mike Travis <travis@sgi.com>
Acked-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-01-30 23:27:58 +01:00

49 lines
1.2 KiB
C

#ifndef _ASM_IA64_PERCPU_H
#define _ASM_IA64_PERCPU_H
/*
* Copyright (C) 2002-2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
*/
#define PERCPU_ENOUGH_ROOM PERCPU_PAGE_SIZE
#ifdef __ASSEMBLY__
# define THIS_CPU(var) (per_cpu__##var) /* use this to mark accesses to per-CPU variables... */
#else /* !__ASSEMBLY__ */
#include <linux/threads.h>
#ifdef HAVE_MODEL_SMALL_ATTRIBUTE
# define PER_CPU_ATTRIBUTES __attribute__((__model__ (__small__)))
#endif
#ifdef CONFIG_SMP
#define __my_cpu_offset __ia64_per_cpu_var(local_per_cpu_offset)
extern void *per_cpu_init(void);
#else /* ! SMP */
#define per_cpu_init() (__phys_per_cpu_start)
#endif /* SMP */
/*
* Be extremely careful when taking the address of this variable! Due to virtual
* remapping, it is different from the canonical address returned by __get_cpu_var(var)!
* On the positive side, using __ia64_per_cpu_var() instead of __get_cpu_var() is slightly
* more efficient.
*/
#define __ia64_per_cpu_var(var) per_cpu__##var
#include <asm-generic/percpu.h>
/* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */
DECLARE_PER_CPU(unsigned long, local_per_cpu_offset);
#endif /* !__ASSEMBLY__ */
#endif /* _ASM_IA64_PERCPU_H */