File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ config CSKY
42
42
select HAVE_ARCH_MMAP_RND_BITS
43
43
select HAVE_ARCH_SECCOMP_FILTER
44
44
select HAVE_COPY_THREAD_TLS
45
+ select HAVE_CONTEXT_TRACKING
46
+ select HAVE_VIRT_CPU_ACCOUNTING_GEN
45
47
select HAVE_DEBUG_BUGVERBOSE
46
48
select HAVE_DYNAMIC_FTRACE
47
49
select HAVE_DYNAMIC_FTRACE_WITH_REGS
Original file line number Diff line number Diff line change 23
23
#endif
24
24
.endm
25
25
26
+ .macro context_tracking
27
+ #ifdef CONFIG_CONTEXT_TRACKING
28
+ mfcr a0 , epsr
29
+ btsti a0 , 31
30
+ bt 1f
31
+ jbsr context_tracking_user_exit
32
+ ldw a0 , ( sp , LSAVE_A0)
33
+ ldw a1 , ( sp , LSAVE_A1)
34
+ ldw a2 , ( sp , LSAVE_A2)
35
+ ldw a3 , ( sp , LSAVE_A3)
36
+ #if defined(__CSKYABIV1__)
37
+ ldw r6 , ( sp , LSAVE_A4)
38
+ ldw r7 , ( sp , LSAVE_A5)
39
+ #endif
40
+ 1 :
41
+ #endif
42
+ .endm
43
+
26
44
.macro tlbop_begin name , val0 , val1 , val2
27
45
ENTRY(csky_\name)
28
46
mtcr a3 , ss2
@@ -103,6 +121,7 @@ ENTRY(csky_\name)
103
121
.endm
104
122
.macro tlbop_end is_write
105
123
zero_fp
124
+ context_tracking
106
125
RD_MEH a2
107
126
psrset ee , ie
108
127
mov a0 , sp
@@ -128,6 +147,7 @@ tlbop_end 1
128
147
ENTRY(csky_systemcall)
129
148
SAVE_ALL TRAP0_SIZE
130
149
zero_fp
150
+ context_tracking
131
151
psrset ee , ie
132
152
133
153
lrw r9 , __NR_syscalls
@@ -237,6 +257,9 @@ ret_from_exception:
237
257
and r10 , r9
238
258
cmpnei r10 , 0
239
259
bt exit_work
260
+ #ifdef CONFIG_CONTEXT_TRACKING
261
+ jbsr context_tracking_user_enter
262
+ #endif
240
263
1 :
241
264
#ifdef CONFIG_PREEMPTION
242
265
mov r9 , sp
@@ -277,6 +300,7 @@ work_resched:
277
300
ENTRY(csky_trap)
278
301
SAVE_ALL 0
279
302
zero_fp
303
+ context_tracking
280
304
psrset ee
281
305
mov a0 , sp / * Push Stack pointer arg * /
282
306
jbsr trap_c / * Call C - level trap handler * /
@@ -311,6 +335,7 @@ ENTRY(csky_get_tls)
311
335
ENTRY(csky_irq)
312
336
SAVE_ALL 0
313
337
zero_fp
338
+ context_tracking
314
339
psrset ee
315
340
316
341
#ifdef CONFIG_TRACE_IRQFLAGS
You can’t perform that action at this time.
0 commit comments