From da7538ace6400aa95ba14dfc3c28b9af08014792 Mon Sep 17 00:00:00 2001 From: Kyoung Kim Date: Fri, 27 Jul 2018 17:56:12 -0700 Subject: ISH: add FPU context save/restore Add FPU context save for current task and restore for next scheduled task. BUG=none TEST=check if FPU-utilizing tasks can resume without FPU operation issues. Change-Id: Id3c5ff1c9a6b3702a27b8ffc5f6a825877671ce4 Signed-off-by: Kyoung Kim Reviewed-on: https://chromium-review.googlesource.com/1154187 Commit-Ready: Kyoung Il Kim Tested-by: Kyoung Il Kim Reviewed-by: Aaron Durbin Reviewed-by: Jett Rink Reviewed-by: Kyoung Il Kim --- core/minute-ia/irq_handler.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/minute-ia/irq_handler.h b/core/minute-ia/irq_handler.h index db05601d6b..b76f51681a 100644 --- a/core/minute-ia/irq_handler.h +++ b/core/minute-ia/irq_handler.h @@ -10,6 +10,14 @@ #include "registers.h" +#ifndef CONFIG_FPU +#define save_fpu_ctx "fnsave 20(%eax)\n" +#define rstr_fpu_ctx "frstor 20(%eax)\n" +#else +#define save_fpu_ctx +#define rstr_fpu_ctx +#endif + struct irq_data { void (*routine)(void); int irq; @@ -47,10 +55,12 @@ struct irq_data { "test %eax, %eax\n" \ "je 1f\n" \ "movl current_task, %eax\n" \ + save_fpu_ctx \ "movl %esp, (%eax)\n" \ "movl next_task, %eax\n" \ "movl %eax, current_task\n" \ "movl (%eax), %esp\n" \ + rstr_fpu_ctx \ "1:\n" \ "movl $"#vector ", (0xFEC00040)\n" \ "sub $1, __in_isr\n" \ @@ -58,5 +68,4 @@ struct irq_data { "popa\n" \ "iret\n" \ ); - #endif /* __CROS_EC_IRQ_HANDLER_H */ -- cgit v1.2.1