-
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.
LoongArch: Consolidate __ex_table construction
Consolidate all the __ex_table constuction code with a _ASM_EXTABLE or _asm_extable helper. There should be no functional change as a result of this patch. Signed-off-by: Youling Tang <tangyouling@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
- Loading branch information
Youling Tang
authored and
Huacai Chen
committed
Dec 14, 2022
1 parent
1a34e7f
commit 508f28c
Showing
6 changed files
with
49 additions
and
23 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,35 @@ | ||
/* 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 8; \ | ||
.quad (insn); \ | ||
.quad (fixup); \ | ||
.popsection; | ||
|
||
.macro _asm_extable, insn, fixup | ||
__ASM_EXTABLE_RAW(\insn, \fixup) | ||
.endm | ||
|
||
#else /* __ASSEMBLY__ */ | ||
|
||
#include <linux/bits.h> | ||
#include <linux/stringify.h> | ||
|
||
#define __ASM_EXTABLE_RAW(insn, fixup) \ | ||
".pushsection __ex_table, \"a\"\n" \ | ||
".balign 8\n" \ | ||
".quad ((" insn "))\n" \ | ||
".quad ((" 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
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