libc: add _get_tp() private function(cherry picked from commit 06d8a116bd6b6f70b8aedc6a6a2c4085c53f63ac)
[PowerPC64] Fix multiple issues in fpsetmask().Building R exposed a problem in fpsetmask() whereby we were not properlyclamping the provided mask to the valid range.R initilizes the mask by call
[PowerPC64] Fix multiple issues in fpsetmask().Building R exposed a problem in fpsetmask() whereby we were not properlyclamping the provided mask to the valid range.R initilizes the mask by calling fpsetmask(~0) on FreeBSD. Since werecently enabled precise exceptions, this was causing an immediateSIGFPE because we were attempting to set invalid bits in the fpscr.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 (in IRC)Sponsored by: Tag1 Consulting, Inc.(cherry picked from commit dd95b39235dd81c890aa3cce02a5bb7f91f23803)
show more ...
[POWERPC] Fix ppc64 makecontext() parameter overflow handling.On ELFv2, the overflow parameters in the stack frame are at a different offsetfrom sp than ELFv1. Adjust code to use the correct offse
[POWERPC] Fix ppc64 makecontext() parameter overflow handling.On ELFv2, the overflow parameters in the stack frame are at a different offsetfrom sp than ELFv1. Adjust code to use the correct offset in all cases.This had resulted in argv[8] and up being copied to the incorrect addressin the new context's initial stack frame.This is not necessarily the only bug in this function, I need to do a fullreview still and ensure the rest of the math is sane for ELFv2 stack frames.Reported by: pherde (Probably. My notes are a bit unclear.)Reviewed by: jhibbits (in irc)Sponsored by: Tag1 Consulting, Inc.
[PowerPC] Fix *context on ELFv2Due to ELFv1 specific code in _ctx_start.S and makecontext.c, userspacecontext switching was completely broken on ELFv2.With this change, we now pass the libthr te
[PowerPC] Fix *context on ELFv2Due to ELFv1 specific code in _ctx_start.S and makecontext.c, userspacecontext switching was completely broken on ELFv2.With this change, we now pass the libthr test suite.Approved by: jhibbits (mentor)Differential Revision: https://reviews.freebsd.org/D22421
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.
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.
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
Remove clause 3 and 4 from TNF licensesPer the NetBSD Foundation statement Third parties are encouraged to change the license on any files which have a 4-clause license contributed to the NetBS
Remove clause 3 and 4 from TNF licensesPer the NetBSD Foundation statement Third parties are encouraged to change the license on any files which have a 4-clause license contributed to the NetBSD Foundation to a 2-clause license.
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
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
Properly resolve the _ctx_start function descriptor (the symbol _ctx_startis a descriptor, not a code address), which prevents crashes when startinga context. This fixes QEMU on powerpc64.MFC aft
Properly resolve the _ctx_start function descriptor (the symbol _ctx_startis a descriptor, not a code address), which prevents crashes when startinga context. This fixes QEMU on powerpc64.MFC after: 3 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.
Replace a proliferation of buggy MD implementations of modf() with aworking MI one. The MI one only needs to be overridden on machineswith non-IEEE754 arithmetic. (The last supported one was the
Replace a proliferation of buggy MD implementations of modf() with aworking MI one. The MI one only needs to be overridden on machineswith non-IEEE754 arithmetic. (The last supported one was the VAX.)It can also be overridden if someone comes up with a faster one thatactually passes the regression tests -- but this is harder than it sounds.
Fix typos - remove duplicate "the".PR: bin/154928Submitted by: Eitan Adler <lists at eitanadler.com>MFC after: 3 days
12