18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public 38c2ecf20Sopenharmony_ci * License. See the file "COPYING" in the main directory of this archive 48c2ecf20Sopenharmony_ci * for more details. 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * Copyright (C) 2001 - 2005 Tensilica Inc. 78c2ecf20Sopenharmony_ci */ 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#ifndef _XTENSA_SWITCH_TO_H 108c2ecf20Sopenharmony_ci#define _XTENSA_SWITCH_TO_H 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci/* * switch_to(n) should switch tasks to task nr n, first 138c2ecf20Sopenharmony_ci * checking that n isn't the current task, in which case it does nothing. 148c2ecf20Sopenharmony_ci */ 158c2ecf20Sopenharmony_ciextern void *_switch_to(void *last, void *next); 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci#define switch_to(prev,next,last) \ 188c2ecf20Sopenharmony_cido { \ 198c2ecf20Sopenharmony_ci (last) = _switch_to(prev, next); \ 208c2ecf20Sopenharmony_ci} while(0) 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci#endif /* _XTENSA_SWITCH_TO_H */ 23