1
2
3
4
5
6
7
8
9
10 #include <linux/linkage.h>
11 #include <asm/entry.h>
12 #include <asm/asm-offsets.h>
13
14 #define KSP_WORD_OFF ((TASK_THREAD + THREAD_KSP) / 4)
15
16 ;################### Low Level Context Switch ##########################
17
18 .section .sched.text,"ax",@progbits
19 .align 4
20 .global __switch_to
21 .type __switch_to, @function
22 __switch_to:
23 CFI_STARTPROC
24
25
26 st.a blink, [sp, -4]
27 st.a fp, [sp, -4]
28 SAVE_CALLEE_SAVED_KERNEL
29
30
31 #if KSP_WORD_OFF <= 255
32 st.as sp, [r0, KSP_WORD_OFF]
33 #else
34
35 add2 r24, r0, KSP_WORD_OFF
36 st sp, [r24]
37 #endif
38
39
40
41
42
43
44
45
46
47
48
49 SET_CURR_TASK_ON_CPU r1, r3
50
51
52 ld.as sp, [r1, (TASK_THREAD + THREAD_KSP)/4]
53
54
55 RESTORE_CALLEE_SAVED_KERNEL
56 ld.ab fp, [sp, 4]
57 ld.ab blink, [sp, 4]
58 j [blink]
59
60 END_CFI(__switch_to)