Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /* Generic task switch macro wrapper.
0003  *
0004  * It should be possible to use these on really simple architectures,
0005  * but it serves more as a starting point for new ports.
0006  *
0007  * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
0008  * Written by David Howells (dhowells@redhat.com)
0009  */
0010 #ifndef __ASM_GENERIC_SWITCH_TO_H
0011 #define __ASM_GENERIC_SWITCH_TO_H
0012 
0013 #include <linux/thread_info.h>
0014 
0015 /*
0016  * Context switching is now performed out-of-line in switch_to.S
0017  */
0018 extern struct task_struct *__switch_to(struct task_struct *,
0019                        struct task_struct *);
0020 
0021 #define switch_to(prev, next, last)                 \
0022     do {                                \
0023         ((last) = __switch_to((prev), (next)));         \
0024     } while (0)
0025 
0026 #endif /* __ASM_GENERIC_SWITCH_TO_H */