ctop.c 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright(c) 2015 EZchip Technologies.
  3. *
  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.
  7. *
  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
  11. * more details.
  12. *
  13. * The full GNU General Public License is included in this distribution in
  14. * the file called "COPYING".
  15. */
  16. #include <linux/sched.h>
  17. #include <asm/processor.h>
  18. #include <plat/ctop.h>
  19. void dp_save_restore(struct task_struct *prev, struct task_struct *next)
  20. {
  21. struct eznps_dp *prev_task_dp = &prev->thread.dp;
  22. struct eznps_dp *next_task_dp = &next->thread.dp;
  23. /* Here we save all Data Plane related auxiliary registers */
  24. prev_task_dp->eflags = read_aux_reg(CTOP_AUX_EFLAGS);
  25. write_aux_reg(CTOP_AUX_EFLAGS, next_task_dp->eflags);
  26. prev_task_dp->gpa1 = read_aux_reg(CTOP_AUX_GPA1);
  27. write_aux_reg(CTOP_AUX_GPA1, next_task_dp->gpa1);
  28. }