switch_to.S 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright (C) 2011 Texas Instruments Incorporated
  3. * Author: Mark Salter (msalter@redhat.com)
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. */
  9. #include <linux/linkage.h>
  10. #include <asm/asm-offsets.h>
  11. #define SP B15
  12. /*
  13. * void __switch_to(struct thread_info *prev,
  14. * struct thread_info *next,
  15. * struct task_struct *tsk) ;
  16. */
  17. ENTRY(__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. STW .D2T2 B3,*+B5(THREAD_PC)
  23. || STDW .D1T1 A13:A12,*+A4(THREAD_A13_12)
  24. || MVC .S2 ILC,B0
  25. LDW .D2T2 *+B4(THREAD_PC),B3
  26. || LDDW .D1T1 *+A5(THREAD_A13_12),A13:A12
  27. STDW .D1T1 A11:A10,*+A4(THREAD_A11_10)
  28. || STDW .D2T2 B1:B0,*+B5(THREAD_RICL_ICL)
  29. #ifndef __DSBT__
  30. || MVKL .S2 current_ksp,B1
  31. #endif
  32. STDW .D2T2 B15:B14,*+B5(THREAD_B15_14)
  33. || STDW .D1T1 A15:A14,*+A4(THREAD_A15_14)
  34. #ifndef __DSBT__
  35. || MVKH .S2 current_ksp,B1
  36. #endif
  37. ;; Switch to next SP
  38. MV .S2 B7,SP
  39. #ifdef __DSBT__
  40. || STW .D2T2 B7,*+B14(current_ksp)
  41. #else
  42. || STW .D2T2 B7,*B1
  43. || MV .L2 B6,B14
  44. #endif
  45. || LDDW .D1T1 *+A5(THREAD_RICL_ICL),A1:A0
  46. STDW .D2T2 B11:B10,*+B5(THREAD_B11_10)
  47. || LDDW .D1T1 *+A5(THREAD_A15_14),A15:A14
  48. STDW .D2T2 B13:B12,*+B5(THREAD_B13_12)
  49. || LDDW .D1T1 *+A5(THREAD_A11_10),A11:A10
  50. B .S2 B3 ; return in next E1
  51. || LDDW .D2T2 *+B4(THREAD_B13_12),B13:B12
  52. LDDW .D2T2 *+B4(THREAD_B11_10),B11:B10
  53. NOP
  54. MV .L2X A0,B0
  55. || MV .S1 A6,A4
  56. MVC .S2 B0,ILC
  57. || MV .L2X A1,B1
  58. MVC .S2 B1,RILC
  59. ENDPROC(__switch_to)