2 * Copyright(c) 2015 EZchip Technologies.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * The full GNU General Public License is included in this distribution in
14 * the file called "COPYING".
17 #include <linux/sched.h>
18 #include <asm/processor.h>
19 #include <plat/ctop.h>
21 void dp_save_restore(struct task_struct
*prev
, struct task_struct
*next
)
23 struct eznps_dp
*prev_task_dp
= &prev
->thread
.dp
;
24 struct eznps_dp
*next_task_dp
= &next
->thread
.dp
;
26 /* Here we save all Data Plane related auxiliary registers */
27 prev_task_dp
->eflags
= read_aux_reg(CTOP_AUX_EFLAGS
);
28 write_aux_reg(CTOP_AUX_EFLAGS
, next_task_dp
->eflags
);
30 prev_task_dp
->gpa1
= read_aux_reg(CTOP_AUX_GPA1
);
31 write_aux_reg(CTOP_AUX_GPA1
, next_task_dp
->gpa1
);