aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/powerpc/gen
Commit message (Collapse)AuthorAgeFilesLines
* Remove residual blank line at start of MakefileWarner Losh2024-07-152-2/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* libc/softfloat: we don't export _fp[gs]et* symbolsBrooks Davis2024-03-131-4/+0
| | | | | | | | | | Remove attempts to use NetBSD __weak_alias macros to export _-prefixed versions of various fp[sg]et* symbols under softfloat. __weak_alias isn't defined so we didn't export them and thus the Symbol.map entries were wrong. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D44327
* libc: Purge unneeded cdefs.hWarner Losh2023-11-018-8/+0
| | | | | | | | | These sys/cdefs.h are not needed. Purge them. They are mostly left-over from the $FreeBSD$ removal. A few in libc are still required for macros that cdefs.h defines. Keep those. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D42385
* Purge more stray embedded $FreeBSD$ stringsJohn Baldwin2023-09-251-5/+0
| | | | | | | These do not use __FBSDID but instead use bare char arrays. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D41957
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-1614-29/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSDWarner Losh2023-05-125-5/+5
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-122-2/+2
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* libc: Remove _get_tp() and _set_tp().John Baldwin2021-12-093-87/+1
| | | | | | | | | Their uses have been replaced by _tcb_get() and _tcb_set() from <machine/tls.h>. Reviewed by: kib, jrtc27 Sponsored by: The University of Cambridge, Google Inc. Differential Revision: https://reviews.freebsd.org/D33354
* libc: add _get_tp() private functionKonstantin Belousov2021-04-092-1/+50
| | | | | | | | which returns pointer to tcb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D29623
* [PowerPC] [PowerPCSPE] Fix multiple issues in fpsetmask().Brandon Bergren2021-03-011-3/+3
| | | | | | | | | | | | | | | Building R on powerpc64 exposed a problem in fpsetmask() whereby we were not properly clamping the provided mask to the valid range. This same issue affects powerpc and powerpcspe. Properly limit the range of bits that can be set via fpsetmask(). While here, use the correct fp_except_t type instead of fp_rnd_t. Reported by: pkubaj, jhibbits (in IRC) Sponsored by: Tag1 Consulting, Inc. MFC after: 1 week
* [PowerPC] Fix typo in _ctx_start on ppc32Brandon Bergren2019-11-231-1/+1
| | | | | | | | | | | | Theoretically, this was breaking the size calculation for the symbol. Noticed when doing a readthrough. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D22525 Notes: svn path=/head/; revision=355036
* powerpc: Transition to Secure-PLT, like most other OSsJustin Hibbits2019-06-251-1/+8
| | | | | | | | | | | | | | | | | | | Summary: PowerPC has two PLT models: BSS-PLT and Secure-PLT. BSS-PLT uses runtime code generation to generate the PLT stubs. Secure-PLT was introduced with GCC 4.1 and Binutils 2.17 (base has GCC 4.2.1 and Binutils 2.17), and is a more secure PLT format, using a read-only linkage table, with the dynamic linker populating a non-executable index table. This is the libc, rtld, and kernel support only. The toolchain and build parts will be updated separately. Reviewed By: nwhitehorn, bdragon, pfg Differential Revision: https://reviews.freebsd.org/D20598 MFC after: 1 month Notes: svn path=/head/; revision=349350
* Remove bogus checks against NCARGS.John Baldwin2018-01-311-1/+1
| | | | | | | | | | | | NCARGS isn't a limit on the number of arguments to pass to a function, but the number of bytes that can be consumed by arguments to exec. As such, it is not suitable for a limit on the count of arguments passed to makecontext(). Sponsored by: DARPA / AFRL Notes: svn path=/head/; revision=328631
* libc: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2510-8/+28
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified 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=326193
* Fix a typo which broke the build for powerpc.Justin Hibbits2016-10-251-1/+1
| | | | | | | | | | It's spelled LIBC_SRCTOP not LIBC_SRC. Pointy-hat to: jhibbits Reported by: kib Notes: svn path=/head/; revision=307892
* Reduce code duplication between powerpc and powerpcspeJustin Hibbits2016-10-222-8/+10
| | | | | | | | They're nearly identical except for a few files. Reported by: kib Notes: svn path=/head/; revision=307799
* libc: make some more use of the nitems() macro.Pedro F. Giffuni2016-04-161-2/+2
| | | | | | | | | | | We have an nitems() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read. Given that it is available already without adding additional headers and other parts of libc already use it, extend a bit more its use. Notes: svn path=/head/; revision=298120
* Make unions in PowerPC libc endian-safe.Nathan Whitehorn2016-02-261-2/+15
| | | | Notes: svn path=/head/; revision=296113
* Add include for declaration of _set_tp(). Eliminates -Wmissing-prototypes ↵Craig Rodrigues2015-09-201-0/+1
| | | | | | | warnings. Notes: svn path=/head/; revision=288019
* Fix powerpc setjmp FPR saving/restoring.Justin Hibbits2015-04-083-108/+108
| | | | | | | X-MFC-With: r279784 Notes: svn path=/head/; revision=281243
* Save and restore non-volatile floating-point registers during longjmp().Nathan Whitehorn2015-03-083-0/+126
| | | | | | | | | | | | | | This should also save and restore non-volatile Altivec registers, but that needs to wait on solving two problems: 1. Adding the nonvolatile vector registers means we need 5 more than _JBLEN entries in jmp_buf on 32-bit targets (64-bit is OK). 2. Need to figure out how to determine if saving/restoring vector regs is supported on the current CPU from userland. MFC after: 1 month Notes: svn path=/head/; revision=279784
* Remove duplicate copies of trivial getcontextx.cEd Maste2015-01-122-78/+4
| | | | | | | | | | | | | Only i386 and amd64 provide a non-trivial __getcontextx(). Use a common trivial implementation in gen/ for other architectures, rather than copying the file to each MD subdirectory. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1472 Notes: svn path=/head/; revision=277078
* Avoid use of register variables. Clang 3.5 treats this as undefined behavior,Justin Hibbits2015-01-061-2/+1
| | | | | | | | | and bad things happen. MFC after: 1 week Notes: svn path=/head/; revision=276734
* Ensure that every ENTRY(foo) has a matching END(foo).Baptiste Daroussin2014-10-016-0/+9
| | | | | | | | | | It allows to build with newer binutils Differential Revision: https://reviews.freebsd.org/D877 Reviewed by: jhibbits Notes: svn path=/head/; revision=272362
* Revert r253748,253749Andriy Gapon2013-07-281-0/+1
| | | | | | | | | This WIP should not have been committed yet. Pointyhat to: avg Notes: svn path=/head/; revision=253750
* remove needless inclusion of machine/cpu.h in userlandAndriy Gapon2013-07-281-1/+0
| | | | | | | MFC after: 21 days Notes: svn path=/head/; revision=253749
* The getcontext() from the __fillcontextx() call in theKonstantin Belousov2013-05-281-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | check_deferred_signal() returns twice, since handle_signal() emulates the return from the normal signal handler by sigreturn(2)ing the passed context. Second return is performed on the destroyed stack frame, because __fillcontextx() has already returned. This causes undefined and bad behaviour, usually the victim thread gets SIGSEGV. Avoid nested frame and the need to return from it by doing direct call to getcontext() in the check_deferred_signal() and using a new private libc helper __fillcontextx2() to complement the context with the extended CPU state if the deferred signal is still present. The __fillcontextx() is now unused, but is kept to allow older libthr.so to be used with the new libc. Mark __fillcontextx() as returning twice [1]. Reported by: pgj Pointy hat to: kib Discussed with: dim Tested by: pgj, dim Suggested by: jilles [1] MFC after: 1 week Notes: svn path=/head/; revision=251047
* Allow building for the PowerPC EABI by providing a dummy __eabi()Marcel Moolenaar2012-05-242-1/+34
| | | | | | | | | | function. The purpose of the __eabi() function is to set up the runtime and is called first thing by main(). The runtime is already set up for us prior to caling main, so there's nothing to do for us in the EABI case. Notes: svn path=/head/; revision=235929
* Do not restore the register holding the TLS pointer when doing variousNathan Whitehorn2012-04-113-3/+0
| | | | | | | | | | | | | usermode context switches (long jumps and ucontext operations). If these are used across threads, multiple threads can end up with the same TLS base. Madness will then result. This makes behavior on PPC match that on x86 systems and on Linux. MFC after: 10 days Notes: svn path=/head/; revision=234115
* Replace the assembler macro WEAK_ALIAS with a new macro WEAK_REFERENCE whichAndreas Tobler2012-02-051-1/+1
| | | | | | | | | | | | has the same API as __weak_reference(). Give 'x' in SYS.h a more meaningful name. Tested on 32- and 64-bit PowerMac. Reviewed by: bde Notes: svn path=/head/; revision=231044
* Make the sys/ucontext.h self-contained by changing the return typeKonstantin Belousov2012-02-011-1/+1
| | | | | | | | | | of __getcontextx_size(3) from size_t to int. PR: ports/164654 MFC after: 1 month Notes: svn path=/head/; revision=230864
* Add API for obtaining extended machine context states that cannot beKonstantin Belousov2012-01-212-1/+70
| | | | | | | | | | | | | | fit into existing mcontext_t. On i386 and amd64 do return the extended FPU states using getcontextx(3). For other architectures, getcontextx(3) returns the same information as getcontext(2). Tested by: pho MFC after: 1 month Notes: svn path=/head/; revision=230429
* Two other places where we can use WEAK_ALIAS.Andreas Tobler2012-01-081-2/+1
| | | | Notes: svn path=/head/; revision=229806
* Replace a proliferation of buggy MD implementations of modf() with aDavid Schultz2011-10-212-108/+1
| | | | | | | | | | working MI one. The MI one only needs to be overridden on machines with non-IEEE754 arithmetic. (The last supported one was the VAX.) It can also be overridden if someone comes up with a faster one that actually passes the regression tests -- but this is harder than it sounds. Notes: svn path=/head/; revision=226606
* Fix typos - remove duplicate "the".Rebecca Cran2011-02-211-1/+1
| | | | | | | | | PR: bin/154928 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days Notes: svn path=/head/; revision=218909
* Mark assembler sources from libc as working with non-executable stack.Konstantin Belousov2011-01-145-0/+9
| | | | | | | Reviewed and tested by: nwhitehorn Notes: svn path=/head/; revision=217398
* The NetBSD Foundation has granted permission to remove clause 3 and 4 fromJoel Dahl2010-03-025-35/+0
| | | | | | | | | their software. Obtained from: NetBSD Notes: svn path=/head/; revision=204606
* Fix some ifdef logic in the libc syncicache() bit that I somehow missed in theNathan Whitehorn2008-09-241-1/+3
| | | | | | | last commit. Now it really can use a runtime-set cacheline size. Notes: svn path=/head/; revision=183320
* Allow the cacheline size on PowerPC to be set at runtime. This is essential forNathan Whitehorn2008-09-241-16/+16
| | | | | | | | supporting 64-bit CPUs, which often have 128-byte cache lines instead of the standard 32. Notes: svn path=/head/; revision=183319
* Let PowerPC world optionally build with -msoft-float. For FPU-less PowerPCRafal Jaworowski2008-02-246-0/+12
| | | | | | | | | | | | variations (e500 currently), this provides a gcc-level FPU emulation and is an alternative approach to the recently introduced kernel-level emulation (FPU_EMU). Approved by: cognet (mentor) MFp4: e500 Notes: svn path=/head/; revision=176530
* Fix bogon in previous commit: <machine/cpu.h> is still needed.Marcel Moolenaar2007-06-101-0/+1
| | | | Notes: svn path=/head/; revision=170506
* The definition of CACHELINESIZE moved from <machine/cpu.h> toMarcel Moolenaar2007-06-101-1/+1
| | | | | | | <machine/md_var.h>. Notes: svn path=/head/; revision=170484
* Whitespace fix.Marcel Moolenaar2006-09-021-1/+1
| | | | Notes: svn path=/head/; revision=161853
* Avoid dead code elimination of the assignment to TP by using inlineMarcel Moolenaar2006-08-301-2/+2
| | | | | | | assembly. Notes: svn path=/head/; revision=161729
* Remove fpsetsticky(). This was added for SysV compatibility, but dueDavid Schultz2005-03-152-58/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to mistakes from day 1, it has always had semantics inconsistent with SVR4 and its successors. In particular, given argument M: - On Solaris and FreeBSD/{alpha,sparc64}, it clobbers the old flags and *sets* the new flag word to M. (NetBSD, too?) - On FreeBSD/{amd64,i386}, it *clears* the flags that are specified in M and leaves the remaining flags unchanged (modulo a small bug on amd64.) - On FreeBSD/ia64, it is not implemented. There is no way to fix fpsetsticky() to DTRT for both old FreeBSD apps and apps ported from other operating systems, so the best approach seems to be to kill the function and fix any apps that break. I couldn't find any ports that use it, and any such ports would already be broken on FreeBSD/ia64 and Linux anyway. By the way, the routine has always been undocumented in FreeBSD, except for an MLINK to a manpage that doesn't describe it. This manpage has stated since 5.3-RELEASE that the functions it describes are deprecated, so that must mean that functions that it is *supposed* to describe but doesn't are even *more* deprecated. ;-) Note that fpresetsticky() has been retained on FreeBSD/i386. As far as I can tell, no other operating systems or ports of FreeBSD implement it, so there's nothing for it to be inconsistent with. PR: 75862 Suggested by: bde Notes: svn path=/head/; revision=143658
* Replace the ldexp() implementation in libc with a renamed copy of theDavid Schultz2005-01-221-155/+0
| | | | | | | | | | | | | | | | | | | scalbn() implementation from libm. (The two functions are defined to be identical, but ldexp() lives in libc for backwards compatibility.) The old ldexp() implementation... - was more complicated than this one - set errno instead of raising FP exceptions - got some corner cases wrong (e.g. ldexp(1.0, 2000) in round-to-zero mode) The new implementation lives in libc/gen instead of libc/$MACHINE_ARCH/gen, since we don't need N copies of a machine-independent file. The amd64 and i386 platforms retain their fast and correct MD implementations and override this one. Notes: svn path=/head/; revision=140607
* Add support for TLS in statically linked programs.Doug Rabson2004-08-152-1/+37
| | | | Notes: svn path=/head/; revision=133754
* Add signalcontext, required by KSE.Peter Grehan2004-07-192-1/+104
| | | | Notes: svn path=/head/; revision=132399