mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user