18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * This file setups defines to compile arch specific binary from the 48c2ecf20Sopenharmony_ci * generic one. 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * The function 'LIBUNWIND__ARCH_REG_ID' name is set according to arch 78c2ecf20Sopenharmony_ci * name and the defination of this function is included directly from 88c2ecf20Sopenharmony_ci * 'arch/arm64/util/unwind-libunwind.c', to make sure that this function 98c2ecf20Sopenharmony_ci * is defined no matter what arch the host is. 108c2ecf20Sopenharmony_ci * 118c2ecf20Sopenharmony_ci * Finally, the arch specific unwind methods are exported which will 128c2ecf20Sopenharmony_ci * be assigned to each arm64 thread. 138c2ecf20Sopenharmony_ci */ 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci#define REMOTE_UNWIND_LIBUNWIND 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci/* Define arch specific functions & regs for libunwind, should be 188c2ecf20Sopenharmony_ci * defined before including "unwind.h" 198c2ecf20Sopenharmony_ci */ 208c2ecf20Sopenharmony_ci#define LIBUNWIND__ARCH_REG_ID(regnum) libunwind__arm64_reg_id(regnum) 218c2ecf20Sopenharmony_ci#define LIBUNWIND__ARCH_REG_IP PERF_REG_ARM64_PC 228c2ecf20Sopenharmony_ci#define LIBUNWIND__ARCH_REG_SP PERF_REG_ARM64_SP 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci#include "unwind.h" 258c2ecf20Sopenharmony_ci#include "libunwind-aarch64.h" 268c2ecf20Sopenharmony_ci#include <../../../../arch/arm64/include/uapi/asm/perf_regs.h> 278c2ecf20Sopenharmony_ci#include "../../arch/arm64/util/unwind-libunwind.c" 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci/* NO_LIBUNWIND_DEBUG_FRAME is a feature flag for local libunwind, 308c2ecf20Sopenharmony_ci * assign NO_LIBUNWIND_DEBUG_FRAME_AARCH64 to it for compiling arm64 318c2ecf20Sopenharmony_ci * unwind methods. 328c2ecf20Sopenharmony_ci */ 338c2ecf20Sopenharmony_ci#undef NO_LIBUNWIND_DEBUG_FRAME 348c2ecf20Sopenharmony_ci#ifdef NO_LIBUNWIND_DEBUG_FRAME_AARCH64 358c2ecf20Sopenharmony_ci#define NO_LIBUNWIND_DEBUG_FRAME 368c2ecf20Sopenharmony_ci#endif 378c2ecf20Sopenharmony_ci#include "util/unwind-libunwind-local.c" 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_cistruct unwind_libunwind_ops * 408c2ecf20Sopenharmony_ciarm64_unwind_libunwind_ops = &_unwind_libunwind_ops; 41