entry-header.S 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #include <linux/init.h>
  2. #include <linux/linkage.h>
  3. #include <asm/assembler.h>
  4. #include <asm/asm-offsets.h>
  5. #include <asm/errno.h>
  6. #include <asm/thread_info.h>
  7. @ Bad Abort numbers
  8. @ -----------------
  9. @
  10. #define BAD_PREFETCH 0
  11. #define BAD_DATA 1
  12. #define BAD_ADDREXCPTN 2
  13. #define BAD_IRQ 3
  14. #define BAD_UNDEFINSTR 4
  15. @
  16. @ Most of the stack format comes from struct pt_regs, but with
  17. @ the addition of 8 bytes for storing syscall args 5 and 6.
  18. @ This _must_ remain a multiple of 8 for EABI.
  19. @
  20. #define S_OFF 8
  21. /*
  22. * The SWI code relies on the fact that R0 is at the bottom of the stack
  23. * (due to slow/fast restore user regs).
  24. */
  25. #if S_R0 != 0
  26. #error "Please fix"
  27. #endif
  28. .macro zero_fp
  29. #ifdef CONFIG_FRAME_POINTER
  30. mov fp, #0
  31. #endif
  32. .endm
  33. .macro get_thread_info, rd
  34. mov \rd, sp, lsr #13
  35. mov \rd, \rd, lsl #13
  36. .endm
  37. .macro alignment_trap, rtemp
  38. #ifdef CONFIG_ALIGNMENT_TRAP
  39. ldr \rtemp, .LCcralign
  40. ldr \rtemp, [\rtemp]
  41. mcr p15, 0, \rtemp, c1, c0
  42. #endif
  43. .endm
  44. /*
  45. * These are the registers used in the syscall handler, and allow us to
  46. * have in theory up to 7 arguments to a function - r0 to r6.
  47. *
  48. * r7 is reserved for the system call number for thumb mode.
  49. *
  50. * Note that tbl == why is intentional.
  51. *
  52. * We must set at least "tsk" and "why" when calling ret_with_reschedule.
  53. */
  54. scno .req r7 @ syscall number
  55. tbl .req r8 @ syscall table pointer
  56. why .req r8 @ Linux syscall (!= 0)
  57. tsk .req r9 @ current thread_info