4
4
#include <linux/mm.h> /* for handle_mm_fault() */
5
5
#include <linux/ftrace.h>
6
6
#include <linux/sched/stat.h>
7
+ #include <asm/asm-offsets.h>
7
8
8
9
extern void my_direct_func (unsigned long ip );
9
10
@@ -14,6 +15,8 @@ void my_direct_func(unsigned long ip)
14
15
15
16
extern void my_tramp (void * );
16
17
18
+ #ifdef CONFIG_X86_64
19
+
17
20
asm (
18
21
" .pushsection .text, \"ax\", @progbits\n"
19
22
" .type my_tramp, @function\n"
31
34
" .popsection\n"
32
35
);
33
36
37
+ #endif /* CONFIG_X86_64 */
38
+
39
+ #ifdef CONFIG_S390
40
+
41
+ asm (
42
+ " .pushsection .text, \"ax\", @progbits\n"
43
+ " .type my_tramp, @function\n"
44
+ " .globl my_tramp\n"
45
+ " my_tramp:"
46
+ " lgr %r1,%r15\n"
47
+ " stmg %r0,%r5," __stringify (__SF_GPRS )"(%r15)\n"
48
+ " stg %r14," __stringify (__SF_GPRS + 8 * 8 )"(%r15)\n"
49
+ " aghi %r15," __stringify (- STACK_FRAME_OVERHEAD )"\n"
50
+ " stg %r1," __stringify (__SF_BACKCHAIN )"(%r15)\n"
51
+ " lgr %r2,%r0\n"
52
+ " brasl %r14,my_direct_func\n"
53
+ " aghi %r15," __stringify (STACK_FRAME_OVERHEAD )"\n"
54
+ " lmg %r0,%r5," __stringify (__SF_GPRS )"(%r15)\n"
55
+ " lg %r14," __stringify (__SF_GPRS + 8 * 8 )"(%r15)\n"
56
+ " lgr %r1,%r0\n"
57
+ " br %r1\n"
58
+ " .size my_tramp, .-my_tramp\n"
59
+ " .popsection\n"
60
+ );
61
+
62
+ #endif /* CONFIG_S390 */
63
+
34
64
static struct ftrace_ops direct ;
35
65
36
66
static int __init ftrace_direct_multi_init (void )
0 commit comments