vsyscall-sysenter.S 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * Code for the vsyscall page. This version uses the sysenter instruction.
  3. *
  4. * NOTE:
  5. * 1) __kernel_vsyscall _must_ be first in this page.
  6. * 2) there are alignment constraints on this stub, see vsyscall-sigreturn.S
  7. * for details.
  8. */
  9. .text
  10. .globl __kernel_vsyscall
  11. .type __kernel_vsyscall,@function
  12. __kernel_vsyscall:
  13. .LSTART_vsyscall:
  14. push %ecx
  15. .Lpush_ecx:
  16. push %edx
  17. .Lpush_edx:
  18. push %ebp
  19. .Lenter_kernel:
  20. movl %esp,%ebp
  21. sysenter
  22. /* 7: align return point with nop's to make disassembly easier */
  23. .space 7,0x90
  24. /* 14: System call restart point is here! (SYSENTER_RETURN - 2) */
  25. jmp .Lenter_kernel
  26. /* 16: System call normal return point is here! */
  27. .globl SYSENTER_RETURN /* Symbol used by entry.S. */
  28. SYSENTER_RETURN:
  29. pop %ebp
  30. .Lpop_ebp:
  31. pop %edx
  32. .Lpop_edx:
  33. pop %ecx
  34. .Lpop_ecx:
  35. ret
  36. .LEND_vsyscall:
  37. .size __kernel_vsyscall,.-.LSTART_vsyscall
  38. .previous
  39. .section .eh_frame,"a",@progbits
  40. .LSTARTFRAMEDLSI:
  41. .long .LENDCIEDLSI-.LSTARTCIEDLSI
  42. .LSTARTCIEDLSI:
  43. .long 0 /* CIE ID */
  44. .byte 1 /* Version number */
  45. .string "zR" /* NUL-terminated augmentation string */
  46. .uleb128 1 /* Code alignment factor */
  47. .sleb128 -4 /* Data alignment factor */
  48. .byte 8 /* Return address register column */
  49. .uleb128 1 /* Augmentation value length */
  50. .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */
  51. .byte 0x0c /* DW_CFA_def_cfa */
  52. .uleb128 4
  53. .uleb128 4
  54. .byte 0x88 /* DW_CFA_offset, column 0x8 */
  55. .uleb128 1
  56. .align 4
  57. .LENDCIEDLSI:
  58. .long .LENDFDEDLSI-.LSTARTFDEDLSI /* Length FDE */
  59. .LSTARTFDEDLSI:
  60. .long .LSTARTFDEDLSI-.LSTARTFRAMEDLSI /* CIE pointer */
  61. .long .LSTART_vsyscall-. /* PC-relative start address */
  62. .long .LEND_vsyscall-.LSTART_vsyscall
  63. .uleb128 0
  64. /* What follows are the instructions for the table generation.
  65. We have to record all changes of the stack pointer. */
  66. .byte 0x04 /* DW_CFA_advance_loc4 */
  67. .long .Lpush_ecx-.LSTART_vsyscall
  68. .byte 0x0e /* DW_CFA_def_cfa_offset */
  69. .byte 0x08 /* RA at offset 8 now */
  70. .byte 0x04 /* DW_CFA_advance_loc4 */
  71. .long .Lpush_edx-.Lpush_ecx
  72. .byte 0x0e /* DW_CFA_def_cfa_offset */
  73. .byte 0x0c /* RA at offset 12 now */
  74. .byte 0x04 /* DW_CFA_advance_loc4 */
  75. .long .Lenter_kernel-.Lpush_edx
  76. .byte 0x0e /* DW_CFA_def_cfa_offset */
  77. .byte 0x10 /* RA at offset 16 now */
  78. .byte 0x85, 0x04 /* DW_CFA_offset %ebp -16 */
  79. /* Finally the epilogue. */
  80. .byte 0x04 /* DW_CFA_advance_loc4 */
  81. .long .Lpop_ebp-.Lenter_kernel
  82. .byte 0x0e /* DW_CFA_def_cfa_offset */
  83. .byte 0x0c /* RA at offset 12 now */
  84. .byte 0xc5 /* DW_CFA_restore %ebp */
  85. .byte 0x04 /* DW_CFA_advance_loc4 */
  86. .long .Lpop_edx-.Lpop_ebp
  87. .byte 0x0e /* DW_CFA_def_cfa_offset */
  88. .byte 0x08 /* RA at offset 8 now */
  89. .byte 0x04 /* DW_CFA_advance_loc4 */
  90. .long .Lpop_ecx-.Lpop_edx
  91. .byte 0x0e /* DW_CFA_def_cfa_offset */
  92. .byte 0x04 /* RA at offset 4 now */
  93. .align 4
  94. .LENDFDEDLSI:
  95. .previous
  96. /*
  97. * Get the common code for the sigreturn entry points.
  98. */
  99. #include "vsyscall-sigreturn.S"