smp_mpidr.h 373 B

1234567891011121314151617
  1. #ifndef ASMARM_SMP_MIDR_H
  2. #define ASMARM_SMP_MIDR_H
  3. #define hard_smp_processor_id() \
  4. ({ \
  5. unsigned int cpunum; \
  6. __asm__("\n" \
  7. "1: mrc p15, 0, %0, c0, c0, 5\n" \
  8. " .pushsection \".alt.smp.init\", \"a\"\n"\
  9. " .long 1b\n" \
  10. " mov %0, #0\n" \
  11. " .popsection" \
  12. : "=r" (cpunum)); \
  13. cpunum &= 0x0F; \
  14. })
  15. #endif