]>
git.saurik.com Git - apple/libplatform.git/blob - src/ucontext/arm64/asm_help.h
2 * Copyright (c) 2020 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 /* ASM Macro helpers */
25 #if defined(__ASSEMBLER__)
27 .macro ARM64_STACK_PROLOG
28 #if __has_feature(ptrauth_returns)
33 .macro ARM64_STACK_EPILOG
34 #if __has_feature(ptrauth_returns)
42 stp fp, lr, [sp, #-16]! %% \
47 ldp fp, lr, [sp], #16 %%
48 #endif /* ASSEMBLER */
50 /* Offsets of the various register states inside of the mcontext data */
51 #define MCONTEXT_OFFSET_X0 16
53 #define MCONTEXT_OFFSET_X19_X20 168
54 #define MCONTEXT_OFFSET_X21_X22 184
55 #define MCONTEXT_OFFSET_X23_X24 200
57 #define MCONTEXT_OFFSET_X25_X26 216
58 #define MCONTEXT_OFFSET_X27_X28 232
60 #define MCONTEXT_OFFSET_FP_LR 248
61 #define MCONTEXT_OFFSET_SP 264
62 #define MCONTEXT_OFFSET_FLAGS 284
64 #define MCONTEXT_OFFSET_D8 424
65 #define MCONTEXT_OFFSET_D9 440
66 #define MCONTEXT_OFFSET_D10 456
67 #define MCONTEXT_OFFSET_D11 472
68 #define MCONTEXT_OFFSET_D12 488
69 #define MCONTEXT_OFFSET_D13 504
70 #define MCONTEXT_OFFSET_D14 520
71 #define MCONTEXT_OFFSET_D15 536
73 #if __has_feature(ptrauth_calls)
74 #define LR_SIGNED_WITH_IB 0x2 /* Copied from __DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR */
75 #define LR_SIGNED_WITH_IB_BIT 0x1