percpu.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef _ASM_IA64_PERCPU_H
  2. #define _ASM_IA64_PERCPU_H
  3. /*
  4. * Copyright (C) 2002-2003 Hewlett-Packard Co
  5. * David Mosberger-Tang <davidm@hpl.hp.com>
  6. */
  7. #define PERCPU_ENOUGH_ROOM PERCPU_PAGE_SIZE
  8. #ifdef __ASSEMBLY__
  9. # define THIS_CPU(var) (per_cpu__##var) /* use this to mark accesses to per-CPU variables... */
  10. #else /* !__ASSEMBLY__ */
  11. #include <linux/threads.h>
  12. #ifdef CONFIG_SMP
  13. #ifdef HAVE_MODEL_SMALL_ATTRIBUTE
  14. # define PER_CPU_ATTRIBUTES __attribute__((__model__ (__small__)))
  15. #endif
  16. #define __my_cpu_offset __ia64_per_cpu_var(local_per_cpu_offset)
  17. extern void *per_cpu_init(void);
  18. #else /* ! SMP */
  19. #define per_cpu_init() (__phys_per_cpu_start)
  20. #endif /* SMP */
  21. #define PER_CPU_BASE_SECTION ".data.percpu"
  22. /*
  23. * Be extremely careful when taking the address of this variable! Due to virtual
  24. * remapping, it is different from the canonical address returned by __get_cpu_var(var)!
  25. * On the positive side, using __ia64_per_cpu_var() instead of __get_cpu_var() is slightly
  26. * more efficient.
  27. */
  28. #define __ia64_per_cpu_var(var) per_cpu__##var
  29. #include <asm-generic/percpu.h>
  30. /* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */
  31. DECLARE_PER_CPU(unsigned long, local_per_cpu_offset);
  32. #endif /* !__ASSEMBLY__ */
  33. #endif /* _ASM_IA64_PERCPU_H */