vsyscall-sysenter.S 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * Code for the vsyscall page. This version uses the sysenter instruction.
  3. */
  4. #include <asm/ia32_unistd.h>
  5. #include <asm/offset.h>
  6. .text
  7. .section .text.vsyscall,"ax"
  8. .globl __kernel_vsyscall
  9. .type __kernel_vsyscall,@function
  10. __kernel_vsyscall:
  11. .LSTART_vsyscall:
  12. push %ecx
  13. .Lpush_ecx:
  14. push %edx
  15. .Lpush_edx:
  16. push %ebp
  17. .Lenter_kernel:
  18. movl %esp,%ebp
  19. sysenter
  20. .space 7,0x90
  21. jmp .Lenter_kernel
  22. /* 16: System call normal return point is here! */
  23. pop %ebp
  24. .Lpop_ebp:
  25. pop %edx
  26. .Lpop_edx:
  27. pop %ecx
  28. .Lpop_ecx:
  29. ret
  30. .LEND_vsyscall:
  31. .size __kernel_vsyscall,.-.LSTART_vsyscall
  32. .section .eh_frame,"a",@progbits
  33. .LSTARTFRAME:
  34. .long .LENDCIE-.LSTARTCIE
  35. .LSTARTCIE:
  36. .long 0 /* CIE ID */
  37. .byte 1 /* Version number */
  38. .string "zR" /* NUL-terminated augmentation string */
  39. .uleb128 1 /* Code alignment factor */
  40. .sleb128 -4 /* Data alignment factor */
  41. .byte 8 /* Return address register column */
  42. .uleb128 1 /* Augmentation value length */
  43. .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */
  44. .byte 0x0c /* DW_CFA_def_cfa */
  45. .uleb128 4
  46. .uleb128 4
  47. .byte 0x88 /* DW_CFA_offset, column 0x8 */
  48. .uleb128 1
  49. .align 4
  50. .LENDCIE:
  51. .long .LENDFDE1-.LSTARTFDE1 /* Length FDE */
  52. .LSTARTFDE1:
  53. .long .LSTARTFDE1-.LSTARTFRAME /* CIE pointer */
  54. .long .LSTART_vsyscall-. /* PC-relative start address */
  55. .long .LEND_vsyscall-.LSTART_vsyscall
  56. .uleb128 0 /* Augmentation length */
  57. /* What follows are the instructions for the table generation.
  58. We have to record all changes of the stack pointer. */
  59. .byte 0x04 /* DW_CFA_advance_loc4 */
  60. .long .Lpush_ecx-.LSTART_vsyscall
  61. .byte 0x0e /* DW_CFA_def_cfa_offset */
  62. .byte 0x08 /* RA at offset 8 now */
  63. .byte 0x04 /* DW_CFA_advance_loc4 */
  64. .long .Lpush_edx-.Lpush_ecx
  65. .byte 0x0e /* DW_CFA_def_cfa_offset */
  66. .byte 0x0c /* RA at offset 12 now */
  67. .byte 0x04 /* DW_CFA_advance_loc4 */
  68. .long .Lenter_kernel-.Lpush_edx
  69. .byte 0x0e /* DW_CFA_def_cfa_offset */
  70. .byte 0x10 /* RA at offset 16 now */
  71. .byte 0x85, 0x04 /* DW_CFA_offset %ebp -16 */
  72. /* Finally the epilogue. */
  73. .byte 0x04 /* DW_CFA_advance_loc4 */
  74. .long .Lpop_ebp-.Lenter_kernel
  75. .byte 0x0e /* DW_CFA_def_cfa_offset */
  76. .byte 0x12 /* RA at offset 12 now */
  77. .byte 0xc5 /* DW_CFA_restore %ebp */
  78. .byte 0x04 /* DW_CFA_advance_loc4 */
  79. .long .Lpop_edx-.Lpop_ebp
  80. .byte 0x0e /* DW_CFA_def_cfa_offset */
  81. .byte 0x08 /* RA at offset 8 now */
  82. .byte 0x04 /* DW_CFA_advance_loc4 */
  83. .long .Lpop_ecx-.Lpop_edx
  84. .byte 0x0e /* DW_CFA_def_cfa_offset */
  85. .byte 0x04 /* RA at offset 4 now */
  86. .align 4
  87. .LENDFDE1:
  88. #define SYSCALL_ENTER_KERNEL int $0x80
  89. #include "vsyscall-sigreturn.S"