arm64: FPU context switching support
This adds FPU sharing support with a lazy context switching algorithm. Every thread is allowed to use FPU/SIMD registers. In fact, the compiler may insert FPU reg accesses in anycontext to optimize even non-FP code unless the -mgeneral-regs-only compiler flag is used, but Zephyr currently doesn't support such a build. It is therefore possible to do FP access in IRS as well with this patch although IRQs are then disabled to prevent nested IRQs in such cases. Because the thread object grows in size, some tests have to be adjusted. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This commit is contained in:
parent
a82fff04ff
commit
f1f63dda17
20 changed files with 588 additions and 5 deletions
|
@ -116,6 +116,17 @@ static void cpu_hold(void *arg1, void *arg2, void *arg3)
|
|||
|
||||
k_sem_give(&cpuhold_sem);
|
||||
|
||||
#if defined(CONFIG_ARM64) && defined(CONFIG_FPU_SHARING)
|
||||
/*
|
||||
* We'll be spinning with IRQs disabled. The flush-your-FPU request
|
||||
* IPI will never be serviced during that time. Therefore we flush
|
||||
* the FPU preemptively here to prevent any other CPU waiting after
|
||||
* this CPU forever and deadlock the system.
|
||||
*/
|
||||
extern void z_arm64_flush_local_fpu(void);
|
||||
z_arm64_flush_local_fpu();
|
||||
#endif
|
||||
|
||||
while (cpuhold_active) {
|
||||
k_busy_wait(1000);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue