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