syscall.S 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Code for the vDSO. This version uses the syscall instruction.
  3. *
  4. * First get the common code for the sigreturn entry points.
  5. * This must come first.
  6. */
  7. #define SYSCALL_ENTER_KERNEL syscall
  8. #include "sigreturn.S"
  9. #include <asm/segment.h>
  10. .text
  11. .globl __kernel_vsyscall
  12. .type __kernel_vsyscall,@function
  13. ALIGN
  14. __kernel_vsyscall:
  15. .LSTART_vsyscall:
  16. push %ebp
  17. .Lpush_ebp:
  18. movl %ecx, %ebp
  19. syscall
  20. movl $__USER32_DS, %ecx
  21. movl %ecx, %ss
  22. movl %ebp, %ecx
  23. popl %ebp
  24. .Lpop_ebp:
  25. ret
  26. .LEND_vsyscall:
  27. .size __kernel_vsyscall,.-.LSTART_vsyscall
  28. .section .eh_frame,"a",@progbits
  29. .LSTARTFRAME:
  30. .long .LENDCIE-.LSTARTCIE
  31. .LSTARTCIE:
  32. .long 0 /* CIE ID */
  33. .byte 1 /* Version number */
  34. .string "zR" /* NUL-terminated augmentation string */
  35. .uleb128 1 /* Code alignment factor */
  36. .sleb128 -4 /* Data alignment factor */
  37. .byte 8 /* Return address register column */
  38. .uleb128 1 /* Augmentation value length */
  39. .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */
  40. .byte 0x0c /* DW_CFA_def_cfa */
  41. .uleb128 4
  42. .uleb128 4
  43. .byte 0x88 /* DW_CFA_offset, column 0x8 */
  44. .uleb128 1
  45. .align 4
  46. .LENDCIE:
  47. .long .LENDFDE1-.LSTARTFDE1 /* Length FDE */
  48. .LSTARTFDE1:
  49. .long .LSTARTFDE1-.LSTARTFRAME /* CIE pointer */
  50. .long .LSTART_vsyscall-. /* PC-relative start address */
  51. .long .LEND_vsyscall-.LSTART_vsyscall
  52. .uleb128 0 /* Augmentation length */
  53. /* What follows are the instructions for the table generation.
  54. We have to record all changes of the stack pointer. */
  55. .byte 0x40 + .Lpush_ebp-.LSTART_vsyscall /* DW_CFA_advance_loc */
  56. .byte 0x0e /* DW_CFA_def_cfa_offset */
  57. .uleb128 8
  58. .byte 0x85, 0x02 /* DW_CFA_offset %ebp -8 */
  59. .byte 0x40 + .Lpop_ebp-.Lpush_ebp /* DW_CFA_advance_loc */
  60. .byte 0xc5 /* DW_CFA_restore %ebp */
  61. .byte 0x0e /* DW_CFA_def_cfa_offset */
  62. .uleb128 4
  63. .align 4
  64. .LENDFDE1:
  65. .previous
  66. /*
  67. * Pad out the segment to match the size of the sysenter.S version.
  68. */
  69. VDSO32_vsyscall_eh_frame_size = 0x40
  70. .section .data,"aw",@progbits
  71. .space VDSO32_vsyscall_eh_frame_size-(.LENDFDE1-.LSTARTFRAME), 0
  72. .previous