arch: arm: extend use of arch.mode variable in FP sharing mode

Only a single bit of the 4-byte internal (thread.arch) status
variable 'mode' is currently used, when we build with User mode
support (CONFIG_USERSPACE=y). In this commit we extend the usage
of 'mode' variable, adding an additional bit-flag to track the
status of the floating point context in a particular thread,
i.e. to track whether FP context is active or not. The status
bit is meant to be used in context-switch, to restore the FP
register context when required.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
Ioannis Glaropoulos 2019-04-26 21:06:35 +02:00 committed by Anas Nashif
commit 358d389c54
4 changed files with 12 additions and 4 deletions

View file

@ -74,10 +74,12 @@ struct _thread_arch {
struct _preempt_float preempt_float;
#endif
#ifdef CONFIG_USERSPACE
#if defined(CONFIG_USERSPACE) || defined(CONFIG_FP_SHARING)
u32_t mode;
#if defined(CONFIG_USERSPACE)
u32_t priv_stack_start;
#endif
#endif
};
typedef struct _thread_arch _thread_arch_t;