processor.h 812 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef __UM_PROCESSOR_H
  2. #define __UM_PROCESSOR_H
  3. /* include faultinfo structure */
  4. #include <sysdep/faultinfo.h>
  5. #ifdef CONFIG_X86_32
  6. # include "processor_32.h"
  7. #else
  8. # include "processor_64.h"
  9. #endif
  10. #define KSTK_EIP(tsk) KSTK_REG(tsk, HOST_IP)
  11. #define KSTK_ESP(tsk) KSTK_REG(tsk, HOST_SP)
  12. #define KSTK_EBP(tsk) KSTK_REG(tsk, HOST_BP)
  13. #define ARCH_IS_STACKGROW(address) \
  14. (address + 65536 + 32 * sizeof(unsigned long) >= UPT_SP(&current->thread.regs.regs))
  15. #include <asm/user.h>
  16. /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
  17. static inline void rep_nop(void)
  18. {
  19. __asm__ __volatile__("rep;nop": : :"memory");
  20. }
  21. #define cpu_relax() rep_nop()
  22. #define cpu_relax_lowlatency() cpu_relax()
  23. #define task_pt_regs(t) (&(t)->thread.regs)
  24. #include <asm/processor-generic.h>
  25. #endif