File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -47,30 +47,24 @@ void rt_hw_trap_undef(struct rt_hw_exp_stack *regs)
4747{
4848#ifdef RT_USING_FPU
4949 {
50- uint32_t ins ;
50+ uint32_t val ;
5151 uint32_t addr ;
5252
5353 if (regs -> cpsr & (1 << 5 ))
5454 {
5555 /* thumb mode */
5656 addr = regs -> pc - 2 ;
57- ins = (uint32_t )* (uint16_t * )addr ;
58- if ((ins & (3 << 11 )) != 0 )
59- {
60- /* 32 bit ins */
61- ins <<= 16 ;
62- ins += * (uint16_t * )(addr + 2 );
63- }
6457 }
6558 else
6659 {
6760 addr = regs -> pc - 4 ;
68- ins = * (uint32_t * )addr ;
6961 }
70- if ((ins & 0xe00 ) == 0xa00 )
62+ asm volatile ("vmrs %0, fpexc" : "=r" (val )::"memory" );
63+
64+ if (!(val & 0x40000000 ))
7165 {
7266 /* float ins */
73- uint32_t val = (1U << 30 );
67+ val = (1U << 30 );
7468
7569 asm volatile ("vmsr fpexc, %0" ::"r" (val ):"memory" );
7670 regs -> pc = addr ;
You can’t perform that action at this time.
0 commit comments