vsyscall-syscall.S 1.8 KB

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