core: move VFP state into struct user_ta_ctx

Moves the VFP state from struct user_ta_ctx to struct user_mode_ctx to make
user mode handling a bit more generic.

Acked-by: Pipat Methavanitpong <pipat.methavanitpong@linaro.org>
Reviewed-by: Jerome Forissier <jerome@forissier.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
diff --git a/core/arch/arm/include/kernel/user_ta.h b/core/arch/arm/include/kernel/user_ta.h
index 7f6e347..4181f55 100644
--- a/core/arch/arm/include/kernel/user_ta.h
+++ b/core/arch/arm/include/kernel/user_ta.h
@@ -58,9 +58,6 @@
 	struct tee_storage_enum_head storage_enums;
 	vaddr_t stack_ptr;
 	void *ta_time_offs;
-#if defined(CFG_WITH_VFP)
-	struct thread_user_vfp_state vfp;
-#endif
 	struct user_mode_ctx uctx;
 };
 
diff --git a/core/arch/arm/kernel/abort.c b/core/arch/arm/kernel/abort.c
index f851c68..da1f5ef 100644
--- a/core/arch/arm/kernel/abort.c
+++ b/core/arch/arm/kernel/abort.c
@@ -10,7 +10,7 @@
 #include <kernel/panic.h>
 #include <kernel/tee_ta_manager.h>
 #include <kernel/unwind.h>
-#include <kernel/user_ta.h>
+#include <kernel/user_mode_ctx.h>
 #include <mm/core_mmu.h>
 #include <mm/mobj.h>
 #include <mm/tee_pager.h>
@@ -377,7 +377,7 @@
 	if (tee_ta_get_current_session(&s) != TEE_SUCCESS)
 		panic();
 
-	thread_user_enable_vfp(&to_user_ta_ctx(s->ctx)->vfp);
+	thread_user_enable_vfp(&to_user_mode_ctx(s->ctx)->vfp);
 }
 #endif /*CFG_WITH_VFP*/
 
diff --git a/core/arch/arm/kernel/user_ta.c b/core/arch/arm/kernel/user_ta.c
index 421f91e..1d9f576 100644
--- a/core/arch/arm/kernel/user_ta.c
+++ b/core/arch/arm/kernel/user_ta.c
@@ -118,7 +118,7 @@
 static void clear_vfp_state(struct user_ta_ctx *utc __unused)
 {
 #ifdef CFG_WITH_VFP
-	thread_user_clear_vfp(&utc->vfp);
+	thread_user_clear_vfp(&utc->uctx.vfp);
 #endif
 }
 
diff --git a/core/include/kernel/user_mode_ctx_struct.h b/core/include/kernel/user_mode_ctx_struct.h
index 25a89c8..3bfe2c6 100644
--- a/core/include/kernel/user_mode_ctx_struct.h
+++ b/core/include/kernel/user_mode_ctx_struct.h
@@ -7,11 +7,15 @@
 #define __KERNEL_USER_MODE_CTX_STRUCT_H
 
 #include <kernel/tee_ta_manager.h>
+#include <kernel/thread.h>
 #include <mm/tee_mmu_types.h>
 
 struct user_mode_ctx {
 	struct vm_info vm_info;
 	struct tee_pager_area_head *areas;
+#if defined(CFG_WITH_VFP)
+	struct thread_user_vfp_state vfp;
+#endif
 	struct tee_ta_ctx ctx;
 };
 #endif /*__KERNEL_USER_MODE_CTX_STRUCT_H*/