diff options
Diffstat (limited to 'arch/arm/nwfpe')
-rw-r--r-- | arch/arm/nwfpe/ARM-gcc.h | 2 | ||||
-rw-r--r-- | arch/arm/nwfpe/entry.S | 25 | ||||
-rw-r--r-- | arch/arm/nwfpe/fpa11.inl | 8 |
3 files changed, 19 insertions, 16 deletions
diff --git a/arch/arm/nwfpe/ARM-gcc.h b/arch/arm/nwfpe/ARM-gcc.h index e6598470b076..436e54aa02ec 100644 --- a/arch/arm/nwfpe/ARM-gcc.h +++ b/arch/arm/nwfpe/ARM-gcc.h | |||
@@ -68,7 +68,7 @@ a compiler does not support explicit inlining, this macro should be defined | |||
68 | to be `static'. | 68 | to be `static'. |
69 | ------------------------------------------------------------------------------- | 69 | ------------------------------------------------------------------------------- |
70 | */ | 70 | */ |
71 | #define INLINE extern __inline__ | 71 | #define INLINE static inline |
72 | 72 | ||
73 | 73 | ||
74 | /* For use as a GCC soft-float library we need some special function names. */ | 74 | /* For use as a GCC soft-float library we need some special function names. */ |
diff --git a/arch/arm/nwfpe/entry.S b/arch/arm/nwfpe/entry.S index 1dc13bc6d810..48bca0db4607 100644 --- a/arch/arm/nwfpe/entry.S +++ b/arch/arm/nwfpe/entry.S | |||
@@ -70,13 +70,24 @@ floating point instructions. GCC attempts to group floating point | |||
70 | instructions to allow the emulator to spread the cost of the trap over | 70 | instructions to allow the emulator to spread the cost of the trap over |
71 | several floating point instructions. */ | 71 | several floating point instructions. */ |
72 | 72 | ||
73 | #include <asm/asm-offsets.h> | ||
74 | |||
73 | .globl nwfpe_enter | 75 | .globl nwfpe_enter |
74 | nwfpe_enter: | 76 | nwfpe_enter: |
75 | mov r4, lr @ save the failure-return addresses | 77 | mov r4, lr @ save the failure-return addresses |
76 | mov sl, sp @ we access the registers via 'sl' | 78 | mov sl, sp @ we access the registers via 'sl' |
77 | 79 | ||
78 | ldr r5, [sp, #60] @ get contents of PC; | 80 | ldr r5, [sp, #S_PC] @ get contents of PC; |
81 | mov r6, r0 @ save the opcode | ||
79 | emulate: | 82 | emulate: |
83 | ldr r1, [sp, #S_PSR] @ fetch the PSR | ||
84 | bl checkCondition @ check the condition | ||
85 | cmp r0, #0 @ r0 = 0 ==> condition failed | ||
86 | |||
87 | @ if condition code failed to match, next insn | ||
88 | beq next @ get the next instruction; | ||
89 | |||
90 | mov r0, r6 @ prepare for EmulateAll() | ||
80 | bl EmulateAll @ emulate the instruction | 91 | bl EmulateAll @ emulate the instruction |
81 | cmp r0, #0 @ was emulation successful | 92 | cmp r0, #0 @ was emulation successful |
82 | moveq pc, r4 @ no, return failure | 93 | moveq pc, r4 @ no, return failure |
@@ -91,18 +102,10 @@ next: | |||
91 | teqne r2, #0x0E000000 | 102 | teqne r2, #0x0E000000 |
92 | movne pc, r9 @ return ok if not a fp insn | 103 | movne pc, r9 @ return ok if not a fp insn |
93 | 104 | ||
94 | str r5, [sp, #60] @ update PC copy in regs | 105 | str r5, [sp, #S_PC] @ update PC copy in regs |
95 | 106 | ||
96 | mov r0, r6 @ save a copy | 107 | mov r0, r6 @ save a copy |
97 | ldr r1, [sp, #64] @ fetch the condition codes | 108 | b emulate @ check condition and emulate |
98 | bl checkCondition @ check the condition | ||
99 | cmp r0, #0 @ r0 = 0 ==> condition failed | ||
100 | |||
101 | @ if condition code failed to match, next insn | ||
102 | beq next @ get the next instruction; | ||
103 | |||
104 | mov r0, r6 @ prepare for EmulateAll() | ||
105 | b emulate @ if r0 != 0, goto EmulateAll | ||
106 | 109 | ||
107 | @ We need to be prepared for the instructions at .Lx1 and .Lx2 | 110 | @ We need to be prepared for the instructions at .Lx1 and .Lx2 |
108 | @ to fault. Emit the appropriate exception gunk to fix things up. | 111 | @ to fault. Emit the appropriate exception gunk to fix things up. |
diff --git a/arch/arm/nwfpe/fpa11.inl b/arch/arm/nwfpe/fpa11.inl index 10c3caf2868f..ab8d6826245f 100644 --- a/arch/arm/nwfpe/fpa11.inl +++ b/arch/arm/nwfpe/fpa11.inl | |||
@@ -22,13 +22,13 @@ | |||
22 | #include "fpa11.h" | 22 | #include "fpa11.h" |
23 | 23 | ||
24 | /* Read and write floating point status register */ | 24 | /* Read and write floating point status register */ |
25 | extern __inline__ unsigned int readFPSR(void) | 25 | static inline unsigned int readFPSR(void) |
26 | { | 26 | { |
27 | FPA11 *fpa11 = GET_FPA11(); | 27 | FPA11 *fpa11 = GET_FPA11(); |
28 | return (fpa11->fpsr); | 28 | return (fpa11->fpsr); |
29 | } | 29 | } |
30 | 30 | ||
31 | extern __inline__ void writeFPSR(FPSR reg) | 31 | static inline void writeFPSR(FPSR reg) |
32 | { | 32 | { |
33 | FPA11 *fpa11 = GET_FPA11(); | 33 | FPA11 *fpa11 = GET_FPA11(); |
34 | /* the sysid byte in the status register is readonly */ | 34 | /* the sysid byte in the status register is readonly */ |
@@ -36,14 +36,14 @@ extern __inline__ void writeFPSR(FPSR reg) | |||
36 | } | 36 | } |
37 | 37 | ||
38 | /* Read and write floating point control register */ | 38 | /* Read and write floating point control register */ |
39 | extern __inline__ FPCR readFPCR(void) | 39 | static inline FPCR readFPCR(void) |
40 | { | 40 | { |
41 | FPA11 *fpa11 = GET_FPA11(); | 41 | FPA11 *fpa11 = GET_FPA11(); |
42 | /* clear SB, AB and DA bits before returning FPCR */ | 42 | /* clear SB, AB and DA bits before returning FPCR */ |
43 | return (fpa11->fpcr & ~MASK_RFC); | 43 | return (fpa11->fpcr & ~MASK_RFC); |
44 | } | 44 | } |
45 | 45 | ||
46 | extern __inline__ void writeFPCR(FPCR reg) | 46 | static inline void writeFPCR(FPCR reg) |
47 | { | 47 | { |
48 | FPA11 *fpa11 = GET_FPA11(); | 48 | FPA11 *fpa11 = GET_FPA11(); |
49 | fpa11->fpcr &= ~MASK_WFC; /* clear SB, AB and DA bits */ | 49 | fpa11->fpcr &= ~MASK_WFC; /* clear SB, AB and DA bits */ |