2 /* The variable containing the handler function pointer */
3 .global _ZN6__xray19XRayPatchedFunctionE
4 /* Word-aligned function entry point */
6 /* Let C/C++ see the symbol */
7 .global __xray_FunctionEntry
8 .type __xray_FunctionEntry, %function
9 /* In C++ it is void extern "C" __xray_FunctionEntry(uint32_t FuncId) with
10 FuncId passed in W0 register. */
12 /* Move the return address beyond the end of sled data. The 12 bytes of
13 data are inserted in the code of the runtime patch, between the call
14 instruction and the instruction returned into. The data contains 32
15 bits of instrumented function ID and 64 bits of the address of
16 the current trampoline. */
18 /* Push the registers which may be modified by the handler function */
19 STP X1, X2, [SP, #-16]!
20 STP X3, X4, [SP, #-16]!
21 STP X5, X6, [SP, #-16]!
22 STP X7, X30, [SP, #-16]!
23 STP Q0, Q1, [SP, #-32]!
24 STP Q2, Q3, [SP, #-32]!
25 STP Q4, Q5, [SP, #-32]!
26 STP Q6, Q7, [SP, #-32]!
27 /* Load the address of _ZN6__xray19XRayPatchedFunctionE into X1 */
28 LDR X1, =_ZN6__xray19XRayPatchedFunctionE
29 /* Load the handler function pointer into X2 */
31 /* Handler address is nullptr if handler is not set */
33 BEQ FunctionEntry_restore
34 /* Function ID is already in W0 (the first parameter).
35 X1=0 means that we are tracing an entry event */
37 /* Call the handler with 2 parameters in W0 and X1 */
39 FunctionEntry_restore:
40 /* Pop the saved registers */
45 LDP X7, X30, [SP], #16
51 /* Word-aligned function entry point */
53 /* Let C/C++ see the symbol */
54 .global __xray_FunctionExit
55 .type __xray_FunctionExit, %function
56 /* In C++ it is void extern "C" __xray_FunctionExit(uint32_t FuncId) with
57 FuncId passed in W0 register. */
59 /* Move the return address beyond the end of sled data. The 12 bytes of
60 data are inserted in the code of the runtime patch, between the call
61 instruction and the instruction returned into. The data contains 32
62 bits of instrumented function ID and 64 bits of the address of
63 the current trampoline. */
65 /* Push the registers which may be modified by the handler function */
66 STP X1, X2, [SP, #-16]!
67 STP X3, X4, [SP, #-16]!
68 STP X5, X6, [SP, #-16]!
69 STP X7, X30, [SP, #-16]!
71 /* Load the address of _ZN6__xray19XRayPatchedFunctionE into X1 */
72 LDR X1, =_ZN6__xray19XRayPatchedFunctionE
73 /* Load the handler function pointer into X2 */
75 /* Handler address is nullptr if handler is not set */
77 BEQ FunctionExit_restore
78 /* Function ID is already in W0 (the first parameter).
79 X1=1 means that we are tracing an exit event */
81 /* Call the handler with 2 parameters in W0 and X1 */
85 LDP X7, X30, [SP], #16