head_32.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #ifndef __SPARC_HEAD_H
  2. #define __SPARC_HEAD_H
  3. #define KERNBASE 0xf0000000 /* First address the kernel will eventually be */
  4. #define WRITE_PAUSE nop; nop; nop; /* Have to do this after %wim/%psr chg */
  5. /* Here are some trap goodies */
  6. /* Generic trap entry. */
  7. #define TRAP_ENTRY(type, label) \
  8. rd %psr, %l0; b label; rd %wim, %l3; nop;
  9. /* Data/text faults */
  10. #define SRMMU_TFAULT rd %psr, %l0; rd %wim, %l3; b srmmu_fault; mov 1, %l7;
  11. #define SRMMU_DFAULT rd %psr, %l0; rd %wim, %l3; b srmmu_fault; mov 0, %l7;
  12. /* This is for traps we should NEVER get. */
  13. #define BAD_TRAP(num) \
  14. rd %psr, %l0; mov num, %l7; b bad_trap_handler; rd %wim, %l3;
  15. /* This is for traps when we want just skip the instruction which caused it */
  16. #define SKIP_TRAP(type, name) \
  17. jmpl %l2, %g0; rett %l2 + 4; nop; nop;
  18. /* Notice that for the system calls we pull a trick. We load up a
  19. * different pointer to the system call vector table in %l7, but call
  20. * the same generic system call low-level entry point. The trap table
  21. * entry sequences are also HyperSparc pipeline friendly ;-)
  22. */
  23. /* Software trap for Linux system calls. */
  24. #define LINUX_SYSCALL_TRAP \
  25. sethi %hi(sys_call_table), %l7; \
  26. or %l7, %lo(sys_call_table), %l7; \
  27. b linux_sparc_syscall; \
  28. rd %psr, %l0;
  29. #define BREAKPOINT_TRAP \
  30. b breakpoint_trap; \
  31. rd %psr,%l0; \
  32. nop; \
  33. nop;
  34. #ifdef CONFIG_KGDB
  35. #define KGDB_TRAP(num) \
  36. b kgdb_trap_low; \
  37. rd %psr,%l0; \
  38. nop; \
  39. nop;
  40. #else
  41. #define KGDB_TRAP(num) \
  42. BAD_TRAP(num)
  43. #endif
  44. /* The Get Condition Codes software trap for userland. */
  45. #define GETCC_TRAP \
  46. b getcc_trap_handler; rd %psr, %l0; nop; nop;
  47. /* The Set Condition Codes software trap for userland. */
  48. #define SETCC_TRAP \
  49. b setcc_trap_handler; rd %psr, %l0; nop; nop;
  50. /* The Get PSR software trap for userland. */
  51. #define GETPSR_TRAP \
  52. rd %psr, %i0; jmp %l2; rett %l2 + 4; nop;
  53. /* This is for hard interrupts from level 1-14, 15 is non-maskable (nmi) and
  54. * gets handled with another macro.
  55. */
  56. #define TRAP_ENTRY_INTERRUPT(int_level) \
  57. mov int_level, %l7; rd %psr, %l0; b real_irq_entry; rd %wim, %l3;
  58. /* Window overflows/underflows are special and we need to try to be as
  59. * efficient as possible here....
  60. */
  61. #define WINDOW_SPILL \
  62. rd %psr, %l0; rd %wim, %l3; b spill_window_entry; andcc %l0, PSR_PS, %g0;
  63. #define WINDOW_FILL \
  64. rd %psr, %l0; rd %wim, %l3; b fill_window_entry; andcc %l0, PSR_PS, %g0;
  65. #endif /* __SPARC_HEAD_H */