]>
Commit | Line | Data |
---|---|---|
1 | // | |
2 | // OSAtomicFifo.h | |
3 | // libatomics | |
4 | // | |
5 | // Created by Rokhini Prabhu on 4/7/20. | |
6 | // | |
7 | ||
8 | #ifndef _OS_ATOMIC_FIFO_QUEUE_ | |
9 | #define _OS_ATOMIC_FIFO_QUEUE_ | |
10 | ||
11 | #if defined(__arm64e__) && __has_feature(ptrauth_calls) | |
12 | #include <ptrauth.h> | |
13 | ||
14 | #define COMMPAGE_PFZ_BASE_AUTH_KEY ptrauth_key_process_independent_code | |
15 | #define COMMPAGE_PFZ_FN_AUTH_KEY ptrauth_key_function_pointer | |
16 | #define COMMPAGE_PFZ_BASE_DISCRIMINATOR ptrauth_string_discriminator("pfz") | |
17 | ||
18 | #define COMMPAGE_PFZ_BASE_PTR __ptrauth(COMMPAGE_PFZ_BASE_AUTH_KEY, 1, COMMPAGE_PFZ_BASE_DISCRIMINATOR) | |
19 | ||
20 | #define SIGN_PFZ_FUNCTION_PTR(ptr) ptrauth_sign_unauthenticated(ptr, COMMPAGE_PFZ_FN_AUTH_KEY, 0) | |
21 | ||
22 | #else /* defined(__arm64e__) && __has_feature(ptrauth_calls) */ | |
23 | ||
24 | #define COMMPAGE_PFZ_BASE_AUTH_KEY 0 | |
25 | #define COMMPAGE_PFZ_FN_AUTH_KEY 0 | |
26 | #define COMMPAGE_PFZ_BASE_DISCRIMINATOR 0 | |
27 | ||
28 | #define COMMPAGE_PFZ_BASE_PTR | |
29 | ||
30 | #define SIGN_PFZ_FUNCTION_PTR(ptr) ptr | |
31 | #endif /* defined(__arm64e__) && __has_feature(ptrauth_calls) */ | |
32 | ||
33 | extern void *COMMPAGE_PFZ_BASE_PTR commpage_pfz_base; | |
34 | ||
35 | #endif /* _OS_ATOMIC_FIFO_QUEUE_ */ |