0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #include <linux/linkage.h>
0011 #include <asm/entry.h> /* For the SAVE_* macros */
0012 #include <asm/asm-offsets.h>
0013
0014 #define KSP_WORD_OFF ((TASK_THREAD + THREAD_KSP) / 4)
0015
0016 ;################### Low Level Context Switch ##########################
0017
0018 .section .sched.text,"ax",@progbits
0019 .align 4
0020 .global __switch_to
0021 .type __switch_to, @function
0022 __switch_to:
0023 CFI_STARTPROC
0024
0025
0026 st.a blink, [sp, -4]
0027 st.a fp, [sp, -4]
0028 SAVE_CALLEE_SAVED_KERNEL
0029
0030
0031 #if KSP_WORD_OFF <= 255
0032 st.as sp, [r0, KSP_WORD_OFF]
0033 #else
0034
0035 add2 r24, r0, KSP_WORD_OFF
0036 st sp, [r24]
0037 #endif
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049 SET_CURR_TASK_ON_CPU r1, r3
0050
0051
0052 ld.as sp, [r1, (TASK_THREAD + THREAD_KSP)/4]
0053
0054
0055 RESTORE_CALLEE_SAVED_KERNEL
0056 ld.ab fp, [sp, 4]
0057 ld.ab blink, [sp, 4]
0058 j [blink]
0059
0060 END_CFI(__switch_to)