2005-04-16 15:20:36 -07: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__
|
2009-10-29 06:34:15 -07:00
|
|
|
# define THIS_CPU(var) (var) /* use this to mark accesses to per-CPU variables... */
|
2005-04-16 15:20:36 -07:00
|
|
|
#else /* !__ASSEMBLY__ */
|
|
|
|
|
|
|
|
|
|
|
|
#include <linux/threads.h>
|
|
|
|
|
2008-01-30 15:27:58 -07:00
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
#ifdef HAVE_MODEL_SMALL_ATTRIBUTE
|
2008-01-30 05:32:52 -07:00
|
|
|
# define PER_CPU_ATTRIBUTES __attribute__((__model__ (__small__)))
|
2005-04-16 15:20:36 -07: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 15:20:36 -07:00
|
|
|
|
|
|
|
extern void *per_cpu_init(void);
|
|
|
|
|
|
|
|
#else /* ! SMP */
|
|
|
|
|
|
|
|
#define per_cpu_init() (__phys_per_cpu_start)
|
|
|
|
|
|
|
|
#endif /* SMP */
|
|
|
|
|
2010-02-19 17:03:43 -07:00
|
|
|
#define PER_CPU_BASE_SECTION ".data..percpu"
|
2009-02-08 07:58:38 -07:00
|
|
|
|
2005-04-16 15:20:36 -07: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.
|
|
|
|
*/
|
2010-05-12 03:10:39 -07:00
|
|
|
#define __ia64_per_cpu_var(var) (*({ \
|
|
|
|
__verify_pcpu_ptr(&(var)); \
|
|
|
|
((typeof(var) __kernel __force *)&(var)); \
|
|
|
|
}))
|
2008-01-30 15:27:58 -07:00
|
|
|
|
|
|
|
#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 15:20:36 -07:00
|
|
|
|
|
|
|
#endif /* !__ASSEMBLY__ */
|
|
|
|
|
|
|
|
#endif /* _ASM_IA64_PERCPU_H */
|