summaryrefslogtreecommitdiffstats
path: root/arch/loongarch
diff options
context:
space:
mode:
authorYouling Tang <tangyouling@loongson.cn>2022-12-10 22:39:59 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2022-12-14 08:36:11 +0800
commit912bcfaf36771a2bf7a83799ce5454850d1c3f40 (patch)
tree46edd3d7cfb818ccf4040bf21731b45ed9bf3a72 /arch/loongarch
parent672999cfae3e830a64c4996362a26934fd555ff9 (diff)
downloadlinux-912bcfaf36771a2bf7a83799ce5454850d1c3f40.tar.bz2
LoongArch: Remove the .fixup section usage
Use the `.L_xxx` label to improve fixup code and then remove the .fixup section usage. Signed-off-by: Youling Tang <tangyouling@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch')
-rw-r--r--arch/loongarch/lib/clear_user.S14
-rw-r--r--arch/loongarch/lib/copy_user.S16
2 files changed, 11 insertions, 19 deletions
diff --git a/arch/loongarch/lib/clear_user.S b/arch/loongarch/lib/clear_user.S
index 7a066d6a41b8..d5c9e44ac8c4 100644
--- a/arch/loongarch/lib/clear_user.S
+++ b/arch/loongarch/lib/clear_user.S
@@ -9,15 +9,11 @@
#include <asm/export.h>
#include <asm/regdef.h>
-.macro fixup_ex from, to, offset, fix
-.if \fix
- .section .fixup, "ax"
-\to: addi.d a0, a1, \offset
+.irp to, 0
+.L_fixup_handle_\to\():
+ addi.d a0, a1, (\to) * (-8)
jr ra
- .previous
-.endif
- _asm_extable \from\()b, \to\()b
-.endm
+.endr
/*
* unsigned long __clear_user(void *addr, size_t size)
@@ -36,7 +32,7 @@ SYM_FUNC_START(__clear_user)
2: move a0, a1
jr ra
- fixup_ex 1, 3, 0, 1
+ _asm_extable 1b, .L_fixup_handle_0
SYM_FUNC_END(__clear_user)
EXPORT_SYMBOL(__clear_user)
diff --git a/arch/loongarch/lib/copy_user.S b/arch/loongarch/lib/copy_user.S
index f8ace04586c2..61933d964da0 100644
--- a/arch/loongarch/lib/copy_user.S
+++ b/arch/loongarch/lib/copy_user.S
@@ -9,15 +9,11 @@
#include <asm/export.h>
#include <asm/regdef.h>
-.macro fixup_ex from, to, offset, fix
-.if \fix
- .section .fixup, "ax"
-\to: addi.d a0, a2, \offset
+.irp to, 0
+.L_fixup_handle_\to\():
+ addi.d a0, a2, (\to) * (-8)
jr ra
- .previous
-.endif
- _asm_extable \from\()b, \to\()b
-.endm
+.endr
/*
* unsigned long __copy_user(void *to, const void *from, size_t n)
@@ -39,8 +35,8 @@ SYM_FUNC_START(__copy_user)
3: move a0, a2
jr ra
- fixup_ex 1, 4, 0, 1
- fixup_ex 2, 4, 0, 0
+ _asm_extable 1b, .L_fixup_handle_0
+ _asm_extable 2b, .L_fixup_handle_0
SYM_FUNC_END(__copy_user)
EXPORT_SYMBOL(__copy_user)