xref: /openbmc/linux/tools/perf/util/libunwind/x86_32.c (revision d8f69fb6)
1b2441318SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0
252ffe0ffSHe Kuang /*
352ffe0ffSHe Kuang  * This file setups defines to compile arch specific binary from the
452ffe0ffSHe Kuang  * generic one.
552ffe0ffSHe Kuang  *
652ffe0ffSHe Kuang  * The function 'LIBUNWIND__ARCH_REG_ID' name is set according to arch
7*4d39c89fSIngo Molnar  * name and the definition of this function is included directly from
852ffe0ffSHe Kuang  * 'arch/x86/util/unwind-libunwind.c', to make sure that this function
952ffe0ffSHe Kuang  * is defined no matter what arch the host is.
1052ffe0ffSHe Kuang  *
1152ffe0ffSHe Kuang  * Finally, the arch specific unwind methods are exported which will
1252ffe0ffSHe Kuang  * be assigned to each x86 thread.
1352ffe0ffSHe Kuang  */
1452ffe0ffSHe Kuang 
1552ffe0ffSHe Kuang #define REMOTE_UNWIND_LIBUNWIND
165dafea09SHe Kuang 
175dafea09SHe Kuang /* Define arch specific functions & regs for libunwind, should be
185dafea09SHe Kuang  * defined before including "unwind.h"
195dafea09SHe Kuang  */
2052ffe0ffSHe Kuang #define LIBUNWIND__ARCH_REG_ID(regnum) libunwind__x86_reg_id(regnum)
2152ffe0ffSHe Kuang 
2252ffe0ffSHe Kuang #include "unwind.h"
2352ffe0ffSHe Kuang #include "libunwind-x86.h"
2452ffe0ffSHe Kuang #include <../../../../arch/x86/include/uapi/asm/perf_regs.h>
2552ffe0ffSHe Kuang 
2652ffe0ffSHe Kuang /* HAVE_ARCH_X86_64_SUPPORT is used in'arch/x86/util/unwind-libunwind.c'
2752ffe0ffSHe Kuang  * for x86_32, we undef it to compile code for x86_32 only.
2852ffe0ffSHe Kuang  */
2952ffe0ffSHe Kuang #undef HAVE_ARCH_X86_64_SUPPORT
3052ffe0ffSHe Kuang #include "../../arch/x86/util/unwind-libunwind.c"
3152ffe0ffSHe Kuang 
3252ffe0ffSHe Kuang /* Explicitly define NO_LIBUNWIND_DEBUG_FRAME, because non-ARM has no
3352ffe0ffSHe Kuang  * dwarf_find_debug_frame() function.
3452ffe0ffSHe Kuang  */
3552ffe0ffSHe Kuang #ifndef NO_LIBUNWIND_DEBUG_FRAME
3652ffe0ffSHe Kuang #define NO_LIBUNWIND_DEBUG_FRAME
3752ffe0ffSHe Kuang #endif
3852ffe0ffSHe Kuang #include "util/unwind-libunwind-local.c"
3952ffe0ffSHe Kuang 
4052ffe0ffSHe Kuang struct unwind_libunwind_ops *
4152ffe0ffSHe Kuang x86_32_unwind_libunwind_ops = &_unwind_libunwind_ops;
42