Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
He Kuang | 057fbfb | 2016-06-03 03:33:23 +0000 | [diff] [blame] | 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 |
Ingo Molnar | 4d39c89 | 2021-03-23 17:09:15 +0100 | [diff] [blame] | 7 | * name and the definition of this function is included directly from |
He Kuang | 057fbfb | 2016-06-03 03:33:23 +0000 | [diff] [blame] | 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 | |
He Kuang | 3bd03c9 | 2016-06-22 06:57:04 +0000 | [diff] [blame] | 17 | /* Define arch specific functions & regs for libunwind, should be |
| 18 | * defined before including "unwind.h" |
| 19 | */ |
He Kuang | 057fbfb | 2016-06-03 03:33:23 +0000 | [diff] [blame] | 20 | #define LIBUNWIND__ARCH_REG_ID(regnum) libunwind__arm64_reg_id(regnum) |
He Kuang | 3bd03c9 | 2016-06-22 06:57:04 +0000 | [diff] [blame] | 21 | #define LIBUNWIND__ARCH_REG_IP PERF_REG_ARM64_PC |
| 22 | #define LIBUNWIND__ARCH_REG_SP PERF_REG_ARM64_SP |
He Kuang | 057fbfb | 2016-06-03 03:33:23 +0000 | [diff] [blame] | 23 | |
| 24 | #include "unwind.h" |
He Kuang | 057fbfb | 2016-06-03 03:33:23 +0000 | [diff] [blame] | 25 | #include "libunwind-aarch64.h" |
German Gomez | d3b58af | 2021-12-07 18:06:51 +0000 | [diff] [blame] | 26 | #define perf_event_arm_regs perf_event_arm64_regs |
He Kuang | 057fbfb | 2016-06-03 03:33:23 +0000 | [diff] [blame] | 27 | #include <../../../../arch/arm64/include/uapi/asm/perf_regs.h> |
German Gomez | d3b58af | 2021-12-07 18:06:51 +0000 | [diff] [blame] | 28 | #undef perf_event_arm_regs |
He Kuang | 057fbfb | 2016-06-03 03:33:23 +0000 | [diff] [blame] | 29 | #include "../../arch/arm64/util/unwind-libunwind.c" |
| 30 | |
| 31 | /* NO_LIBUNWIND_DEBUG_FRAME is a feature flag for local libunwind, |
| 32 | * assign NO_LIBUNWIND_DEBUG_FRAME_AARCH64 to it for compiling arm64 |
| 33 | * unwind methods. |
| 34 | */ |
| 35 | #undef NO_LIBUNWIND_DEBUG_FRAME |
| 36 | #ifdef NO_LIBUNWIND_DEBUG_FRAME_AARCH64 |
| 37 | #define NO_LIBUNWIND_DEBUG_FRAME |
| 38 | #endif |
| 39 | #include "util/unwind-libunwind-local.c" |
| 40 | |
| 41 | struct unwind_libunwind_ops * |
| 42 | arm64_unwind_libunwind_ops = &_unwind_libunwind_ops; |