armv8-m: set fpscr when do exception_direct

In armv8m the FPSCR[18:16] LTPSIZE field must be set to 0b100 for
"Tail predication not applied" as it's reset value.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
This commit is contained in:
zhangyuan29
2024-08-19 16:57:31 +08:00
committed by GUIDINGLI
parent ef9640c696
commit 57650d841e
+11
View File
@@ -36,6 +36,7 @@
#include "arm_internal.h"
#include "exc_return.h"
#include "nvic.h"
#include "psr.h"
/****************************************************************************
* Public Functions
@@ -45,6 +46,16 @@ void exception_direct(void)
{
int irq = getipsr();
#ifdef CONFIG_ARCH_FPU
__asm__ __volatile__
(
"mov r0, %0\n"
"vmsr fpscr, r0\n"
:
: "i" (ARMV8M_FPSCR_LTPSIZE_NONE)
);
#endif
arm_ack_irq(irq);
irq_dispatch(irq, NULL);