summaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel
diff options
context:
space:
mode:
authorJiaxun Yang <jiaxun.yang@flygoat.com>2024-02-09 18:07:50 +0000
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2024-02-20 12:41:52 +0100
commitc2fb9fe40b97867b675edfb595aa3d5281f71bdb (patch)
tree93a5ef546927b5039432c05bc4e7bda400e96e30 /arch/mips/kernel
parentf42058b037053523439f268f4dd328169cef8ab9 (diff)
downloadlinux-stable-c2fb9fe40b97867b675edfb595aa3d5281f71bdb.tar.gz
linux-stable-c2fb9fe40b97867b675edfb595aa3d5281f71bdb.tar.bz2
linux-stable-c2fb9fe40b97867b675edfb595aa3d5281f71bdb.zip
MIPS: traps: Use GPR number macros
Use GPR number macros in uasm code generation parts to reduce code duplication. No functional change. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r--arch/mips/kernel/traps.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index a1c1cb5de913..2d95e9971a2d 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -58,6 +58,7 @@
#include <asm/module.h>
#include <asm/msa.h>
#include <asm/ptrace.h>
+#include <asm/regdef.h>
#include <asm/sections.h>
#include <asm/siginfo.h>
#include <asm/tlbdebug.h>
@@ -2041,13 +2042,12 @@ void __init *set_except_vector(int n, void *addr)
unsigned long jump_mask = ~((1 << 28) - 1);
#endif
u32 *buf = (u32 *)(ebase + 0x200);
- unsigned int k0 = 26;
if ((handler & jump_mask) == ((ebase + 0x200) & jump_mask)) {
uasm_i_j(&buf, handler & ~jump_mask);
uasm_i_nop(&buf);
} else {
- UASM_i_LA(&buf, k0, handler);
- uasm_i_jr(&buf, k0);
+ UASM_i_LA(&buf, GPR_K0, handler);
+ uasm_i_jr(&buf, GPR_K0);
uasm_i_nop(&buf);
}
local_flush_icache_range(ebase + 0x200, (unsigned long)buf);