switch_to.h 928 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #ifndef _ASM_ARC_SWITCH_TO_H
  9. #define _ASM_ARC_SWITCH_TO_H
  10. #ifndef __ASSEMBLY__
  11. #include <linux/sched.h>
  12. #ifdef CONFIG_ARC_FPU_SAVE_RESTORE
  13. extern void fpu_save_restore(struct task_struct *p, struct task_struct *n);
  14. #define ARC_FPU_PREV(p, n) fpu_save_restore(p, n)
  15. #define ARC_FPU_NEXT(t)
  16. #else
  17. #define ARC_FPU_PREV(p, n)
  18. #define ARC_FPU_NEXT(n)
  19. #endif /* !CONFIG_ARC_FPU_SAVE_RESTORE */
  20. struct task_struct *__switch_to(struct task_struct *p, struct task_struct *n);
  21. #define switch_to(prev, next, last) \
  22. do { \
  23. ARC_FPU_PREV(prev, next); \
  24. last = __switch_to(prev, next);\
  25. ARC_FPU_NEXT(next); \
  26. mb(); \
  27. } while (0)
  28. #endif
  29. #endif