entry.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef __BFIN_ENTRY_H
  2. #define __BFIN_ENTRY_H
  3. #include <asm/setup.h>
  4. #include <asm/page.h>
  5. #ifdef __ASSEMBLY__
  6. #define LFLUSH_I_AND_D 0x00000808
  7. #define LSIGTRAP 5
  8. /* process bits for task_struct.flags */
  9. #define PF_TRACESYS_OFF 3
  10. #define PF_TRACESYS_BIT 5
  11. #define PF_PTRACED_OFF 3
  12. #define PF_PTRACED_BIT 4
  13. #define PF_DTRACE_OFF 1
  14. #define PF_DTRACE_BIT 5
  15. /*
  16. * NOTE! The single-stepping code assumes that all interrupt handlers
  17. * start by saving SYSCFG on the stack with their first instruction.
  18. */
  19. /* This one is used for exceptions, emulation, and NMI. It doesn't push
  20. RETI and doesn't do cli. */
  21. #define SAVE_ALL_SYS save_context_no_interrupts
  22. /* This is used for all normal interrupts. It saves a minimum of registers
  23. to the stack, loads the IRQ number, and jumps to common code. */
  24. #define INTERRUPT_ENTRY(N) \
  25. [--sp] = SYSCFG; \
  26. \
  27. [--sp] = P0; /*orig_p0*/ \
  28. [--sp] = R0; /*orig_r0*/ \
  29. [--sp] = (R7:0,P5:0); \
  30. R0 = (N); \
  31. jump __common_int_entry;
  32. /* For timer interrupts, we need to save IPEND, since the user_mode
  33. macro accesses it to determine where to account time. */
  34. #define TIMER_INTERRUPT_ENTRY(N) \
  35. [--sp] = SYSCFG; \
  36. \
  37. [--sp] = P0; /*orig_p0*/ \
  38. [--sp] = R0; /*orig_r0*/ \
  39. [--sp] = (R7:0,P5:0); \
  40. p0.l = lo(IPEND); \
  41. p0.h = hi(IPEND); \
  42. r1 = [p0]; \
  43. R0 = (N); \
  44. jump __common_int_entry;
  45. /* This one pushes RETI without using CLI. Interrupts are enabled. */
  46. #define SAVE_CONTEXT_SYSCALL save_context_syscall
  47. #define SAVE_CONTEXT save_context_with_interrupts
  48. #define RESTORE_ALL_SYS restore_context_no_interrupts
  49. #define RESTORE_CONTEXT restore_context_with_interrupts
  50. #endif /* __ASSEMBLY__ */
  51. #endif /* __BFIN_ENTRY_H */