libc: add _get_tp() private function(cherry picked from commit 06d8a116bd6b6f70b8aedc6a6a2c4085c53f63ac)
[PowerPC] [PowerPCSPE] Fix multiple issues in fpsetmask().Building R on powerpc64 exposed a problem in fpsetmask() whereby wewere not properly clamping the provided mask to the valid range.This
[PowerPC] [PowerPCSPE] Fix multiple issues in fpsetmask().Building R on powerpc64 exposed a problem in fpsetmask() whereby wewere 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.(cherry picked from commit 384ee7cc6e9e4ddc91a6e9e623fcbbe5826bce38)
show more ...
[PowerPC] Fix typo in _ctx_start on ppc32Theoretically, this was breaking the size calculation for the symbol.Noticed when doing a readthrough.Reviewed by: impDifferential Revision: https://re
[PowerPC] Fix typo in _ctx_start on ppc32Theoretically, this was breaking the size calculation for the symbol.Noticed when doing a readthrough.Reviewed by: impDifferential Revision: https://reviews.freebsd.org/D22525
powerpc: Transition to Secure-PLT, like most other OSsSummary:PowerPC has two PLT models: BSS-PLT and Secure-PLT. BSS-PLT uses runtimecode generation to generate the PLT stubs. Secure-PLT was i
powerpc: Transition to Secure-PLT, like most other OSsSummary:PowerPC has two PLT models: BSS-PLT and Secure-PLT. BSS-PLT uses runtimecode generation to generate the PLT stubs. Secure-PLT was introduced withGCC 4.1 and Binutils 2.17 (base has GCC 4.2.1 and Binutils 2.17), and is amore secure PLT format, using a read-only linkage table, with the dynamiclinker populating a non-executable index table.This is the libc, rtld, and kernel support only. The toolchain and buildparts will be updated separately.Reviewed By: nwhitehorn, bdragon, pfgDifferential Revision: https://reviews.freebsd.org/D20598MFC after: 1 month
Remove bogus checks against NCARGS.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. Assuch, it is not suit
Remove bogus checks against NCARGS.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. Assuch, it is not suitable for a limit on the count of arguments passedto makecontext().Sponsored by: DARPA / AFRL
libc: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using mis-identified many licenses so this was mostly a manual - errorp
libc: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using mis-identified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.
Fix a typo which broke the build for powerpc.It's spelled LIBC_SRCTOP not LIBC_SRC.Pointy-hat to: jhibbitsReported by: kib
Reduce code duplication between powerpc and powerpcspeThey're nearly identical except for a few files.Reported by: kib
libc: make some more use of the nitems() macro.We have an nitems() macro in the <sys/param.h> header that isconvenient to re-use as it makes things easier to read.Given that it is available alrea
libc: make some more use of the nitems() macro.We have an nitems() macro in the <sys/param.h> header that isconvenient to re-use as it makes things easier to read.Given that it is available already without adding additionalheaders and other parts of libc already use it, extend a bitmore its use.
Make unions in PowerPC libc endian-safe.
Add include for declaration of _set_tp(). Eliminates -Wmissing-prototypes warnings.
Fix powerpc setjmp FPR saving/restoring.X-MFC-With: r279784
Save and restore non-volatile floating-point registers during longjmp().This should also save and restore non-volatile Altivec registers, but thatneeds to wait on solving two problems:1. Adding th
Save and restore non-volatile floating-point registers during longjmp().This should also save and restore non-volatile Altivec registers, but thatneeds 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
Remove duplicate copies of trivial getcontextx.cOnly i386 and amd64 provide a non-trivial __getcontextx(). Use a commontrivial implementation in gen/ for other architectures, rather thancopying t
Remove duplicate copies of trivial getcontextx.cOnly i386 and amd64 provide a non-trivial __getcontextx(). Use a commontrivial implementation in gen/ for other architectures, rather thancopying the file to each MD subdirectory.Reviewed by: kibSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D1472
Avoid use of register variables. Clang 3.5 treats this as undefined behavior,and bad things happen.MFC after: 1 week
Ensure that every ENTRY(foo) has a matching END(foo).It allows to build with newer binutilsDifferential Revision: https://reviews.freebsd.org/D877Reviewed by: jhibbits
Revert r253748,253749This WIP should not have been committed yet.Pointyhat to: avg
remove needless inclusion of machine/cpu.h in userlandMFC after: 21 days
The getcontext() from the __fillcontextx() call in thecheck_deferred_signal() returns twice, since handle_signal() emulatesthe return from the normal signal handler by sigreturn(2)ing thepassed co
The getcontext() from the __fillcontextx() call in thecheck_deferred_signal() returns twice, since handle_signal() emulatesthe return from the normal signal handler by sigreturn(2)ing thepassed context. Second return is performed on the destroyed stackframe, because __fillcontextx() has already returned. This causesundefined and bad behaviour, usually the victim thread gets SIGSEGV.Avoid nested frame and the need to return from it by doing direct callto getcontext() in the check_deferred_signal() and using a new privatelibc helper __fillcontextx2() to complement the context with theextended CPU state if the deferred signal is still present.The __fillcontextx() is now unused, but is kept to allow olderlibthr.so to be used with the new libc.Mark __fillcontextx() as returning twice [1].Reported by: pgjPointy hat to: kibDiscussed with: dimTested by: pgj, dimSuggested by: jilles [1]MFC after: 1 week
Allow building for the PowerPC EABI by providing a dummy __eabi()function. The purpose of the __eabi() function is to set up theruntime and is called first thing by main(). The runtime is alreadys
Allow building for the PowerPC EABI by providing a dummy __eabi()function. The purpose of the __eabi() function is to set up theruntime and is called first thing by main(). The runtime is alreadyset up for us prior to caling main, so there's nothing to do forus in the EABI case.
Do not restore the register holding the TLS pointer when doing varioususermode context switches (long jumps and ucontext operations). If theseare used across threads, multiple threads can end up wi
Do not restore the register holding the TLS pointer when doing varioususermode context switches (long jumps and ucontext operations). If theseare 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
Replace the assembler macro WEAK_ALIAS with a new macro WEAK_REFERENCE whichhas the same API as __weak_reference(). Give 'x' in SYS.h a more meaningfulname.Tested on 32- and 64-bit PowerMac.Rev
Replace the assembler macro WEAK_ALIAS with a new macro WEAK_REFERENCE whichhas the same API as __weak_reference(). Give 'x' in SYS.h a more meaningfulname.Tested on 32- and 64-bit PowerMac.Reviewed by: bde
Make the sys/ucontext.h self-contained by changing the return typeof __getcontextx_size(3) from size_t to int.PR: ports/164654MFC after: 1 month
Add API for obtaining extended machine context states that cannot befit into existing mcontext_t.On i386 and amd64 do return the extended FPU states usinggetcontextx(3). For other architectures,
Add API for obtaining extended machine context states that cannot befit into existing mcontext_t.On i386 and amd64 do return the extended FPU states usinggetcontextx(3). For other architectures, getcontextx(3) returns thesame information as getcontext(2).Tested by: phoMFC after: 1 month
Two other places where we can use WEAK_ALIAS.
12