aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/nwfpe/fpmodule.inl
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-07-17 05:54:50 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-07-17 05:54:50 -0400
commitb66da4a4859b0be3f12575863bf1d873116d1947 (patch)
tree70312c230efd0420817906adc2733489026153e9 /arch/arm/nwfpe/fpmodule.inl
parentf60f700876cd51de9de69f3a3c865d95e287a24d (diff)
[PATCH] ARM: Remove global nwfpe register variable
Recent changes to nwfpe broke the build with some gcc versions: In file included from arch/arm/nwfpe/softfloat.c:33: arch/arm/nwfpe/fpa11.h:32: global register variable follows a function definition make[1]: *** [arch/arm/nwfpe/softfloat.o] Error 1 Since we now ensure that the kernel stack is empty when returning to user space, we can now access the userspace registers with reference to the kernel stack using current_thread_info(), rather than remembering the stack pointer at the time nwfpe was called. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/nwfpe/fpmodule.inl')
-rw-r--r--arch/arm/nwfpe/fpmodule.inl14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/arm/nwfpe/fpmodule.inl b/arch/arm/nwfpe/fpmodule.inl
index e5f59e9a3022..2c39ad408f22 100644
--- a/arch/arm/nwfpe/fpmodule.inl
+++ b/arch/arm/nwfpe/fpmodule.inl
@@ -28,8 +28,8 @@ static inline unsigned long readRegister(const unsigned int nReg)
28 for this in this routine. LDF/STF instructions with Rn = PC 28 for this in this routine. LDF/STF instructions with Rn = PC
29 depend on the PC being correct, as they use PC+8 in their 29 depend on the PC being correct, as they use PC+8 in their
30 address calculations. */ 30 address calculations. */
31 unsigned long *userRegisters = GET_USERREG(); 31 struct pt_regs *regs = GET_USERREG();
32 unsigned int val = userRegisters[nReg]; 32 unsigned int val = regs->uregs[nReg];
33 if (REG_PC == nReg) 33 if (REG_PC == nReg)
34 val -= 4; 34 val -= 4;
35 return val; 35 return val;
@@ -38,8 +38,8 @@ static inline unsigned long readRegister(const unsigned int nReg)
38static inline void 38static inline void
39writeRegister(const unsigned int nReg, const unsigned long val) 39writeRegister(const unsigned int nReg, const unsigned long val)
40{ 40{
41 unsigned long *userRegisters = GET_USERREG(); 41 struct pt_regs *regs = GET_USERREG();
42 userRegisters[nReg] = val; 42 regs->uregs[nReg] = val;
43} 43}
44 44
45static inline unsigned long readCPSR(void) 45static inline unsigned long readCPSR(void)
@@ -63,12 +63,12 @@ static inline unsigned long readConditionCodes(void)
63 63
64static inline void writeConditionCodes(const unsigned long val) 64static inline void writeConditionCodes(const unsigned long val)
65{ 65{
66 unsigned long *userRegisters = GET_USERREG(); 66 struct pt_regs *regs = GET_USERREG();
67 unsigned long rval; 67 unsigned long rval;
68 /* 68 /*
69 * Operate directly on userRegisters since 69 * Operate directly on userRegisters since
70 * the CPSR may be the PC register itself. 70 * the CPSR may be the PC register itself.
71 */ 71 */
72 rval = userRegisters[REG_CPSR] & ~CC_MASK; 72 rval = regs->ARM_cpsr & ~CC_MASK;
73 userRegisters[REG_CPSR] = rval | (val & CC_MASK); 73 regs->ARM_cpsr = rval | (val & CC_MASK);
74} 74}