~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/riscv/kernel/probes/rethook_trampoline.S

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0+ */
  2 /*
  3  * Author: Patrick Stählin <me@packi.ch>
  4  */
  5 #include <linux/linkage.h>
  6 
  7 #include <asm/asm.h>
  8 #include <asm/asm-offsets.h>
  9 
 10         .text
 11         .altmacro
 12 
 13         .macro save_all_base_regs
 14         REG_S x1,  PT_RA(sp)
 15         REG_S x3,  PT_GP(sp)
 16         REG_S x4,  PT_TP(sp)
 17         REG_S x5,  PT_T0(sp)
 18         REG_S x6,  PT_T1(sp)
 19         REG_S x7,  PT_T2(sp)
 20         REG_S x8,  PT_S0(sp)
 21         REG_S x9,  PT_S1(sp)
 22         REG_S x10, PT_A0(sp)
 23         REG_S x11, PT_A1(sp)
 24         REG_S x12, PT_A2(sp)
 25         REG_S x13, PT_A3(sp)
 26         REG_S x14, PT_A4(sp)
 27         REG_S x15, PT_A5(sp)
 28         REG_S x16, PT_A6(sp)
 29         REG_S x17, PT_A7(sp)
 30         REG_S x18, PT_S2(sp)
 31         REG_S x19, PT_S3(sp)
 32         REG_S x20, PT_S4(sp)
 33         REG_S x21, PT_S5(sp)
 34         REG_S x22, PT_S6(sp)
 35         REG_S x23, PT_S7(sp)
 36         REG_S x24, PT_S8(sp)
 37         REG_S x25, PT_S9(sp)
 38         REG_S x26, PT_S10(sp)
 39         REG_S x27, PT_S11(sp)
 40         REG_S x28, PT_T3(sp)
 41         REG_S x29, PT_T4(sp)
 42         REG_S x30, PT_T5(sp)
 43         REG_S x31, PT_T6(sp)
 44         .endm
 45 
 46         .macro restore_all_base_regs
 47         REG_L x3,  PT_GP(sp)
 48         REG_L x4,  PT_TP(sp)
 49         REG_L x5,  PT_T0(sp)
 50         REG_L x6,  PT_T1(sp)
 51         REG_L x7,  PT_T2(sp)
 52         REG_L x8,  PT_S0(sp)
 53         REG_L x9,  PT_S1(sp)
 54         REG_L x10, PT_A0(sp)
 55         REG_L x11, PT_A1(sp)
 56         REG_L x12, PT_A2(sp)
 57         REG_L x13, PT_A3(sp)
 58         REG_L x14, PT_A4(sp)
 59         REG_L x15, PT_A5(sp)
 60         REG_L x16, PT_A6(sp)
 61         REG_L x17, PT_A7(sp)
 62         REG_L x18, PT_S2(sp)
 63         REG_L x19, PT_S3(sp)
 64         REG_L x20, PT_S4(sp)
 65         REG_L x21, PT_S5(sp)
 66         REG_L x22, PT_S6(sp)
 67         REG_L x23, PT_S7(sp)
 68         REG_L x24, PT_S8(sp)
 69         REG_L x25, PT_S9(sp)
 70         REG_L x26, PT_S10(sp)
 71         REG_L x27, PT_S11(sp)
 72         REG_L x28, PT_T3(sp)
 73         REG_L x29, PT_T4(sp)
 74         REG_L x30, PT_T5(sp)
 75         REG_L x31, PT_T6(sp)
 76         .endm
 77 
 78 SYM_CODE_START(arch_rethook_trampoline)
 79         addi sp, sp, -(PT_SIZE_ON_STACK)
 80         save_all_base_regs
 81 
 82         move a0, sp /* pt_regs */
 83 
 84         call arch_rethook_trampoline_callback
 85 
 86         /* use the result as the return-address */
 87         move ra, a0
 88 
 89         restore_all_base_regs
 90         addi sp, sp, PT_SIZE_ON_STACK
 91 
 92         ret
 93 SYM_CODE_END(arch_rethook_trampoline)

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php