162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 262306a36Sopenharmony_ci/* Generic task switch macro wrapper. 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * It should be possible to use these on really simple architectures, 562306a36Sopenharmony_ci * but it serves more as a starting point for new ports. 662306a36Sopenharmony_ci * 762306a36Sopenharmony_ci * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. 862306a36Sopenharmony_ci * Written by David Howells (dhowells@redhat.com) 962306a36Sopenharmony_ci */ 1062306a36Sopenharmony_ci#ifndef __ASM_GENERIC_SWITCH_TO_H 1162306a36Sopenharmony_ci#define __ASM_GENERIC_SWITCH_TO_H 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ci#include <linux/thread_info.h> 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ci/* 1662306a36Sopenharmony_ci * Context switching is now performed out-of-line in switch_to.S 1762306a36Sopenharmony_ci */ 1862306a36Sopenharmony_ciextern struct task_struct *__switch_to(struct task_struct *, 1962306a36Sopenharmony_ci struct task_struct *); 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci#define switch_to(prev, next, last) \ 2262306a36Sopenharmony_ci do { \ 2362306a36Sopenharmony_ci ((last) = __switch_to((prev), (next))); \ 2462306a36Sopenharmony_ci } while (0) 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ci#endif /* __ASM_GENERIC_SWITCH_TO_H */ 27