2005-04-16 16:20:36 -06: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 15:27:58 -07:00
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
|
2005-04-16 16:20:36 -06:00
|
|
|
#ifdef HAVE_MODEL_SMALL_ATTRIBUTE
|
2008-01-30 05:32:52 -07:00
|
|
|
# define PER_CPU_ATTRIBUTES __attribute__((__model__ (__small__)))
|
2005-04-16 16:20:36 -06:00
|
|
|
#endif
|
|
|
|
|
2008-01-30 15:27:58 -07:00
|
|
|
#define __my_cpu_offset __ia64_per_cpu_var(local_per_cpu_offset)
|
2005-04-16 16:20:36 -06:00
|
|
|
|
|
|
|
extern void *per_cpu_init(void);
|
|
|
|
|
|
|
|
#else /* ! SMP */
|
|
|
|
|
2008-01-30 15:27:58 -07:00
|
|
|
#define PER_CPU_ATTRIBUTES __attribute__((__section__(".data.percpu")))
|
|
|
|
|
2005-04-16 16:20:36 -06:00
|
|
|
#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.
|
|
|
|
*/
|
2008-01-30 15:27:58 -07: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 16:20:36 -06:00
|
|
|
|
|
|
|
#endif /* !__ASSEMBLY__ */
|
|
|
|
|
|
|
|
#endif /* _ASM_IA64_PERCPU_H */
|