switch_to.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
  3. */
  4. #ifndef _ASM_POWERPC_SWITCH_TO_H
  5. #define _ASM_POWERPC_SWITCH_TO_H
  6. struct thread_struct;
  7. struct task_struct;
  8. struct pt_regs;
  9. extern struct task_struct *__switch_to(struct task_struct *,
  10. struct task_struct *);
  11. #define switch_to(prev, next, last) ((last) = __switch_to((prev), (next)))
  12. struct thread_struct;
  13. extern struct task_struct *_switch(struct thread_struct *prev,
  14. struct thread_struct *next);
  15. extern void giveup_fpu(struct task_struct *);
  16. extern void load_up_fpu(void);
  17. extern void disable_kernel_fp(void);
  18. extern void enable_kernel_fp(void);
  19. extern void flush_fp_to_thread(struct task_struct *);
  20. extern void enable_kernel_altivec(void);
  21. extern void load_up_altivec(struct task_struct *);
  22. extern int emulate_altivec(struct pt_regs *);
  23. extern void __giveup_vsx(struct task_struct *);
  24. extern void giveup_vsx(struct task_struct *);
  25. extern void enable_kernel_spe(void);
  26. extern void giveup_spe(struct task_struct *);
  27. extern void load_up_spe(struct task_struct *);
  28. #ifndef CONFIG_SMP
  29. extern void discard_lazy_cpu_state(void);
  30. #else
  31. static inline void discard_lazy_cpu_state(void)
  32. {
  33. }
  34. #endif
  35. #ifdef CONFIG_ALTIVEC
  36. extern void flush_altivec_to_thread(struct task_struct *);
  37. extern void giveup_altivec(struct task_struct *);
  38. extern void giveup_altivec_notask(void);
  39. #else
  40. static inline void flush_altivec_to_thread(struct task_struct *t)
  41. {
  42. }
  43. static inline void giveup_altivec(struct task_struct *t)
  44. {
  45. }
  46. #endif
  47. #ifdef CONFIG_VSX
  48. extern void flush_vsx_to_thread(struct task_struct *);
  49. #else
  50. static inline void flush_vsx_to_thread(struct task_struct *t)
  51. {
  52. }
  53. #endif
  54. #ifdef CONFIG_SPE
  55. extern void flush_spe_to_thread(struct task_struct *);
  56. #else
  57. static inline void flush_spe_to_thread(struct task_struct *t)
  58. {
  59. }
  60. #endif
  61. #endif /* _ASM_POWERPC_SWITCH_TO_H */