Commit 4ffb6981 authored by Russell King's avatar Russell King

[ARM] FP emulation IRQ handling cleanup.

Rather than handling the IRQ state each time we emulate each
instruction, we enable the IRQ before we enter the FP emulator.
We don't require any IRQ protection in the emulator anyway, so
it's safe to implement this trivial performance enhancement.
parent 1938a0e6
...@@ -912,11 +912,12 @@ __und_usr: sub sp, sp, #S_FRAME_SIZE @ Allocate frame size in one go ...@@ -912,11 +912,12 @@ __und_usr: sub sp, sp, #S_FRAME_SIZE @ Allocate frame size in one go
alignment_trap r4, r7, __temp_und alignment_trap r4, r7, __temp_und
zero_fp zero_fp
tst r6, #PSR_T_BIT @ Thumb mode? tst r6, #PSR_T_BIT @ Thumb mode?
bne fpundefinstr bne fpundefinstr @ ignore FP
adrsvc al, r9, ret_from_exception @ r9 = normal FP return adrsvc al, r9, ret_from_exception @ r9 = normal FP return
adrsvc al, lr, fpundefinstr @ lr = undefined instr return adrsvc al, lr, fpundefinstr @ lr = undefined instr return
call_fpe: get_thread_info r10 @ get current thread call_fpe: set_cpsr_c r0, #MODE_SVC @ Enable interrupts
get_thread_info r10 @ get current thread
ldr r4, [r10, #TI_TASK] @ get current task ldr r4, [r10, #TI_TASK] @ get current task
mov r8, #1 mov r8, #1
strb r8, [r4, #TSK_USED_MATH] @ set current->used_math strb r8, [r4, #TSK_USED_MATH] @ set current->used_math
...@@ -924,8 +925,7 @@ call_fpe: get_thread_info r10 @ get current thread ...@@ -924,8 +925,7 @@ call_fpe: get_thread_info r10 @ get current thread
add r10, r10, #TI_FPSTATE @ r10 = workspace add r10, r10, #TI_FPSTATE @ r10 = workspace
ldr pc, [r4] @ Call FP module USR entry point ldr pc, [r4] @ Call FP module USR entry point
fpundefinstr: set_cpsr_c r0, #MODE_SVC @ Enable interrupts fpundefinstr: mov r0, sp
mov r0, sp
adrsvc al, lr, ret_from_exception adrsvc al, lr, ret_from_exception
b do_undefinstr b do_undefinstr
......
...@@ -142,9 +142,6 @@ void FPA11_CheckInit(void) ...@@ -142,9 +142,6 @@ void FPA11_CheckInit(void)
unsigned int EmulateAll(unsigned int opcode) unsigned int EmulateAll(unsigned int opcode)
{ {
unsigned int nRc = 1, code; unsigned int nRc = 1, code;
unsigned long flags;
save_flags(flags); sti();
code = opcode & 0x00000f00; code = opcode & 0x00000f00;
if (code == 0x00000100 || code == 0x00000200) if (code == 0x00000100 || code == 0x00000200)
...@@ -180,8 +177,6 @@ unsigned int EmulateAll(unsigned int opcode) ...@@ -180,8 +177,6 @@ unsigned int EmulateAll(unsigned int opcode)
} }
} }
restore_flags(flags);
return(nRc); return(nRc);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment