arm64.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Copyright (c) ChakraCore Project Contributors. All rights reserved.
  4. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  5. //-------------------------------------------------------------------------------------------------------
  6. // ARM64-specific macro definitions
  7. #pragma once
  8. #ifndef _M_ARM64
  9. #error Include arm64.h in builds of ARM64 targets only.
  10. #endif
  11. #ifdef __getReg
  12. #define arm64_GET_CURRENT_FRAME() ((LPVOID)__getReg(29))
  13. #else
  14. extern "C" LPVOID arm64_GET_CURRENT_FRAME(void);
  15. #endif
  16. extern "C" VOID arm64_SAVE_REGISTERS(void*);
  17. /*
  18. * The relevant part of the frame looks like this (high addresses at the top, low ones at the bottom):
  19. *
  20. * ----------------------
  21. * r3 <=== Homed input parameters
  22. * r2 <
  23. * r1 <
  24. * r0 <===
  25. * lr <=== return address
  26. * r11 <=== current r11 (frame pointer)
  27. * ...
  28. */
  29. const DWORD ReturnAddrOffsetFromFramePtr = 1;
  30. const DWORD ArgOffsetFromFramePtr = 2;