vsyscall-syscall.S 1.8 KB

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