percpu.h 658 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef __ARCH_I386_PERCPU__
  2. #define __ARCH_I386_PERCPU__
  3. #ifndef __ASSEMBLY__
  4. #include <asm-generic/percpu.h>
  5. #else
  6. /*
  7. * PER_CPU finds an address of a per-cpu variable.
  8. *
  9. * Args:
  10. * var - variable name
  11. * cpu - 32bit register containing the current CPU number
  12. *
  13. * The resulting address is stored in the "cpu" argument.
  14. *
  15. * Example:
  16. * PER_CPU(cpu_gdt_descr, %ebx)
  17. */
  18. #ifdef CONFIG_SMP
  19. #define PER_CPU(var, cpu) \
  20. movl __per_cpu_offset(,cpu,4), cpu; \
  21. addl $per_cpu__/**/var, cpu;
  22. #else /* ! SMP */
  23. #define PER_CPU(var, cpu) \
  24. movl $per_cpu__/**/var, cpu;
  25. #endif /* SMP */
  26. #endif /* !__ASSEMBLY__ */
  27. #endif /* __ARCH_I386_PERCPU__ */