syscall.S 1.8 KB

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