162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef _ASM_X86_DWARF2_H
362306a36Sopenharmony_ci#define _ASM_X86_DWARF2_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#ifndef __ASSEMBLY__
662306a36Sopenharmony_ci#warning "asm/dwarf2.h should be only included in pure assembly files"
762306a36Sopenharmony_ci#endif
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#define CFI_STARTPROC		.cfi_startproc
1062306a36Sopenharmony_ci#define CFI_ENDPROC		.cfi_endproc
1162306a36Sopenharmony_ci#define CFI_DEF_CFA		.cfi_def_cfa
1262306a36Sopenharmony_ci#define CFI_DEF_CFA_REGISTER	.cfi_def_cfa_register
1362306a36Sopenharmony_ci#define CFI_DEF_CFA_OFFSET	.cfi_def_cfa_offset
1462306a36Sopenharmony_ci#define CFI_ADJUST_CFA_OFFSET	.cfi_adjust_cfa_offset
1562306a36Sopenharmony_ci#define CFI_OFFSET		.cfi_offset
1662306a36Sopenharmony_ci#define CFI_REL_OFFSET		.cfi_rel_offset
1762306a36Sopenharmony_ci#define CFI_REGISTER		.cfi_register
1862306a36Sopenharmony_ci#define CFI_RESTORE		.cfi_restore
1962306a36Sopenharmony_ci#define CFI_REMEMBER_STATE	.cfi_remember_state
2062306a36Sopenharmony_ci#define CFI_RESTORE_STATE	.cfi_restore_state
2162306a36Sopenharmony_ci#define CFI_UNDEFINED		.cfi_undefined
2262306a36Sopenharmony_ci#define CFI_ESCAPE		.cfi_escape
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci#ifndef BUILD_VDSO
2562306a36Sopenharmony_ci	/*
2662306a36Sopenharmony_ci	 * Emit CFI data in .debug_frame sections, not .eh_frame sections.
2762306a36Sopenharmony_ci	 * The latter we currently just discard since we don't do DWARF
2862306a36Sopenharmony_ci	 * unwinding at runtime.  So only the offline DWARF information is
2962306a36Sopenharmony_ci	 * useful to anyone.  Note we should not use this directive if we
3062306a36Sopenharmony_ci	 * ever decide to enable DWARF unwinding at runtime.
3162306a36Sopenharmony_ci	 */
3262306a36Sopenharmony_ci	.cfi_sections .debug_frame
3362306a36Sopenharmony_ci#else
3462306a36Sopenharmony_ci	 /*
3562306a36Sopenharmony_ci	  * For the vDSO, emit both runtime unwind information and debug
3662306a36Sopenharmony_ci	  * symbols for the .dbg file.
3762306a36Sopenharmony_ci	  */
3862306a36Sopenharmony_ci	.cfi_sections .eh_frame, .debug_frame
3962306a36Sopenharmony_ci#endif
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci#endif /* _ASM_X86_DWARF2_H */
42