Linux Audio

Check our new training course

Loading...
v6.8
 1/* SPDX-License-Identifier: GPL-2.0-only */
 2/*
 3 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
 
 
 
 
 4 */
 5
 6#ifndef _ASM_ARC_SWITCH_TO_H
 7#define _ASM_ARC_SWITCH_TO_H
 8
 9#ifndef __ASSEMBLY__
10
11#include <linux/sched.h>
12#include <asm/dsp-impl.h>
13#include <asm/fpu.h>
 
 
 
 
 
 
 
 
 
 
 
14
15struct task_struct *__switch_to(struct task_struct *p, struct task_struct *n);
16
17#define switch_to(prev, next, last)	\
18do {					\
19	dsp_save_restore(prev, next);	\
20	fpu_save_restore(prev, next);	\
21	last = __switch_to(prev, next);\
 
22	mb();				\
23} while (0)
24
25#endif
26
27#endif
v3.15
 
 1/*
 2 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
 3 *
 4 * This program is free software; you can redistribute it and/or modify
 5 * it under the terms of the GNU General Public License version 2 as
 6 * published by the Free Software Foundation.
 7 */
 8
 9#ifndef _ASM_ARC_SWITCH_TO_H
10#define _ASM_ARC_SWITCH_TO_H
11
12#ifndef __ASSEMBLY__
13
14#include <linux/sched.h>
15
16#ifdef CONFIG_ARC_FPU_SAVE_RESTORE
17
18extern void fpu_save_restore(struct task_struct *p, struct task_struct *n);
19#define ARC_FPU_PREV(p, n)	fpu_save_restore(p, n)
20#define ARC_FPU_NEXT(t)
21
22#else
23
24#define ARC_FPU_PREV(p, n)
25#define ARC_FPU_NEXT(n)
26
27#endif /* !CONFIG_ARC_FPU_SAVE_RESTORE */
28
29struct task_struct *__switch_to(struct task_struct *p, struct task_struct *n);
30
31#define switch_to(prev, next, last)	\
32do {					\
33	ARC_FPU_PREV(prev, next);	\
 
34	last = __switch_to(prev, next);\
35	ARC_FPU_NEXT(next);		\
36	mb();				\
37} while (0)
38
39#endif
40
41#endif