aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc/fpu
Commit message (Collapse)AuthorAgeFilesLines
* powerpc: clean up empty lines in .c and .h filesMateusz Guzik2020-09-016-17/+1
| | | | Notes: svn path=/head/; revision=365073
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-1/+2
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* powerpc: Apply r178139 from sparc64 to powerpc's fpu_sqrtJustin Hibbits2019-04-031-5/+5
| | | | | | | | | | | | | | | | This fix was committed less than 2 months after the code was forked into the powerpc kernel. Though powerpc doesn't use quad-precision floating point, or need it for emulation, the changes do look like correctness fixes overall. This was found while trying to get fsqrt emulation working on e5500, which does have a real FPU, but lacks the fsqrt instruction. This is not the complete fix, the rest is to be committed separately. MFC after: 1 week Notes: svn path=/head/; revision=345829
* powerpc: Fix FPU fsqrt emulation special case resultsJustin Hibbits2019-01-161-3/+3
| | | | | | | | | | | If fsqrts is emulated with +INF as its argument, the 0 return value causes a NULL pointer dereference, panicking the system. Follow the PowerISA and return +INF with no FP exception. MFC after: 1 week Notes: svn path=/head/; revision=343078
* powerpc: Sync icache on SIGILL, in case of cache issuesJustin Hibbits2018-11-191-10/+3
| | | | | | | | | | | | | | The update of jemalloc to 5.1.0 exposed a cache syncing issue on a Freescale e500 base system. There was already code in the FPU emulator to address this, but it was limited to a single static variable, and did not attempt to sync the cache. This pulls that out to the higher level program exception handler, and syncs the cache. If a SIGILL is hit a second time at the same address, it will be treated as a real illegal instruction, and handled accordingly. Notes: svn path=/head/; revision=340653
* sys/powerpc: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326261
* sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2011-9/+31
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326023
* spdx: initial adoption of licensing ID tags.Pedro F. Giffuni2017-11-181-1/+3
| | | | | | | | | | | | | | | | | | | | The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Initially, only tag files that use BSD 4-Clause "Original" license. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133 Notes: svn path=/head/; revision=325966
* Un-static two local variables in the FPU emulatorJustin Hibbits2016-10-191-2/+2
| | | | | | | | | | | | | Static variables aren't MP-safe, and this was causing bizarre segfaults on a dual-core e500v2 system (P1022). Still left is one static variable, which should be moved into the pcb instead, but as illegal instructions haven't been hit yet, it's lower priority. MFC after: 1 week Notes: svn path=/head/; revision=307598
* Fix build of powerpc FPU emulator after changes in r295132 to restore theJohn Baldwin2016-02-042-24/+24
| | | | | | | | | | | ABI of struct fpreg. The FPU emulator operates on the "raw" FPU state stored in the pcb rather than the "cooked" fpreg state used for ptrace() and cores. Reported by: bz Notes: svn path=/head/; revision=295271
* Restore the ABI of 'struct fpreg' on powerpc.John Baldwin2016-02-013-4/+4
| | | | | | | | | | | | | | The PT_{GET,SET}FPREGS requests use 'struct fpreg' and the NT_FPREGSET core note stores a copy of 'struct fpreg'. As with x86 and the floating point state there compared to the extended state in XSAVE, struct fpreg on powerpc now only holds the 'base' FP state, and setting it via PT_SETFPREGS leaves the extended vector state in a thread unchanged. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D5004 Notes: svn path=/head/; revision=295132
* Kernel support for the Vector-Scalar eXtension (VSX) found on the POWER7Nathan Whitehorn2015-02-222-22/+24
| | | | | | | | | | | | | | | | | | | and POWER8. This instruction set unifies the 32 64-bit scalar floating point registers with the 32 128-bit vector registers into a single bank of 64 128-bit registers. Kernel support mostly amounts to saving and restoring the wider version of the floating point registers and making sure that both scalar FP and vector registers are enabled once a VSX instruction is executed. get_mcontext() and friends currently cannot see the high bits, which will require a little more work. As the system compiler (GCC 4.2) does not support VSX, making use of this from userland requires either newer GCC or clang. Relnotes: yes Sponsored by: FreeBSD Foundation Notes: svn path=/head/; revision=279189
* Fix debug printfs in FPU_EMU to compile on powerpc64 and enable it forJohn Baldwin2013-12-051-8/+13
| | | | | | | | | powerpc64. This fixes the LINT64 kernel config. Approved by: nwhitehorn (the idea, not the actual patch) Notes: svn path=/head/; revision=259010
* Fix undefined behavior: (1 << 31) is not defined as 1 is an int and thisEitan Adler2013-11-302-4/+4
| | | | | | | | | | | | | | | | shifts into the sign bit. Instead use (1U << 31) which gets the expected result. This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD. Discussed with: -arch, rdivacky Reviewed by: cperciva Notes: svn path=/head/; revision=258780
* Make single precision floating point arithmetic actually work -- I thinkNathan Whitehorn2013-11-172-3/+13
| | | | | | | | | | | it never did -- and fix an obvious missing line. Floating point emulation on Book-E still needs some work but this gets it basically functional on soft-FPU systems (hard FPU for Book-E is not yet implemented). MFC after: 1 week Notes: svn path=/head/; revision=258250
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.Ed Schouten2011-11-071-1/+1
| | | | | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static. Notes: svn path=/head/; revision=227309
* The NetBSD Foundation has granted permission to remove clause 3 and 4 fromJoel Dahl2010-03-031-7/+0
| | | | | | | | | their software. Obtained from: NetBSD Notes: svn path=/head/; revision=204640
* Include <sys/types.h> before <sys/systm.h> to get typedefs requiredPeter Grehan2008-04-098-8/+8
| | | | | | | by new atomic.h. Fixes tinderbox LINT build. Notes: svn path=/head/; revision=178030
* Don't define DEBUG. No debugging required.Marcel Moolenaar2008-02-241-2/+0
| | | | | | | Pointy hat: marcel Notes: svn path=/head/; revision=176524
* Resolve warnings exposed by LINT.Marcel Moolenaar2008-02-245-26/+5
| | | | | | | | o Put prototypes in a single header only. o Fix printf format specifiers. Notes: svn path=/head/; revision=176501
* Add a floating-point emulator so that a single userland or single ABIMarcel Moolenaar2008-02-2313-0/+3880
can run on processors that don't have a FPU. This is typically the case for Book E processors. While a tuned system will probably want to use soft-float (or use a processor that has a FPU if the usage is FP intensive enough), allowing hard-float on FPU-less systems gives great portability and flexibility. Obtained from: NetBSD Notes: svn path=/head/; revision=176491