]> git.hungrycats.org Git - linux/commitdiff
[ARM] FP emulation IRQ handling cleanup.
authorRussell King <rmk@flint.arm.linux.org.uk>
Tue, 9 Jul 2002 22:48:56 +0000 (23:48 +0100)
committerRussell King <rmk@flint.arm.linux.org.uk>
Tue, 9 Jul 2002 22:48:56 +0000 (23:48 +0100)
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.

arch/arm/kernel/entry-armv.S
arch/arm/nwfpe/fpa11.c

index 425dfbc925ed538182c4a7c6bc9c46c0435eda7d..0cd3e7e6b8b905b71c3b37314013f1898f12f333 100644 (file)
@@ -912,11 +912,12 @@ __und_usr:        sub     sp, sp, #S_FRAME_SIZE           @ Allocate frame size in one go
                alignment_trap r4, r7, __temp_und
                zero_fp
                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, 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
                mov     r8, #1
                strb    r8, [r4, #TSK_USED_MATH]        @ set current->used_math
@@ -924,8 +925,7 @@ call_fpe:   get_thread_info r10                     @ get current thread
                add     r10, r10, #TI_FPSTATE           @ r10 = workspace
                ldr     pc, [r4]                        @ Call FP module USR entry point
 
-fpundefinstr:  set_cpsr_c r0, #MODE_SVC                @ Enable interrupts
-               mov     r0, sp
+fpundefinstr:  mov     r0, sp
                adrsvc  al, lr, ret_from_exception
                b       do_undefinstr
 
index d8f7fcaaa85897faf4f951d1af3557588636712a..e954540a9464f4d0d5f8a6ea427ffb4816a0c51f 100644 (file)
@@ -142,9 +142,6 @@ void FPA11_CheckInit(void)
 unsigned int EmulateAll(unsigned int opcode)
 {
   unsigned int nRc = 1, code;
-  unsigned long flags;
-
-  save_flags(flags); sti();
 
   code = opcode & 0x00000f00;
   if (code == 0x00000100 || code == 0x00000200)
@@ -180,8 +177,6 @@ unsigned int EmulateAll(unsigned int opcode)
     }
   }
 
-  restore_flags(flags);
-
   return(nRc);
 }