-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARC: [plat-eznps] handle extra aux regs #1: save/restore on context s…
…witch save EFLAGS, and GPA1 auxiliary registers during context switch, since they may be changed by the new task in kernel mode, while using atomic ops e.g. cmpxchg. Signed-off-by: Noam Camus <noamc@ezchip.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
- Loading branch information
Noam Camus
authored and
Vineet Gupta
committed
Aug 28, 2017
1 parent
3f9cd87
commit 5b2189a
Showing
4 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright(c) 2015 EZchip Technologies. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms and conditions of the GNU General Public License, | ||
* version 2, as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
* more details. | ||
* | ||
* The full GNU General Public License is included in this distribution in | ||
* the file called "COPYING". | ||
*/ | ||
|
||
#include <linux/sched.h> | ||
#include <asm/processor.h> | ||
#include <plat/ctop.h> | ||
|
||
void dp_save_restore(struct task_struct *prev, struct task_struct *next) | ||
{ | ||
struct eznps_dp *prev_task_dp = &prev->thread.dp; | ||
struct eznps_dp *next_task_dp = &next->thread.dp; | ||
|
||
/* Here we save all Data Plane related auxiliary registers */ | ||
prev_task_dp->eflags = read_aux_reg(CTOP_AUX_EFLAGS); | ||
write_aux_reg(CTOP_AUX_EFLAGS, next_task_dp->eflags); | ||
|
||
prev_task_dp->gpa1 = read_aux_reg(CTOP_AUX_GPA1); | ||
write_aux_reg(CTOP_AUX_GPA1, next_task_dp->gpa1); | ||
} |