sigreturn32.S 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * AArch32 sigreturn code.
  4. * Based on the kuser helpers in arch/arm/kernel/entry-armv.S.
  5. *
  6. * Copyright (C) 2005-2011 Nicolas Pitre <nico@fluxnic.net>
  7. * Copyright (C) 2012-2018 ARM Ltd.
  8. *
  9. * For ARM syscalls, the syscall number has to be loaded into r7.
  10. * We do not support an OABI userspace.
  11. *
  12. * For Thumb syscalls, we also pass the syscall number via r7. We therefore
  13. * need two 16-bit instructions.
  14. */
  15. #include <asm/unistd.h>
  16. .globl __aarch32_sigret_code_start
  17. __aarch32_sigret_code_start:
  18. /*
  19. * ARM Code
  20. */
  21. .byte __NR_compat_sigreturn, 0x70, 0xa0, 0xe3 // mov r7, #__NR_compat_sigreturn
  22. .byte __NR_compat_sigreturn, 0x00, 0x00, 0xef // svc #__NR_compat_sigreturn
  23. /*
  24. * Thumb code
  25. */
  26. .byte __NR_compat_sigreturn, 0x27 // svc #__NR_compat_sigreturn
  27. .byte __NR_compat_sigreturn, 0xdf // mov r7, #__NR_compat_sigreturn
  28. /*
  29. * ARM code
  30. */
  31. .byte __NR_compat_rt_sigreturn, 0x70, 0xa0, 0xe3 // mov r7, #__NR_compat_rt_sigreturn
  32. .byte __NR_compat_rt_sigreturn, 0x00, 0x00, 0xef // svc #__NR_compat_rt_sigreturn
  33. /*
  34. * Thumb code
  35. */
  36. .byte __NR_compat_rt_sigreturn, 0x27 // svc #__NR_compat_rt_sigreturn
  37. .byte __NR_compat_rt_sigreturn, 0xdf // mov r7, #__NR_compat_rt_sigreturn
  38. .globl __aarch32_sigret_code_end
  39. __aarch32_sigret_code_end: