blob: b7f9f607042e68a5c6ffeec1168e666aa5bac00e [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001/* SPDX-License-Identifier: GPL-2.0-only */
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
3 * Copyright (C) 2011 Texas Instruments Incorporated
4 * Author: Mark Salter (msalter@redhat.com)
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00005 */
6
7#include <linux/linkage.h>
8#include <asm/asm-offsets.h>
9
10#define SP B15
11
12 /*
13 * void __switch_to(struct thread_info *prev,
14 * struct thread_info *next,
15 * struct task_struct *tsk) ;
16 */
17ENTRY(__switch_to)
18 LDDW .D2T2 *+B4(THREAD_B15_14),B7:B6
19 || MV .L2X A4,B5 ; prev
20 || MV .L1X B4,A5 ; next
21 || MVC .S2 RILC,B1
22
23 STW .D2T2 B3,*+B5(THREAD_PC)
24 || STDW .D1T1 A13:A12,*+A4(THREAD_A13_12)
25 || MVC .S2 ILC,B0
26
27 LDW .D2T2 *+B4(THREAD_PC),B3
28 || LDDW .D1T1 *+A5(THREAD_A13_12),A13:A12
29
30 STDW .D1T1 A11:A10,*+A4(THREAD_A11_10)
31 || STDW .D2T2 B1:B0,*+B5(THREAD_RICL_ICL)
32#ifndef __DSBT__
33 || MVKL .S2 current_ksp,B1
34#endif
35
36 STDW .D2T2 B15:B14,*+B5(THREAD_B15_14)
37 || STDW .D1T1 A15:A14,*+A4(THREAD_A15_14)
38#ifndef __DSBT__
39 || MVKH .S2 current_ksp,B1
40#endif
41
42 ;; Switch to next SP
43 MV .S2 B7,SP
44#ifdef __DSBT__
45 || STW .D2T2 B7,*+B14(current_ksp)
46#else
47 || STW .D2T2 B7,*B1
48 || MV .L2 B6,B14
49#endif
50 || LDDW .D1T1 *+A5(THREAD_RICL_ICL),A1:A0
51
52 STDW .D2T2 B11:B10,*+B5(THREAD_B11_10)
53 || LDDW .D1T1 *+A5(THREAD_A15_14),A15:A14
54
55 STDW .D2T2 B13:B12,*+B5(THREAD_B13_12)
56 || LDDW .D1T1 *+A5(THREAD_A11_10),A11:A10
57
58 B .S2 B3 ; return in next E1
59 || LDDW .D2T2 *+B4(THREAD_B13_12),B13:B12
60
61 LDDW .D2T2 *+B4(THREAD_B11_10),B11:B10
62 NOP
63
64 MV .L2X A0,B0
65 || MV .S1 A6,A4
66
67 MVC .S2 B0,ILC
68 || MV .L2X A1,B1
69
70 MVC .S2 B1,RILC
71ENDPROC(__switch_to)