xref: /linux/tools/perf/util/libunwind/arm64.c (revision 03c11eb3b16dc0058589751dfd91f254be2be613)
1b2441318SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0
2057fbfb2SHe Kuang /*
3057fbfb2SHe Kuang  * This file setups defines to compile arch specific binary from the
4057fbfb2SHe Kuang  * generic one.
5057fbfb2SHe Kuang  *
6057fbfb2SHe Kuang  * The function 'LIBUNWIND__ARCH_REG_ID' name is set according to arch
74d39c89fSIngo Molnar  * name and the definition of this function is included directly from
8057fbfb2SHe Kuang  * 'arch/arm64/util/unwind-libunwind.c', to make sure that this function
9057fbfb2SHe Kuang  * is defined no matter what arch the host is.
10057fbfb2SHe Kuang  *
11057fbfb2SHe Kuang  * Finally, the arch specific unwind methods are exported which will
12057fbfb2SHe Kuang  * be assigned to each arm64 thread.
13057fbfb2SHe Kuang  */
14057fbfb2SHe Kuang 
15057fbfb2SHe Kuang #define REMOTE_UNWIND_LIBUNWIND
16057fbfb2SHe Kuang 
173bd03c95SHe Kuang /* Define arch specific functions & regs for libunwind, should be
183bd03c95SHe Kuang  * defined before including "unwind.h"
193bd03c95SHe Kuang  */
20057fbfb2SHe Kuang #define LIBUNWIND__ARCH_REG_ID(regnum) libunwind__arm64_reg_id(regnum)
21057fbfb2SHe Kuang 
22057fbfb2SHe Kuang #include "unwind.h"
23057fbfb2SHe Kuang #include "libunwind-aarch64.h"
24d3b58af9SGerman Gomez #define perf_event_arm_regs perf_event_arm64_regs
25*8803880fSJames Clark #include <../../../arch/arm64/include/uapi/asm/perf_regs.h>
26d3b58af9SGerman Gomez #undef perf_event_arm_regs
27057fbfb2SHe Kuang #include "../../arch/arm64/util/unwind-libunwind.c"
28057fbfb2SHe Kuang 
29057fbfb2SHe Kuang /* NO_LIBUNWIND_DEBUG_FRAME is a feature flag for local libunwind,
30057fbfb2SHe Kuang  * assign NO_LIBUNWIND_DEBUG_FRAME_AARCH64 to it for compiling arm64
31057fbfb2SHe Kuang  * unwind methods.
32057fbfb2SHe Kuang  */
33057fbfb2SHe Kuang #undef NO_LIBUNWIND_DEBUG_FRAME
34057fbfb2SHe Kuang #ifdef NO_LIBUNWIND_DEBUG_FRAME_AARCH64
35057fbfb2SHe Kuang #define NO_LIBUNWIND_DEBUG_FRAME
36057fbfb2SHe Kuang #endif
37057fbfb2SHe Kuang #include "util/unwind-libunwind-local.c"
38057fbfb2SHe Kuang 
39057fbfb2SHe Kuang struct unwind_libunwind_ops *
40057fbfb2SHe Kuang arm64_unwind_libunwind_ops = &_unwind_libunwind_ops;
41