From: Andy P. <at...@us...> - 2002-04-10 18:39:35
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/arm/nwfpe In directory usw-pr-cvs1:/tmp/cvs-serv24336/arm/nwfpe Modified Files: Makefile double_cpdo.c entry.S entry26.S extended_cpdo.c fpa11.c fpa11.h fpa11.inl fpa11_cpdo.c fpa11_cpdt.c fpa11_cprt.c fpmodule.c fpmodule.inl fpopcode.c fpopcode.h single_cpdo.c Removed Files: config.h Log Message: synch 2.4.15 commit 32 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/nwfpe/Makefile,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- Makefile 25 Feb 2001 23:15:21 -0000 1.1.1.2 +++ Makefile 10 Apr 2002 13:51:23 -0000 1.2 @@ -1,7 +1,7 @@ # # linux/arch/arm/nwfpe/Makefile # -# Copyright (C) 1998, 1999 Philip Blundell +# Copyright (C) 1998, 1999, 2001 Philip Blundell # USE_STANDARD_AS_RULE := true @@ -14,7 +14,7 @@ list-multi := nwfpe.o -obj-$(CONFIG_NWFPE) += nwfpe.o +obj-$(CONFIG_FPE_NWFPE) += nwfpe.o nwfpe-objs := fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o \ fpmodule.o fpopcode.o softfloat.o \ Index: double_cpdo.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/nwfpe/double_cpdo.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- double_cpdo.c 14 Jan 2001 19:47:07 -0000 1.1.1.1 +++ double_cpdo.c 10 Apr 2002 13:51:23 -0000 1.2 @@ -1,6 +1,6 @@ /* NetWinder Floating Point Emulator - (c) Rebel.com, 1998-1999 + (c) Rebel.COM, 1998,1999 Direct questions, comments to Scott Bambrough <sc...@ne...> @@ -23,10 +23,6 @@ #include "fpopcode.h" #include "fpa11.h" -extern FPA11 *fpa11; - -float64 getDoubleConstant(unsigned int); - float64 float64_exp(float64 Fm); float64 float64_ln(float64 Fm); float64 float64_sin(float64 rFm); @@ -41,6 +37,7 @@ unsigned int DoubleCPDO(const unsigned int opcode) { + FPA11 *fpa11 = GET_FPA11(); float64 rFm, rFn; unsigned int Fd, Fm, Fn, nRc = 1; Index: entry.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/nwfpe/entry.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- entry.S 14 Jan 2001 19:47:07 -0000 1.1.1.1 +++ entry.S 10 Apr 2002 13:51:23 -0000 1.2 @@ -1,7 +1,7 @@ /* NetWinder Floating Point Emulator - (c) Corel Computer Corporation, 1998 - (c) Philip Blundell 1998-1999 + (c) Rebel.COM, 1998 + (c) 1998, 1999 Philip Blundell Direct questions, comments to Scott Bambrough <sc...@ne...> @@ -77,16 +77,13 @@ emulation. This would reduce load/store overhead at the expense of stealing two regs from the register allocator. Not sure if it's worth it. */ - ldr r4, =userRegisters - str sp, [r4] @ save pointer to user regs - ldr r4, =fpa11 - str r10, [r4] @ store pointer to our state + str sp, [r10] @ Store the user registers pointer in the fpa11 structure. mov r4, sp @ use r4 for local pointer mov r10, lr @ save the failure-return addresses ldr r5, [r4, #60] @ get contents of PC; sub r8, r5, #4 -.Lx2: ldrt r0, [r8], #0 @ get actual instruction into r0 +.Lx2: ldrt r0, [r8] @ get actual instruction into r0 emulate: bl EmulateAll @ emulate the instruction cmp r0, #0 @ was emulation successful @@ -115,15 +112,17 @@ mov r0, r6 @ prepare for EmulateAll() b emulate @ if r0 != 0, goto EmulateAll - @ We need to be prepared for the instruction at .Lx1 or .Lx2 - @ to fault. + @ We need to be prepared for the instructions at .Lx1 and .Lx2 + @ to fault. Emit the appropriate exception gunk to fix things up. + @ ??? For some reason, faults can happen at .Lx2 even with a + @ plain LDR instruction. Weird, but it seems harmless. .section .fixup,"ax" - .align -.Lfix: mov pc, r9 + .align 2 +.Lfix: mov pc, r9 @ let the user eat segfaults .previous .section __ex_table,"a" - .align 3 - .long .Lx2, .Lfix + .align 3 .long .Lx1, .Lfix + .long .Lx2, .Lfix .previous Index: entry26.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/nwfpe/entry26.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- entry26.S 14 Jan 2001 19:47:08 -0000 1.1.1.1 +++ entry26.S 10 Apr 2002 13:51:23 -0000 1.2 @@ -1,6 +1,6 @@ /* NetWinder Floating Point Emulator - (c) Corel Computer Corporation, 1998 + (c) Rebel.COM, 1998 (c) Philip Blundell 1998-1999 Direct questions, comments to Scott Bambrough <sc...@ne...> @@ -20,7 +20,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "../lib/constants.h" +#include <asm/constants.h> /* This is the kernel's entry point into the floating point emulator. It is called from the kernel with code similar to this: @@ -84,7 +84,7 @@ beq fpundefinstr @ no, return failure next: - ldrt r6, [r5], #4 @ get the next instruction and +.Lx1: ldrt r6, [r5], #4 @ get the next instruction and @ increment PC and r2, r6, #0x0F000000 @ test for FP insns @@ -110,3 +110,13 @@ adr lr, 1b orr lr, lr, #3 b EmulateAll @ if r0 != 0, goto EmulateAll + +.Lret: b ret_from_exception @ let the user eat segfaults + + @ We need to be prepared for the instruction at .Lx1 to fault. + @ Emit the appropriate exception gunk to fix things up. + .section __ex_table,"a" + .align 3 + .long .Lx1 + ldr lr, [lr, $(.Lret - .Lx1)/4] + .previous Index: extended_cpdo.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/nwfpe/extended_cpdo.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- extended_cpdo.c 14 Jan 2001 19:47:09 -0000 1.1.1.1 +++ extended_cpdo.c 10 Apr 2002 13:51:23 -0000 1.2 @@ -1,6 +1,6 @@ /* NetWinder Floating Point Emulator - (c) Rebel.com, 1998-1999 + (c) Rebel.COM, 1998,1999 Direct questions, comments to Scott Bambrough <sc...@ne...> @@ -23,8 +23,6 @@ #include "fpopcode.h" #include "fpa11.h" -floatx80 getExtendedConstant(unsigned int); - floatx80 floatx80_exp(floatx80 Fm); floatx80 floatx80_ln(floatx80 Fm); floatx80 floatx80_sin(floatx80 rFm); @@ -39,6 +37,7 @@ unsigned int ExtendedCPDO(const unsigned int opcode) { + FPA11 *fpa11 = GET_FPA11(); floatx80 rFm, rFn; unsigned int Fd, Fm, Fn, nRc = 1; Index: fpa11.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/nwfpe/fpa11.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fpa11.c 14 Jan 2001 19:47:10 -0000 1.1.1.1 +++ fpa11.c 10 Apr 2002 13:51:23 -0000 1.2 @@ -1,6 +1,6 @@ /* NetWinder Floating Point Emulator - (c) Rebel.com, 1998-1999 + (c) Rebel.COM, 1998,1999 Direct questions, comments to Scott Bambrough <sc...@ne...> @@ -32,22 +32,20 @@ unsigned int EmulateCPDT(const unsigned int); unsigned int EmulateCPRT(const unsigned int); -/* Emulator registers */ -FPA11 *fpa11; - /* Reset the FPA11 chip. Called to initialize and reset the emulator. */ void resetFPA11(void) { int i; - + FPA11 *fpa11 = GET_FPA11(); + /* initialize the register type array */ for (i=0;i<=7;i++) { fpa11->fType[i] = typeNone; } - /* FPSR: set system id to FP_EMULATOR, clear all other bits */ - fpa11->fpsr = FP_EMULATOR; + /* FPSR: set system id to FP_EMULATOR, set AC, clear all other bits */ + fpa11->fpsr = FP_EMULATOR | BIT_AC; /* FPCR: set SB, AB and DA bits, clear all others */ #if MAINTAIN_FPCR @@ -130,8 +128,10 @@ { unsigned int nRc = 0; unsigned long flags; - + FPA11 *fpa11; save_flags(flags); sti(); + + fpa11 = GET_FPA11(); if (fpa11->initflag == 0) /* good place for __builtin_expect */ { Index: fpa11.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/nwfpe/fpa11.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fpa11.h 14 Jan 2001 19:47:10 -0000 1.1.1.1 +++ fpa11.h 10 Apr 2002 13:51:23 -0000 1.2 @@ -26,6 +26,9 @@ #include "fpsr.h" /* FP control and status register definitions */ #include "softfloat.h" +/* Need task_struct */ +#include <linux/sched.h> + #define typeNone 0x00 #define typeSingle 0x01 #define typeDouble 0x02 @@ -39,6 +42,7 @@ /* FPA11 device model */ typedef struct tagFPA11 { + unsigned int *userRegisters; FPREG fpreg[8]; /* 8 floating point registers */ FPSR fpsr; /* floating point status register */ FPCR fpcr; /* floating point control register */ @@ -56,6 +60,7 @@ extern void SetRoundingMode(const unsigned int); extern void SetRoundingPrecision(const unsigned int); -extern FPA11 *fpa11; +#define GET_FPA11() ((FPA11 *)(¤t->thread.fpstate)) +#define GET_USERREG() (GET_FPA11()->userRegisters) #endif Index: fpa11.inl =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/nwfpe/fpa11.inl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fpa11.inl 14 Jan 2001 19:47:10 -0000 1.1.1.1 +++ fpa11.inl 10 Apr 2002 13:51:23 -0000 1.2 @@ -1,6 +1,6 @@ /* NetWinder Floating Point Emulator - (c) Corel Computer Corporation, 1998 + (c) Rebel.COM, 1998,1999 Direct questions, comments to Scott Bambrough <sc...@ne...> @@ -24,11 +24,13 @@ /* Read and write floating point status register */ extern __inline__ unsigned int readFPSR(void) { + FPA11 *fpa11 = GET_FPA11(); return(fpa11->fpsr); } extern __inline__ void writeFPSR(FPSR reg) { + FPA11 *fpa11 = GET_FPA11(); /* the sysid byte in the status register is readonly */ fpa11->fpsr = (fpa11->fpsr & MASK_SYSID) | (reg & ~MASK_SYSID); } @@ -36,12 +38,14 @@ /* Read and write floating point control register */ extern __inline__ FPCR readFPCR(void) { + FPA11 *fpa11 = GET_FPA11(); /* clear SB, AB and DA bits before returning FPCR */ return(fpa11->fpcr & ~MASK_RFC); } extern __inline__ void writeFPCR(FPCR reg) { + FPA11 *fpa11 = GET_FPA11(); fpa11->fpcr &= ~MASK_WFC; /* clear SB, AB and DA bits */ fpa11->fpcr |= (reg & MASK_WFC); /* write SB, AB and DA bits */ } Index: fpa11_cpdo.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/nwfpe/fpa11_cpdo.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fpa11_cpdo.c 14 Jan 2001 19:47:11 -0000 1.1.1.1 +++ fpa11_cpdo.c 10 Apr 2002 13:51:23 -0000 1.2 @@ -1,6 +1,6 @@ /* NetWinder Floating Point Emulator - (c) Rebel.com, 1998-1999 + (c) Rebel.COM, 1998,1999 Direct questions, comments to Scott Bambrough <sc...@ne...> @@ -28,6 +28,7 @@ unsigned int EmulateCPDO(const unsigned int opcode) { + FPA11 *fpa11 = GET_FPA11(); unsigned int Fd, nType, nDest, nRc = 1; //printk("EmulateCPDO(0x%08x)\n",opcode); Index: fpa11_cpdt.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/nwfpe/fpa11_cpdt.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fpa11_cpdt.c 14 Jan 2001 19:47:12 -0000 1.1.1.1 +++ fpa11_cpdt.c 10 Apr 2002 13:51:23 -0000 1.2 @@ -28,16 +28,18 @@ #include <asm/uaccess.h> -extern __inline__ +static inline void loadSingle(const unsigned int Fn,const unsigned int *pMem) { + FPA11 *fpa11 = GET_FPA11(); fpa11->fType[Fn] = typeSingle; get_user(fpa11->fpreg[Fn].fSingle, pMem); } -extern __inline__ +static inline void loadDouble(const unsigned int Fn,const unsigned int *pMem) { + FPA11 *fpa11 = GET_FPA11(); unsigned int *p; p = (unsigned int*)&fpa11->fpreg[Fn].fDouble; fpa11->fType[Fn] = typeDouble; @@ -45,9 +47,10 @@ get_user(p[1], &pMem[0]); /* sign & exponent */ } -extern __inline__ +static inline void loadExtended(const unsigned int Fn,const unsigned int *pMem) { + FPA11 *fpa11 = GET_FPA11(); unsigned int *p; p = (unsigned int*)&fpa11->fpreg[Fn].fExtended; fpa11->fType[Fn] = typeExtended; @@ -56,9 +59,10 @@ get_user(p[2], &pMem[1]); /* ms bits */ } -extern __inline__ +static inline void loadMultiple(const unsigned int Fn,const unsigned int *pMem) { + FPA11 *fpa11 = GET_FPA11(); register unsigned int *p; unsigned long x; @@ -87,9 +91,10 @@ } } -extern __inline__ +static inline void storeSingle(const unsigned int Fn,unsigned int *pMem) { + FPA11 *fpa11 = GET_FPA11(); float32 val; register unsigned int *p = (unsigned int*)&val; @@ -109,9 +114,10 @@ put_user(p[0], pMem); } -extern __inline__ +static inline void storeDouble(const unsigned int Fn,unsigned int *pMem) { + FPA11 *fpa11 = GET_FPA11(); float64 val; register unsigned int *p = (unsigned int*)&val; @@ -131,9 +137,10 @@ put_user(p[0], &pMem[1]); /* lsw */ } -extern __inline__ +static inline void storeExtended(const unsigned int Fn,unsigned int *pMem) { + FPA11 *fpa11 = GET_FPA11(); floatx80 val; register unsigned int *p = (unsigned int*)&val; @@ -155,9 +162,10 @@ put_user(p[2], &pMem[1]); /* msw */ } -extern __inline__ +static inline void storeMultiple(const unsigned int Fn,unsigned int *pMem) { + FPA11 *fpa11 = GET_FPA11(); register unsigned int nType, *p; p = (unsigned int*)&(fpa11->fpreg[Fn]); Index: fpa11_cprt.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/nwfpe/fpa11_cprt.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fpa11_cprt.c 14 Jan 2001 19:47:13 -0000 1.1.1.1 +++ fpa11_cprt.c 10 Apr 2002 13:51:23 -0000 1.2 @@ -1,6 +1,6 @@ /* NetWinder Floating Point Emulator - (c) Rebel.com, 1998-1999 + (c) Rebel.COM, 1998,1999 (c) Philip Blundell, 1999 Direct questions, comments to Scott Bambrough <sc...@ne...> @@ -78,6 +78,8 @@ unsigned int PerformFLT(const unsigned int opcode) { + FPA11 *fpa11 = GET_FPA11(); + unsigned int nRc = 1; SetRoundingMode(opcode); SetRoundingPrecision(opcode); @@ -116,6 +118,7 @@ unsigned int PerformFIX(const unsigned int opcode) { + FPA11 *fpa11 = GET_FPA11(); unsigned int nRc = 1; unsigned int Fn = getFm(opcode); @@ -182,6 +185,7 @@ static unsigned int PerformComparison(const unsigned int opcode) { + FPA11 *fpa11 = GET_FPA11(); unsigned int Fn, Fm; floatx80 rFn, rFm; int e_flag = opcode & 0x400000; /* 1 if CxFE */ Index: fpmodule.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/nwfpe/fpmodule.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fpmodule.c 14 Jan 2001 19:47:13 -0000 1.1.1.1 +++ fpmodule.c 10 Apr 2002 13:51:23 -0000 1.2 @@ -39,9 +39,6 @@ #include "fpa11.h" #include "fpa11.inl" -/* external data */ -extern FPA11 *fpa11; - /* kernel symbols required for signal handling */ typedef struct task_struct* PTASK; @@ -55,6 +52,8 @@ #else #define fp_send_sig send_sig #define kern_fp_enter fp_enter + +extern char fpe_type[]; #endif /* kernel function prototypes required */ @@ -69,27 +68,45 @@ /* forward declarations */ extern void nwfpe_enter(void); -/* Address of user registers on the kernel stack. */ -unsigned int *userRegisters; +#ifdef MODULE +/* + * Return 0 if we can be unloaded. This can only happen if + * kern_fp_enter is still pointing at nwfpe_enter + */ +static int fpe_unload(void) +{ + return (kern_fp_enter == nwfpe_enter) ? 0 : 1; +} +#endif -int __init fpe_init(void) +static int __init fpe_init(void) { - if (sizeof(FPA11) > sizeof(union fp_state)) + if (sizeof(FPA11) > sizeof(union fp_state)) { printk(KERN_ERR "nwfpe: bad structure size\n"); - else { - /* Display title, version and copyright information. */ - printk(KERN_WARNING "NetWinder Floating Point Emulator V0.95 " - "(c) 1998-1999 Rebel.com\n"); - - /* Save pointer to the old FP handler and then patch ourselves in */ - orig_fp_enter = kern_fp_enter; - kern_fp_enter = nwfpe_enter; + return -EINVAL; } +#ifdef MODULE + if (!mod_member_present(&__this_module, can_unload)) + return -EINVAL; + __this_module.can_unload = fpe_unload; +#else + if (fpe_type[0] && strcmp(fpe_type, "nwfpe")) + return 0; +#endif + + /* Display title, version and copyright information. */ + printk(KERN_WARNING "NetWinder Floating Point Emulator V0.95 " + "(c) 1998-1999 Rebel.com\n"); + + /* Save pointer to the old FP handler and then patch ourselves in */ + orig_fp_enter = kern_fp_enter; + kern_fp_enter = nwfpe_enter; + return 0; } -void __exit fpe_exit(void) +static void __exit fpe_exit(void) { /* Restore the values we saved earlier. */ kern_fp_enter = orig_fp_enter; @@ -122,7 +139,7 @@ #ifdef CONFIG_DEBUG_USER printk(KERN_DEBUG "NWFPE: %s[%d] takes exception %08x at %p from %08x\n", current->comm, current->pid, flags, - __builtin_return_address(0), userRegisters[15]); + __builtin_return_address(0), GET_USERREG()[15]); #endif /* Keep SoftFloat exception flags up to date. */ Index: fpmodule.inl =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/nwfpe/fpmodule.inl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fpmodule.inl 14 Jan 2001 19:47:14 -0000 1.1.1.1 +++ fpmodule.inl 10 Apr 2002 13:51:23 -0000 1.2 @@ -1,6 +1,6 @@ /* - NetWinder Floating Point Emulator - (c) Rebel.com, 1998-1999 + NetWinder Floating Point Emulator + (c) Rebel.COM, 1998,1999 Direct questions, comments to Scott Bambrough <sc...@ne...> @@ -19,9 +19,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* Address of user registers on the kernel stack. */ -extern unsigned int *userRegisters; - extern __inline__ unsigned int readRegister(const unsigned int nReg) { @@ -32,6 +29,7 @@ for this in this routine. LDF/STF instructions with Rn = PC depend on the PC being correct, as they use PC+8 in their address calculations. */ + unsigned int *userRegisters = GET_USERREG(); unsigned int val = userRegisters[nReg]; if (REG_PC == nReg) val -= 4; return val; @@ -40,6 +38,7 @@ extern __inline__ void writeRegister(const unsigned int nReg, const unsigned int val) { + unsigned int *userRegisters = GET_USERREG(); userRegisters[nReg] = val; } @@ -68,6 +67,7 @@ extern __inline__ void writeConditionCodes(const unsigned int val) { + unsigned int *userRegisters = GET_USERREG(); unsigned int rval; /* * Operate directly on userRegisters since Index: fpopcode.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/nwfpe/fpopcode.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fpopcode.c 14 Jan 2001 19:47:15 -0000 1.1.1.1 +++ fpopcode.c 10 Apr 2002 13:51:23 -0000 1.2 @@ -1,6 +1,6 @@ /* NetWinder Floating Point Emulator - (c) Rebel.com, 1998-1999 + (c) Rebel.COM, 1998,1999 Direct questions, comments to Scott Bambrough <sc...@ne...> @@ -26,7 +26,7 @@ #include "fpmodule.h" #include "fpmodule.inl" -static floatx80 floatx80Constant[] = { +const floatx80 floatx80Constant[] = { { 0x0000, 0x0000000000000000ULL}, /* extended 0.0 */ { 0x3fff, 0x8000000000000000ULL}, /* extended 1.0 */ { 0x4000, 0x8000000000000000ULL}, /* extended 2.0 */ @@ -37,7 +37,7 @@ { 0x4002, 0xa000000000000000ULL} /* extended 10.0 */ }; -static float64 float64Constant[] = { +const float64 float64Constant[] = { 0x0000000000000000ULL, /* double 0.0 */ 0x3ff0000000000000ULL, /* double 1.0 */ 0x4000000000000000ULL, /* double 2.0 */ @@ -48,7 +48,7 @@ 0x4024000000000000ULL /* double 10.0 */ }; -static float32 float32Constant[] = { +const float32 float32Constant[] = { 0x00000000, /* single 0.0 */ 0x3f800000, /* single 1.0 */ 0x40000000, /* single 2.0 */ @@ -59,21 +59,6 @@ 0x41200000 /* single 10.0 */ }; -floatx80 getExtendedConstant(const unsigned int nIndex) -{ - return floatx80Constant[nIndex]; -} - -float64 getDoubleConstant(const unsigned int nIndex) -{ - return float64Constant[nIndex]; -} - -float32 getSingleConstant(const unsigned int nIndex) -{ - return float32Constant[nIndex]; -} - unsigned int getTransferLength(const unsigned int opcode) { unsigned int nRc; @@ -135,10 +120,10 @@ return(nRc); } -/* contition code lookup table +/* condition code lookup table index into the table is test code: EQ, NE, ... LT, GT, AL, NV bit position in short is condition code: NZCV */ -unsigned short aCC[16] = { +static const unsigned short aCC[16] = { 0xF0F0, // EQ == Z set 0x0F0F, // NE 0xCCCC, // CS == C set Index: fpopcode.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/nwfpe/fpopcode.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fpopcode.h 14 Jan 2001 19:47:16 -0000 1.1.1.1 +++ fpopcode.h 10 Apr 2002 13:51:23 -0000 1.2 @@ -1,6 +1,6 @@ /* NetWinder Floating Point Emulator - (c) Rebel.com, 1998-1999 + (c) Rebel.COM, 1998,1999 Direct questions, comments to Scott Bambrough <sc...@ne...> @@ -366,11 +366,25 @@ /* Get the rounding mode from the opcode. */ #define getRoundingMode(opcode) ((opcode & MASK_ROUNDING_MODE) >> 5) -float32 getSingleConstant(const unsigned int nIndex); -float64 getDoubleConstant(const unsigned int nIndex); -floatx80 getExtendedConstant(const unsigned int nIndex); +static inline const floatx80 getExtendedConstant(const unsigned int nIndex) +{ + extern const floatx80 floatx80Constant[]; + return floatx80Constant[nIndex]; +} + +static inline const float64 getDoubleConstant(const unsigned int nIndex) +{ + extern const float64 float64Constant[]; + return float64Constant[nIndex]; +} + +static inline const float32 getSingleConstant(const unsigned int nIndex) +{ + extern const float32 float32Constant[]; + return float32Constant[nIndex]; +} -unsigned int getRegisterCount(const unsigned int opcode); -unsigned int getDestinationSize(const unsigned int opcode); +extern unsigned int getRegisterCount(const unsigned int opcode); +extern unsigned int getDestinationSize(const unsigned int opcode); #endif Index: single_cpdo.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/nwfpe/single_cpdo.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- single_cpdo.c 14 Jan 2001 19:47:18 -0000 1.1.1.1 +++ single_cpdo.c 10 Apr 2002 13:51:23 -0000 1.2 @@ -1,6 +1,6 @@ /* NetWinder Floating Point Emulator - (c) Rebel.com, 1998-1999 + (c) Rebel.COM, 1998,1999 Direct questions, comments to Scott Bambrough <sc...@ne...> @@ -23,8 +23,6 @@ #include "fpopcode.h" #include "fpa11.h" -float32 getSingleConstant(unsigned int); - float32 float32_exp(float32 Fm); float32 float32_ln(float32 Fm); float32 float32_sin(float32 rFm); @@ -39,6 +37,7 @@ unsigned int SingleCPDO(const unsigned int opcode) { + FPA11 *fpa11 = GET_FPA11(); float32 rFm, rFn; unsigned int Fd, Fm, Fn, nRc = 1; --- config.h DELETED --- |