processor.h 808 B

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