^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * This file setups defines to compile arch specific binary from the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * generic one.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * The function 'LIBUNWIND__ARCH_REG_ID' name is set according to arch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * name and the defination of this function is included directly from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * 'arch/arm64/util/unwind-libunwind.c', to make sure that this function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * is defined no matter what arch the host is.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * Finally, the arch specific unwind methods are exported which will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * be assigned to each arm64 thread.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define REMOTE_UNWIND_LIBUNWIND
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) /* Define arch specific functions & regs for libunwind, should be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * defined before including "unwind.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define LIBUNWIND__ARCH_REG_ID(regnum) libunwind__arm64_reg_id(regnum)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define LIBUNWIND__ARCH_REG_IP PERF_REG_ARM64_PC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #define LIBUNWIND__ARCH_REG_SP PERF_REG_ARM64_SP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #include "unwind.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #include "libunwind-aarch64.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #include <../../../../arch/arm64/include/uapi/asm/perf_regs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #include "../../arch/arm64/util/unwind-libunwind.c"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) /* NO_LIBUNWIND_DEBUG_FRAME is a feature flag for local libunwind,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) * assign NO_LIBUNWIND_DEBUG_FRAME_AARCH64 to it for compiling arm64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) * unwind methods.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #undef NO_LIBUNWIND_DEBUG_FRAME
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #ifdef NO_LIBUNWIND_DEBUG_FRAME_AARCH64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #define NO_LIBUNWIND_DEBUG_FRAME
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #include "util/unwind-libunwind-local.c"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) struct unwind_libunwind_ops *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) arm64_unwind_libunwind_ops = &_unwind_libunwind_ops;