switch_to.h 901 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Task switching for PKUnity SoC and UniCore ISA
  3. *
  4. * Copyright (C) 2001-2012 GUAN Xue-tao
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef __UNICORE_SWITCH_TO_H__
  11. #define __UNICORE_SWITCH_TO_H__
  12. struct task_struct;
  13. struct thread_info;
  14. /*
  15. * switch_to(prev, next) should switch from task `prev' to `next'
  16. * `prev' will never be the same as `next'. schedule() itself
  17. * contains the memory barrier to tell GCC not to cache `current'.
  18. */
  19. extern struct task_struct *__switch_to(struct task_struct *,
  20. struct thread_info *, struct thread_info *);
  21. #define switch_to(prev, next, last) \
  22. do { \
  23. last = __switch_to(prev, task_thread_info(prev), \
  24. task_thread_info(next)); \
  25. } while (0)
  26. #endif /* __UNICORE_SWITCH_TO_H__ */