18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/* Generic task switch macro wrapper.
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * It should be possible to use these on really simple architectures,
58c2ecf20Sopenharmony_ci * but it serves more as a starting point for new ports.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
88c2ecf20Sopenharmony_ci * Written by David Howells (dhowells@redhat.com)
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci#ifndef __ASM_GENERIC_SWITCH_TO_H
118c2ecf20Sopenharmony_ci#define __ASM_GENERIC_SWITCH_TO_H
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include <linux/thread_info.h>
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci/*
168c2ecf20Sopenharmony_ci * Context switching is now performed out-of-line in switch_to.S
178c2ecf20Sopenharmony_ci */
188c2ecf20Sopenharmony_ciextern struct task_struct *__switch_to(struct task_struct *,
198c2ecf20Sopenharmony_ci				       struct task_struct *);
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#define switch_to(prev, next, last)					\
228c2ecf20Sopenharmony_ci	do {								\
238c2ecf20Sopenharmony_ci		((last) = __switch_to((prev), (next)));			\
248c2ecf20Sopenharmony_ci	} while (0)
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#endif /* __ASM_GENERIC_SWITCH_TO_H */
27