processor-i386.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
  3. * Licensed under the GPL
  4. */
  5. #ifndef __UM_PROCESSOR_I386_H
  6. #define __UM_PROCESSOR_I386_H
  7. extern int host_has_xmm;
  8. extern int host_has_cmov;
  9. /* include faultinfo structure */
  10. #include "sysdep/faultinfo.h"
  11. struct arch_thread {
  12. unsigned long debugregs[8];
  13. int debugregs_seq;
  14. struct faultinfo faultinfo;
  15. };
  16. #define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \
  17. .debugregs_seq = 0, \
  18. .faultinfo = { 0, 0, 0 } }
  19. #include "asm/arch/user.h"
  20. /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
  21. static inline void rep_nop(void)
  22. {
  23. __asm__ __volatile__("rep;nop": : :"memory");
  24. }
  25. #define cpu_relax() rep_nop()
  26. /*
  27. * Default implementation of macro that returns current
  28. * instruction pointer ("program counter"). Stolen
  29. * from asm-i386/processor.h
  30. */
  31. #define current_text_addr() \
  32. ({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; })
  33. #define ARCH_IS_STACKGROW(address) \
  34. (address + 32 >= UPT_SP(&current->thread.regs.regs))
  35. #define KSTK_EIP(tsk) KSTK_REG(tsk, EIP)
  36. #define KSTK_ESP(tsk) KSTK_REG(tsk, UESP)
  37. #define KSTK_EBP(tsk) KSTK_REG(tsk, EBP)
  38. #include "asm/processor-generic.h"
  39. #endif