Path: blob/master/arch/loongarch/kernel/rethook_trampoline.S
26424 views
/* SPDX-License-Identifier: GPL-2.0+ */1#include <linux/linkage.h>2#include <asm/stackframe.h>34.text56.macro save_all_base_regs7cfi_st ra, PT_R18cfi_st tp, PT_R29cfi_st a0, PT_R410cfi_st a1, PT_R511cfi_st a2, PT_R612cfi_st a3, PT_R713cfi_st a4, PT_R814cfi_st a5, PT_R915cfi_st a6, PT_R1016cfi_st a7, PT_R1117cfi_st t0, PT_R1218cfi_st t1, PT_R1319cfi_st t2, PT_R1420cfi_st t3, PT_R1521cfi_st t4, PT_R1622cfi_st t5, PT_R1723cfi_st t6, PT_R1824cfi_st t7, PT_R1925cfi_st t8, PT_R2026cfi_st u0, PT_R2127cfi_st fp, PT_R2228cfi_st s0, PT_R2329cfi_st s1, PT_R2430cfi_st s2, PT_R2531cfi_st s3, PT_R2632cfi_st s4, PT_R2733cfi_st s5, PT_R2834cfi_st s6, PT_R2935cfi_st s7, PT_R3036cfi_st s8, PT_R3137csrrd t0, LOONGARCH_CSR_CRMD38andi t0, t0, 0x7 /* extract bit[1:0] PLV, bit[2] IE */39LONG_S t0, sp, PT_CRMD40.endm4142.macro restore_all_base_regs43cfi_ld tp, PT_R244cfi_ld a0, PT_R445cfi_ld a1, PT_R546cfi_ld a2, PT_R647cfi_ld a3, PT_R748cfi_ld a4, PT_R849cfi_ld a5, PT_R950cfi_ld a6, PT_R1051cfi_ld a7, PT_R1152cfi_ld t0, PT_R1253cfi_ld t1, PT_R1354cfi_ld t2, PT_R1455cfi_ld t3, PT_R1556cfi_ld t4, PT_R1657cfi_ld t5, PT_R1758cfi_ld t6, PT_R1859cfi_ld t7, PT_R1960cfi_ld t8, PT_R2061cfi_ld u0, PT_R2162cfi_ld fp, PT_R2263cfi_ld s0, PT_R2364cfi_ld s1, PT_R2465cfi_ld s2, PT_R2566cfi_ld s3, PT_R2667cfi_ld s4, PT_R2768cfi_ld s5, PT_R2869cfi_ld s6, PT_R2970cfi_ld s7, PT_R3071cfi_ld s8, PT_R3172LONG_L t0, sp, PT_CRMD73li.d t1, 0x7 /* mask bit[1:0] PLV, bit[2] IE */74csrxchg t0, t1, LOONGARCH_CSR_CRMD75.endm7677SYM_CODE_START(arch_rethook_trampoline)78UNWIND_HINT_UNDEFINED79addi.d sp, sp, -PT_SIZE80save_all_base_regs8182addi.d t0, sp, PT_SIZE83LONG_S t0, sp, PT_R38485move a0, sp /* pt_regs */8687bl arch_rethook_trampoline_callback8889/* use the result as the return-address */90move ra, a09192restore_all_base_regs93addi.d sp, sp, PT_SIZE9495jr ra96SYM_CODE_END(arch_rethook_trampoline)979899