entry.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. #ifdef CONFIG_IPIPE
  25. # define LOAD_IPIPE_IPEND \
  26. P0.l = lo(IPEND); \
  27. P0.h = hi(IPEND); \
  28. R1 = [P0];
  29. #else
  30. # define LOAD_IPIPE_IPEND
  31. #endif
  32. #define INTERRUPT_ENTRY(N) \
  33. [--sp] = SYSCFG; \
  34. \
  35. [--sp] = P0; /*orig_p0*/ \
  36. [--sp] = R0; /*orig_r0*/ \
  37. [--sp] = (R7:0,P5:0); \
  38. R0 = (N); \
  39. LOAD_IPIPE_IPEND \
  40. jump __common_int_entry;
  41. /* For timer interrupts, we need to save IPEND, since the user_mode
  42. macro accesses it to determine where to account time. */
  43. #define TIMER_INTERRUPT_ENTRY(N) \
  44. [--sp] = SYSCFG; \
  45. \
  46. [--sp] = P0; /*orig_p0*/ \
  47. [--sp] = R0; /*orig_r0*/ \
  48. [--sp] = (R7:0,P5:0); \
  49. p0.l = lo(IPEND); \
  50. p0.h = hi(IPEND); \
  51. r1 = [p0]; \
  52. R0 = (N); \
  53. jump __common_int_entry;
  54. /* This one pushes RETI without using CLI. Interrupts are enabled. */
  55. #define SAVE_CONTEXT_SYSCALL save_context_syscall
  56. #define SAVE_CONTEXT save_context_with_interrupts
  57. #define SAVE_CONTEXT_CPLB save_context_cplb
  58. #define RESTORE_ALL_SYS restore_context_no_interrupts
  59. #define RESTORE_CONTEXT restore_context_with_interrupts
  60. #define RESTORE_CONTEXT_CPLB restore_context_cplb
  61. #endif /* __ASSEMBLY__ */
  62. #endif /* __BFIN_ENTRY_H */