switch_to.h 992 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Port on Texas Instruments TMS320C6x architecture
  3. *
  4. * Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
  5. * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef _ASM_C6X_SWITCH_TO_H
  12. #define _ASM_C6X_SWITCH_TO_H
  13. #include <linux/linkage.h>
  14. #define prepare_to_switch() do { } while (0)
  15. struct task_struct;
  16. struct thread_struct;
  17. asmlinkage void *__switch_to(struct thread_struct *prev,
  18. struct thread_struct *next,
  19. struct task_struct *tsk);
  20. #define switch_to(prev, next, last) \
  21. do { \
  22. current->thread.wchan = (u_long) __builtin_return_address(0); \
  23. (last) = __switch_to(&(prev)->thread, \
  24. &(next)->thread, (prev)); \
  25. mb(); \
  26. current->thread.wchan = 0; \
  27. } while (0)
  28. #endif /* _ASM_C6X_SWITCH_TO_H */