resms64x.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* Epilogue stub for 64-bit ms/sysv clobbers: restore and return
  2. Copyright (C) 2016-2022 Free Software Foundation, Inc.
  3. Contributed by Daniel Santos <daniel.santos@pobox.com>
  4. This file is part of GCC.
  5. GCC is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3, or (at your option)
  8. any later version.
  9. GCC is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. Under Section 7 of GPL version 3, you are granted additional
  14. permissions described in the GCC Runtime Library Exception, version
  15. 3.1, as published by the Free Software Foundation.
  16. You should have received a copy of the GNU General Public License and
  17. a copy of the GCC Runtime Library Exception along with this program;
  18. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  19. <http://www.gnu.org/licenses/>. */
  20. #include <cet.h>
  21. #ifdef __x86_64__
  22. #include "i386-asm.h"
  23. /* Epilogue routine for restoring 64-bit ms/sysv registers and returning from
  24. * function. */
  25. .text
  26. cfi_startproc()
  27. cfi_def_cfa(%r10, 8)
  28. MS2SYSV_STUB_BEGIN(resms64x_18)
  29. mov -0x70(%rsi),%r15
  30. MS2SYSV_STUB_BEGIN(resms64x_17)
  31. mov -0x68(%rsi),%r14
  32. MS2SYSV_STUB_BEGIN(resms64x_16)
  33. mov -0x60(%rsi),%r13
  34. MS2SYSV_STUB_BEGIN(resms64x_15)
  35. mov -0x58(%rsi),%r12
  36. MS2SYSV_STUB_BEGIN(resms64x_14)
  37. mov -0x50(%rsi),%rbp
  38. MS2SYSV_STUB_BEGIN(resms64x_13)
  39. mov -0x48(%rsi),%rbx
  40. MS2SYSV_STUB_BEGIN(resms64x_12)
  41. mov -0x40(%rsi),%rdi
  42. SSE_RESTORE
  43. mov -0x38(%rsi),%rsi
  44. mov %r10,%rsp
  45. cfi_def_cfa_register(%rsp)
  46. ret
  47. cfi_endproc()
  48. MS2SYSV_STUB_END(resms64x_12)
  49. MS2SYSV_STUB_END(resms64x_13)
  50. MS2SYSV_STUB_END(resms64x_14)
  51. MS2SYSV_STUB_END(resms64x_15)
  52. MS2SYSV_STUB_END(resms64x_16)
  53. MS2SYSV_STUB_END(resms64x_17)
  54. MS2SYSV_STUB_END(resms64x_18)
  55. #endif /* __x86_64__ */
  56. #if defined(__ELF__) && defined(__linux__)
  57. .section .note.GNU-stack,"",@progbits
  58. .previous
  59. #endif