switch_to.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 disable_kernel_fp(void);
  17. extern void enable_kernel_fp(void);
  18. extern void flush_fp_to_thread(struct task_struct *);
  19. extern void enable_kernel_altivec(void);
  20. extern void giveup_altivec(struct task_struct *);
  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. #else
  38. static inline void flush_altivec_to_thread(struct task_struct *t)
  39. {
  40. }
  41. #endif
  42. #ifdef CONFIG_VSX
  43. extern void flush_vsx_to_thread(struct task_struct *);
  44. #else
  45. static inline void flush_vsx_to_thread(struct task_struct *t)
  46. {
  47. }
  48. #endif
  49. #ifdef CONFIG_SPE
  50. extern void flush_spe_to_thread(struct task_struct *);
  51. #else
  52. static inline void flush_spe_to_thread(struct task_struct *t)
  53. {
  54. }
  55. #endif
  56. #endif /* _ASM_POWERPC_SWITCH_TO_H */