restart_syscall.S 647 B

1234567891011121314151617181920212223242526272829303132
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Syscall restart trampoline for 32 and 64 bits processes.
  4. *
  5. * Copyright (C) 2018-2022 Helge Deller <[email protected]>
  6. * Copyright (C) 2022 John David Anglin <[email protected]>
  7. */
  8. #include <asm/unistd.h>
  9. #include <asm/vdso.h>
  10. #include <linux/linkage.h>
  11. .text
  12. ENTRY_CFI(__kernel_restart_syscall)
  13. /*
  14. * Setup a trampoline to restart the syscall
  15. * with __NR_restart_syscall
  16. */
  17. /* load return pointer */
  18. #if defined(__VDSO64__)
  19. ldd 0(%sp), %r31
  20. #elif defined(__VDSO32__)
  21. ldw 0(%sp), %r31
  22. #endif
  23. be 0x100(%sr2, %r0)
  24. ldi __NR_restart_syscall, %r20
  25. ENDPROC_CFI(__kernel_restart_syscall)