-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
riscv: extable: consolidate definitions
This is a riscv port of commit 819771c ("arm64: extable: consolidate definitions"). Signed-off-by: Jisheng Zhang <jszhang@kernel.org> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
- Loading branch information
Jisheng Zhang
authored and
Palmer Dabbelt
committed
Jan 6, 2022
1 parent
9d504f9
commit 6dd10d9
Showing
4 changed files
with
37 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-only */ | ||
#ifndef __ASM_ASM_EXTABLE_H | ||
#define __ASM_ASM_EXTABLE_H | ||
|
||
#ifdef __ASSEMBLY__ | ||
|
||
#define __ASM_EXTABLE_RAW(insn, fixup) \ | ||
.pushsection __ex_table, "a"; \ | ||
.balign 4; \ | ||
.long ((insn) - .); \ | ||
.long ((fixup) - .); \ | ||
.popsection; | ||
|
||
.macro _asm_extable, insn, fixup | ||
__ASM_EXTABLE_RAW(\insn, \fixup) | ||
.endm | ||
|
||
#else /* __ASSEMBLY__ */ | ||
|
||
#include <linux/stringify.h> | ||
|
||
#define __ASM_EXTABLE_RAW(insn, fixup) \ | ||
".pushsection __ex_table, \"a\"\n" \ | ||
".balign 4\n" \ | ||
".long ((" insn ") - .)\n" \ | ||
".long ((" fixup ") - .)\n" \ | ||
".popsection\n" | ||
|
||
#define _ASM_EXTABLE(insn, fixup) __ASM_EXTABLE_RAW(#insn, #fixup) | ||
|
||
#endif /* __ASSEMBLY__ */ | ||
|
||
#endif /* __ASM_ASM_EXTABLE_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters