Merge pull request #4584 from rtthread-bot/rtt_bot

[update] RT-Thread Robot automatic submission
This commit is contained in:
Bernard Xiong 2021-04-09 08:47:27 +08:00 committed by GitHub
commit c6540b8cbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 11 deletions

View File

@ -47,30 +47,24 @@ void rt_hw_trap_undef(struct rt_hw_exp_stack *regs)
{ {
#ifdef RT_USING_FPU #ifdef RT_USING_FPU
{ {
uint32_t ins; uint32_t val;
uint32_t addr; uint32_t addr;
if (regs->cpsr & (1 << 5)) if (regs->cpsr & (1 << 5))
{ {
/* thumb mode */ /* thumb mode */
addr = regs->pc - 2; addr = regs->pc - 2;
ins = (uint32_t)*(uint16_t*)addr;
if ((ins & (3 << 11)) != 0)
{
/* 32 bit ins */
ins <<= 16;
ins += *(uint16_t*)(addr + 2);
}
} }
else else
{ {
addr = regs->pc - 4; addr = regs->pc - 4;
ins = *(uint32_t*)addr;
} }
if ((ins & 0xe00) == 0xa00) asm volatile ("vmrs %0, fpexc" : "=r"(val)::"memory");
if (!(val & 0x40000000))
{ {
/* float ins */ /* float ins */
uint32_t val = (1U << 30); val = (1U << 30);
asm volatile ("vmsr fpexc, %0"::"r"(val):"memory"); asm volatile ("vmsr fpexc, %0"::"r"(val):"memory");
regs->pc = addr; regs->pc = addr;