1*4882a593Smuzhiyun2003-03-22 Ralph Siemsen <ralphs@netwinder.org> 2*4882a593Smuzhiyun * Reformat all but softfloat files to get a consistent coding style. 3*4882a593Smuzhiyun Used "indent -kr -i8 -ts8 -sob -l132 -ss" and a few manual fixups. 4*4882a593Smuzhiyun * Removed dead code and fixed function protypes to match definitions. 5*4882a593Smuzhiyun * Consolidated use of (opcode && MASK_ARITHMETIC_OPCODE) >> 20. 6*4882a593Smuzhiyun * Make 80-bit precision a compile-time option. (1%) 7*4882a593Smuzhiyun * Only initialize FPE state once in repeat-FP situations. (6%) 8*4882a593Smuzhiyun 9*4882a593Smuzhiyun2002-01-19 Russell King <rmk@arm.linux.org.uk> 10*4882a593Smuzhiyun 11*4882a593Smuzhiyun * fpa11.h - Add documentation 12*4882a593Smuzhiyun - remove userRegisters pointer from this structure. 13*4882a593Smuzhiyun - add new method to obtain integer register values. 14*4882a593Smuzhiyun * softfloat.c - Remove float128 15*4882a593Smuzhiyun * softfloat.h - Remove float128 16*4882a593Smuzhiyun * softfloat-specialize - Remove float128 17*4882a593Smuzhiyun 18*4882a593Smuzhiyun * The FPA11 structure is not a kernel-specific data structure. 19*4882a593Smuzhiyun It is used by users of ptrace to examine the values of the 20*4882a593Smuzhiyun floating point registers. Therefore, any changes to the 21*4882a593Smuzhiyun FPA11 structure (size or position of elements contained 22*4882a593Smuzhiyun within) have to be well thought out. 23*4882a593Smuzhiyun 24*4882a593Smuzhiyun * Since 128-bit float requires the FPA11 structure to change 25*4882a593Smuzhiyun size, it has been removed. 128-bit float is currently unused, 26*4882a593Smuzhiyun and needs various things to be re-worked so that we won't 27*4882a593Smuzhiyun overflow the available space in the task structure. 28*4882a593Smuzhiyun 29*4882a593Smuzhiyun * The changes are designed to break any patch that goes on top 30*4882a593Smuzhiyun of this code, so that the authors properly review their changes. 31*4882a593Smuzhiyun 32*4882a593Smuzhiyun1999-08-19 Scott Bambrough <scottb@netwinder.org> 33*4882a593Smuzhiyun 34*4882a593Smuzhiyun * fpmodule.c - Changed version number to 0.95 35*4882a593Smuzhiyun * fpa11.h - modified FPA11, FPREG structures 36*4882a593Smuzhiyun * fpa11.c - Changes due to FPA11, FPREG structure alterations. 37*4882a593Smuzhiyun * fpa11_cpdo.c - Changes due to FPA11, FPREG structure alterations. 38*4882a593Smuzhiyun * fpa11_cpdt.c - Changes due to FPA11, FPREG structure alterations. 39*4882a593Smuzhiyun * fpa11_cprt.c - Changes due to FPA11, FPREG structure alterations. 40*4882a593Smuzhiyun * single_cpdo.c - Changes due to FPA11, FPREG structure alterations. 41*4882a593Smuzhiyun * double_cpdo.c - Changes due to FPA11, FPREG structure alterations. 42*4882a593Smuzhiyun * extended_cpdo.c - Changes due to FPA11, FPREG structure alterations. 43*4882a593Smuzhiyun 44*4882a593Smuzhiyun * I discovered several bugs. First and worst is that the kernel 45*4882a593Smuzhiyun passes in a pointer to the FPE's state area. This is defined 46*4882a593Smuzhiyun as a struct user_fp (see user.h). This pointer was cast to a 47*4882a593Smuzhiyun FPA11*. Unfortunately FPA11 and user_fp are of different sizes; 48*4882a593Smuzhiyun user_fp is smaller. This meant that the FPE scribbled on things 49*4882a593Smuzhiyun below its area, which is bad, as the area is in the thread_struct 50*4882a593Smuzhiyun embedded in the process task structure. Thus we were scribbling 51*4882a593Smuzhiyun over one of the most important structures in the entire OS. 52*4882a593Smuzhiyun 53*4882a593Smuzhiyun * user_fp and FPA11 have now been harmonized. Most of the changes 54*4882a593Smuzhiyun in the above code were dereferencing problems due to moving the 55*4882a593Smuzhiyun register type out of FPREG, and getting rid of the union variable 56*4882a593Smuzhiyun fpvalue. 57*4882a593Smuzhiyun 58*4882a593Smuzhiyun * Second I noticed resetFPA11 was not always being called for a 59*4882a593Smuzhiyun task. This should happen on the first floating point exception 60*4882a593Smuzhiyun that occurs. It is controlled by init_flag in FPA11. The 61*4882a593Smuzhiyun comment in the code beside init_flag state the kernel guarantees 62*4882a593Smuzhiyun this to be zero. Not so. I found that the kernel recycles task 63*4882a593Smuzhiyun structures, and that recycled ones may not have init_flag zeroed. 64*4882a593Smuzhiyun I couldn't even find anything that guarantees it is zeroed when 65*4882a593Smuzhiyun when the task structure is initially allocated. In any case 66*4882a593Smuzhiyun I now initialize the entire FPE state in the thread structure to 67*4882a593Smuzhiyun zero when allocated and recycled. See alloc_task_struct() and 68*4882a593Smuzhiyun flush_thread() in arch/arm/process.c. The change to 69*4882a593Smuzhiyun alloc_task_struct() may not be necessary, but I left it in for 70*4882a593Smuzhiyun completeness (better safe than sorry). 71*4882a593Smuzhiyun 72*4882a593Smuzhiyun1998-11-23 Scott Bambrough <scottb@netwinder.org> 73*4882a593Smuzhiyun 74*4882a593Smuzhiyun * README.FPE - fix typo in description of lfm/sfm instructions 75*4882a593Smuzhiyun * NOTES - Added file to describe known bugs/problems 76*4882a593Smuzhiyun * fpmodule.c - Changed version number to 0.94 77*4882a593Smuzhiyun 78*4882a593Smuzhiyun1998-11-20 Scott Bambrough <scottb@netwinder.org> 79*4882a593Smuzhiyun 80*4882a593Smuzhiyun * README.FPE - fix description of URD, NRM instructions 81*4882a593Smuzhiyun * TODO - remove URD, NRM instructions from TODO list 82*4882a593Smuzhiyun * single_cpdo.c - implement URD, NRM 83*4882a593Smuzhiyun * double_cpdo.c - implement URD, NRM 84*4882a593Smuzhiyun * extended_cpdo.c - implement URD, NRM 85*4882a593Smuzhiyun 86*4882a593Smuzhiyun1998-11-19 Scott Bambrough <scottb@netwinder.org> 87*4882a593Smuzhiyun 88*4882a593Smuzhiyun * ChangeLog - Added this file to track changes made. 89*4882a593Smuzhiyun * fpa11.c - added code to initialize register types to typeNone 90*4882a593Smuzhiyun * fpa11_cpdt.c - fixed bug in storeExtended (typeExtended changed to 91*4882a593Smuzhiyun typeDouble in switch statement) 92