diff options
Diffstat (limited to 'arch/s390/kernel/mcount.S')
-rw-r--r-- | arch/s390/kernel/mcount.S | 119 |
1 files changed, 92 insertions, 27 deletions
diff --git a/arch/s390/kernel/mcount.S b/arch/s390/kernel/mcount.S index 80641224a095..de274996f640 100644 --- a/arch/s390/kernel/mcount.S +++ b/arch/s390/kernel/mcount.S | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright IBM Corp. 2008 | 2 | * Copyright IBM Corp. 2008,2009 |
3 | * | 3 | * |
4 | * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>, | 4 | * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>, |
5 | * | 5 | * |
@@ -7,36 +7,46 @@ | |||
7 | 7 | ||
8 | #include <asm/asm-offsets.h> | 8 | #include <asm/asm-offsets.h> |
9 | 9 | ||
10 | #ifndef CONFIG_64BIT | 10 | .globl ftrace_stub |
11 | .globl _mcount | 11 | ftrace_stub: |
12 | br %r14 | ||
13 | |||
14 | #ifdef CONFIG_64BIT | ||
15 | |||
16 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
17 | |||
18 | .globl _mcount | ||
12 | _mcount: | 19 | _mcount: |
13 | stm %r0,%r5,8(%r15) | ||
14 | st %r14,56(%r15) | ||
15 | lr %r1,%r15 | ||
16 | ahi %r15,-96 | ||
17 | l %r3,100(%r15) | ||
18 | la %r2,0(%r14) | ||
19 | st %r1,__SF_BACKCHAIN(%r15) | ||
20 | la %r3,0(%r3) | ||
21 | bras %r14,0f | ||
22 | .long ftrace_trace_function | ||
23 | 0: l %r14,0(%r14) | ||
24 | l %r14,0(%r14) | ||
25 | basr %r14,%r14 | ||
26 | ahi %r15,96 | ||
27 | lm %r0,%r5,8(%r15) | ||
28 | l %r14,56(%r15) | ||
29 | br %r14 | 20 | br %r14 |
30 | 21 | ||
31 | .globl ftrace_stub | 22 | .globl ftrace_caller |
32 | ftrace_stub: | 23 | ftrace_caller: |
24 | stmg %r2,%r5,32(%r15) | ||
25 | stg %r14,112(%r15) | ||
26 | lgr %r1,%r15 | ||
27 | aghi %r15,-160 | ||
28 | stg %r1,__SF_BACKCHAIN(%r15) | ||
29 | lgr %r2,%r14 | ||
30 | lg %r3,168(%r15) | ||
31 | larl %r14,ftrace_dyn_func | ||
32 | lg %r14,0(%r14) | ||
33 | basr %r14,%r14 | ||
34 | aghi %r15,160 | ||
35 | lmg %r2,%r5,32(%r15) | ||
36 | lg %r14,112(%r15) | ||
33 | br %r14 | 37 | br %r14 |
34 | 38 | ||
35 | #else /* CONFIG_64BIT */ | 39 | .data |
40 | .globl ftrace_dyn_func | ||
41 | ftrace_dyn_func: | ||
42 | .quad ftrace_stub | ||
43 | .previous | ||
44 | |||
45 | #else /* CONFIG_DYNAMIC_FTRACE */ | ||
36 | 46 | ||
37 | .globl _mcount | 47 | .globl _mcount |
38 | _mcount: | 48 | _mcount: |
39 | stmg %r0,%r5,16(%r15) | 49 | stmg %r2,%r5,32(%r15) |
40 | stg %r14,112(%r15) | 50 | stg %r14,112(%r15) |
41 | lgr %r1,%r15 | 51 | lgr %r1,%r15 |
42 | aghi %r15,-160 | 52 | aghi %r15,-160 |
@@ -47,12 +57,67 @@ _mcount: | |||
47 | lg %r14,0(%r14) | 57 | lg %r14,0(%r14) |
48 | basr %r14,%r14 | 58 | basr %r14,%r14 |
49 | aghi %r15,160 | 59 | aghi %r15,160 |
50 | lmg %r0,%r5,16(%r15) | 60 | lmg %r2,%r5,32(%r15) |
51 | lg %r14,112(%r15) | 61 | lg %r14,112(%r15) |
52 | br %r14 | 62 | br %r14 |
53 | 63 | ||
54 | .globl ftrace_stub | 64 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
55 | ftrace_stub: | 65 | |
66 | #else /* CONFIG_64BIT */ | ||
67 | |||
68 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
69 | |||
70 | .globl _mcount | ||
71 | _mcount: | ||
72 | br %r14 | ||
73 | |||
74 | .globl ftrace_caller | ||
75 | ftrace_caller: | ||
76 | stm %r2,%r5,16(%r15) | ||
77 | st %r14,56(%r15) | ||
78 | lr %r1,%r15 | ||
79 | ahi %r15,-96 | ||
80 | l %r3,100(%r15) | ||
81 | la %r2,0(%r14) | ||
82 | st %r1,__SF_BACKCHAIN(%r15) | ||
83 | la %r3,0(%r3) | ||
84 | bras %r14,0f | ||
85 | .long ftrace_dyn_func | ||
86 | 0: l %r14,0(%r14) | ||
87 | l %r14,0(%r14) | ||
88 | basr %r14,%r14 | ||
89 | ahi %r15,96 | ||
90 | lm %r2,%r5,16(%r15) | ||
91 | l %r14,56(%r15) | ||
92 | br %r14 | ||
93 | |||
94 | .data | ||
95 | .globl ftrace_dyn_func | ||
96 | ftrace_dyn_func: | ||
97 | .long ftrace_stub | ||
98 | .previous | ||
99 | |||
100 | #else /* CONFIG_DYNAMIC_FTRACE */ | ||
101 | |||
102 | .globl _mcount | ||
103 | _mcount: | ||
104 | stm %r2,%r5,16(%r15) | ||
105 | st %r14,56(%r15) | ||
106 | lr %r1,%r15 | ||
107 | ahi %r15,-96 | ||
108 | l %r3,100(%r15) | ||
109 | la %r2,0(%r14) | ||
110 | st %r1,__SF_BACKCHAIN(%r15) | ||
111 | la %r3,0(%r3) | ||
112 | bras %r14,0f | ||
113 | .long ftrace_trace_function | ||
114 | 0: l %r14,0(%r14) | ||
115 | l %r14,0(%r14) | ||
116 | basr %r14,%r14 | ||
117 | ahi %r15,96 | ||
118 | lm %r2,%r5,16(%r15) | ||
119 | l %r14,56(%r15) | ||
56 | br %r14 | 120 | br %r14 |
57 | 121 | ||
122 | #endif /* CONFIG_DYNAMIC_FTRACE */ | ||
58 | #endif /* CONFIG_64BIT */ | 123 | #endif /* CONFIG_64BIT */ |