11da177e4SLinus Torvalds2003-03-22 Ralph Siemsen <ralphs@netwinder.org> 21da177e4SLinus Torvalds * Reformat all but softfloat files to get a consistent coding style. 31da177e4SLinus Torvalds Used "indent -kr -i8 -ts8 -sob -l132 -ss" and a few manual fixups. 41da177e4SLinus Torvalds * Removed dead code and fixed function protypes to match definitions. 51da177e4SLinus Torvalds * Consolidated use of (opcode && MASK_ARITHMETIC_OPCODE) >> 20. 61da177e4SLinus Torvalds * Make 80-bit precision a compile-time option. (1%) 71da177e4SLinus Torvalds * Only initialize FPE state once in repeat-FP situations. (6%) 81da177e4SLinus Torvalds 91da177e4SLinus Torvalds2002-01-19 Russell King <rmk@arm.linux.org.uk> 101da177e4SLinus Torvalds 111da177e4SLinus Torvalds * fpa11.h - Add documentation 121da177e4SLinus Torvalds - remove userRegisters pointer from this structure. 131da177e4SLinus Torvalds - add new method to obtain integer register values. 141da177e4SLinus Torvalds * softfloat.c - Remove float128 151da177e4SLinus Torvalds * softfloat.h - Remove float128 161da177e4SLinus Torvalds * softfloat-specialize - Remove float128 171da177e4SLinus Torvalds 181da177e4SLinus Torvalds * The FPA11 structure is not a kernel-specific data structure. 191da177e4SLinus Torvalds It is used by users of ptrace to examine the values of the 201da177e4SLinus Torvalds floating point registers. Therefore, any changes to the 211da177e4SLinus Torvalds FPA11 structure (size or position of elements contained 221da177e4SLinus Torvalds within) have to be well thought out. 231da177e4SLinus Torvalds 241da177e4SLinus Torvalds * Since 128-bit float requires the FPA11 structure to change 251da177e4SLinus Torvalds size, it has been removed. 128-bit float is currently unused, 261da177e4SLinus Torvalds and needs various things to be re-worked so that we won't 271da177e4SLinus Torvalds overflow the available space in the task structure. 281da177e4SLinus Torvalds 291da177e4SLinus Torvalds * The changes are designed to break any patch that goes on top 301da177e4SLinus Torvalds of this code, so that the authors properly review their changes. 311da177e4SLinus Torvalds 321da177e4SLinus Torvalds1999-08-19 Scott Bambrough <scottb@netwinder.org> 331da177e4SLinus Torvalds 341da177e4SLinus Torvalds * fpmodule.c - Changed version number to 0.95 351da177e4SLinus Torvalds * fpa11.h - modified FPA11, FPREG structures 361da177e4SLinus Torvalds * fpa11.c - Changes due to FPA11, FPREG structure alterations. 371da177e4SLinus Torvalds * fpa11_cpdo.c - Changes due to FPA11, FPREG structure alterations. 381da177e4SLinus Torvalds * fpa11_cpdt.c - Changes due to FPA11, FPREG structure alterations. 391da177e4SLinus Torvalds * fpa11_cprt.c - Changes due to FPA11, FPREG structure alterations. 401da177e4SLinus Torvalds * single_cpdo.c - Changes due to FPA11, FPREG structure alterations. 411da177e4SLinus Torvalds * double_cpdo.c - Changes due to FPA11, FPREG structure alterations. 421da177e4SLinus Torvalds * extended_cpdo.c - Changes due to FPA11, FPREG structure alterations. 431da177e4SLinus Torvalds 441da177e4SLinus Torvalds * I discovered several bugs. First and worst is that the kernel 451da177e4SLinus Torvalds passes in a pointer to the FPE's state area. This is defined 461da177e4SLinus Torvalds as a struct user_fp (see user.h). This pointer was cast to a 471da177e4SLinus Torvalds FPA11*. Unfortunately FPA11 and user_fp are of different sizes; 481da177e4SLinus Torvalds user_fp is smaller. This meant that the FPE scribbled on things 491da177e4SLinus Torvalds below its area, which is bad, as the area is in the thread_struct 501da177e4SLinus Torvalds embedded in the process task structure. Thus we were scribbling 511da177e4SLinus Torvalds over one of the most important structures in the entire OS. 521da177e4SLinus Torvalds 531da177e4SLinus Torvalds * user_fp and FPA11 have now been harmonized. Most of the changes 541da177e4SLinus Torvalds in the above code were dereferencing problems due to moving the 551da177e4SLinus Torvalds register type out of FPREG, and getting rid of the union variable 561da177e4SLinus Torvalds fpvalue. 571da177e4SLinus Torvalds 581da177e4SLinus Torvalds * Second I noticed resetFPA11 was not always being called for a 591da177e4SLinus Torvalds task. This should happen on the first floating point exception 601da177e4SLinus Torvalds that occurs. It is controlled by init_flag in FPA11. The 611da177e4SLinus Torvalds comment in the code beside init_flag state the kernel guarantees 621da177e4SLinus Torvalds this to be zero. Not so. I found that the kernel recycles task 631da177e4SLinus Torvalds structures, and that recycled ones may not have init_flag zeroed. 641da177e4SLinus Torvalds I couldn't even find anything that guarantees it is zeroed when 651da177e4SLinus Torvalds when the task structure is initially allocated. In any case 661da177e4SLinus Torvalds I now initialize the entire FPE state in the thread structure to 671da177e4SLinus Torvalds zero when allocated and recycled. See alloc_task_struct() and 681da177e4SLinus Torvalds flush_thread() in arch/arm/process.c. The change to 691da177e4SLinus Torvalds alloc_task_struct() may not be necessary, but I left it in for 701da177e4SLinus Torvalds completeness (better safe than sorry). 711da177e4SLinus Torvalds 721da177e4SLinus Torvalds1998-11-23 Scott Bambrough <scottb@netwinder.org> 731da177e4SLinus Torvalds 741da177e4SLinus Torvalds * README.FPE - fix typo in description of lfm/sfm instructions 751da177e4SLinus Torvalds * NOTES - Added file to describe known bugs/problems 761da177e4SLinus Torvalds * fpmodule.c - Changed version number to 0.94 771da177e4SLinus Torvalds 781da177e4SLinus Torvalds1998-11-20 Scott Bambrough <scottb@netwinder.org> 791da177e4SLinus Torvalds 801da177e4SLinus Torvalds * README.FPE - fix description of URD, NRM instructions 811da177e4SLinus Torvalds * TODO - remove URD, NRM instructions from TODO list 821da177e4SLinus Torvalds * single_cpdo.c - implement URD, NRM 831da177e4SLinus Torvalds * double_cpdo.c - implement URD, NRM 841da177e4SLinus Torvalds * extended_cpdo.c - implement URD, NRM 851da177e4SLinus Torvalds 861da177e4SLinus Torvalds1998-11-19 Scott Bambrough <scottb@netwinder.org> 871da177e4SLinus Torvalds 881da177e4SLinus Torvalds * ChangeLog - Added this file to track changes made. 891da177e4SLinus Torvalds * fpa11.c - added code to initialize register types to typeNone 901da177e4SLinus Torvalds * fpa11_cpdt.c - fixed bug in storeExtended (typeExtended changed to 911da177e4SLinus Torvalds typeDouble in switch statement) 92