2005-04-16 22:20:36 +00:00
|
|
|
#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>
|
|
|
|
|
2008-01-30 22:27:58 +00:00
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
#ifdef HAVE_MODEL_SMALL_ATTRIBUTE
|
2008-01-30 12:32:52 +00:00
|
|
|
# define PER_CPU_ATTRIBUTES __attribute__((__model__ (__small__)))
|
2005-04-16 22:20:36 +00:00
|
|
|
#endif
|
|
|
|
|
2008-01-30 22:27:58 +00:00
|
|
|
#define __my_cpu_offset __ia64_per_cpu_var(local_per_cpu_offset)
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
extern void *per_cpu_init(void);
|
|
|
|
|
|
|
|
#else /* ! SMP */
|
|
|
|
|
|
|
|
#define per_cpu_init() (__phys_per_cpu_start)
|
|
|
|
|
|
|
|
#endif /* SMP */
|
|
|
|
|
2009-02-08 14:58:38 +00:00
|
|
|
#define PER_CPU_BASE_SECTION ".data.percpu"
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
2008-01-30 22:27:58 +00:00
|
|
|
#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);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#endif /* !__ASSEMBLY__ */
|
|
|
|
|
|
|
|
#endif /* _ASM_IA64_PERCPU_H */
|