Add sched_getcpu()(cherry picked from commit 77b2c2f81451db8119e4ea6398fe76813db790de)
libc: add _get_tp() private function(cherry picked from commit 06d8a116bd6b6f70b8aedc6a6a2c4085c53f63ac)
libc/<arch>/sys/cerror.S: fix typo(cherry picked from commit 4c2e9c35fb1958544040493e4fd8d8b8a0927677)
[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 ...
Add CFI start/end proc directives to arm64, i386, and ppcFollow-up to r353959 and r368070: do the same for other architectures.arm32 already seems to use its own .fnstart/.fnend directives, which
Add CFI start/end proc directives to arm64, i386, and ppcFollow-up to r353959 and r368070: do the same for other architectures.arm32 already seems to use its own .fnstart/.fnend directives, whichappear to be ARM-specific variants of the same thing. Likewise, MIPSuses .frame directives.Reviewed by: arichardsonDifferential Revision: https://reviews.freebsd.org/D27387
[PowerPC64LE] Fix gdtoa configurations on LE.gdtoa wins the award for "most outdated endianness naming convention"with its IEEE_8087 vs IEEE_MC68k defines. I had a good chuckle.Update softfloat
[PowerPC64LE] Fix gdtoa configurations on LE.gdtoa wins the award for "most outdated endianness naming convention"with its IEEE_8087 vs IEEE_MC68k defines. I had a good chuckle.Update softfloat and arith.h to adjust to BE or LE automaticallybased on the low level preprocessor defines.Fixes printf/scanf on PowerPC64LE, although there is still a problemlurking regarding Signalling NaNs...Sponsored by: Tag1 Consulting, Inc.
[PowerPC] Implement VDSO timebase access on powerpc*Implement the remaining pieces needed to allow userland timestamp reading.Rewritten based on an intial essay into the problem by Justin Hibbits
[PowerPC] Implement VDSO timebase access on powerpc*Implement the remaining pieces needed to allow userland timestamp reading.Rewritten based on an intial essay into the problem by Justin Hibbits.(Copyright changed to my own on his request.)Tested on ppc64 (POWER9 Talos II), powerpcspe (e500v2 RB800), andpowerpc (g4 PowerBook).Reviewed by: jhibbits (in irc)Sponsored by: Tag1 Consulting, Inc.Differential Revision: https://reviews.freebsd.org/D26347
[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
Fix initial exec TLS mode for dynamically loaded shared objects.If dso uses initial exec TLS mode, rtld tries to allocate TLS instatic space. If there is no space left, the dlopen(3) fails. If spa
Fix initial exec TLS mode for dynamically loaded shared objects.If dso uses initial exec TLS mode, rtld tries to allocate TLS instatic space. If there is no space left, the dlopen(3) fails. If spaceif allocated, initial content from PT_TLS segment is distributed toall threads' pcbs, which was missed and caused un-initialized TLSsegment for such dso after dlopen(3).The mode is auto-detected either due to the relocation used, or if theDF_STATIC_TLS dynamic flag is set. In the later case, the TLS segmentis tried to allocate earlier, which increases chance of the dlopen(3)to succeed. LLD was recently fixed to properly emit the flag, ld.bdfdid it always.Initial test by: dumbbellTested by: emaste (amd64), ian (arm)Tested by: Gerald Aryeetey <aryeeteygerald_rogers.com> (arm64)Sponsored by: The FreeBSD FoundationMFC after: 2 weeksDifferential revision: https://reviews.freebsd.org/D19072
Remove MD __sys_* private symbols.No references to any of these exist in the tree. The list was alsoerratic with different architectures exporting different things(arm64 and riscv exported none).
Remove MD __sys_* private symbols.No references to any of these exist in the tree. The list was alsoerratic with different architectures exporting different things(arm64 and riscv exported none).Reviewed by: kibSponsored by: DARPA, AFRLDifferential Revision: https://reviews.freebsd.org/D18425
Reimplement brk() and sbrk() to avoid the use of _end.Previously, libc.so would initialize its notion of the break addressusing _end, a special symbol emitted by the static linker followingthe bs
Reimplement brk() and sbrk() to avoid the use of _end.Previously, libc.so would initialize its notion of the break addressusing _end, a special symbol emitted by the static linker followingthe bss section. Compatibility issues between lld and ld.bfd couldcause the wrong definition of _end (libc.so's definition rather thanthat of the executable) to be used, breaking the brk()/sbrk()interface.Avoid this problem and future interoperability issues by simply notrelying on _end. Instead, modify the break() system call to returnthe kernel's view of the current break address, and have libcinitialize its state using an extra syscall upon the first use of theinterface. As a side effect, this appears to fix brk()/sbrk() usagein executables run with rtld direct exec, since the kernel and libc.sono longer maintain separate views of the process' break address.PR: 228574Reviewed by: kib (previous version)MFC after: 2 monthsDifferential Revision: https://reviews.freebsd.org/D15663
Replace MD assembly exect() with a portable version.Originally, on the VAX exect() enable tracing once the new executableimage was loaded. This was possible because tracing was controllablethrou
Replace MD assembly exect() with a portable version.Originally, on the VAX exect() enable tracing once the new executableimage was loaded. This was possible because tracing was controllablethrough user space code by setting the PSL_T flag. The followinginstruction is a system call that activated tracing (as allinstructions do) by copying PSL_T to PSL_TP (trace pending). Thefirst instruction of the new executable image would trigger a tracefault.This is not portable to all platforms and the behavior was replaced withptrace(PT_TRACE_ME, ...) since FreeBSD forked off of the CSRG repository.Platforms either incorrectly call execve(), trigger trace faults insidethe original executable, or do contain an implementation of thisfunction.The exect() interfaces is deprecated or removed on NetBSD and OpenBSD.Submitted by: Ali Mashtizadeh <[email protected]>Reviewed by: kibDifferential Revision: https://reviews.freebsd.org/D14989
Remove caching from getlogin(2).This caching has existed since the CSRG import, but serves no obviouspurpose. Sure, setlogin() is called rarely, but calls to getlogin()should also be infrequent.
Remove caching from getlogin(2).This caching has existed since the CSRG import, but serves no obviouspurpose. Sure, setlogin() is called rarely, but calls to getlogin()should also be infrequent. The required invalidation was notimplemented on aarch64, arm, mips, amd riscv so updates would neveroccur if getlogin() was called before setlogin().Reported by: Ali Mashtizadeh <[email protected]>Reviewed by: kibSponsored by: DARPA, AFRLDifferential Revision: https://reviews.freebsd.org/D14965
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.
General further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 3-Clause license.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier f
General further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 3-Clause license.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.Special thanks to Wind River for providing access to "The Duke ofHighlander" tool: an older (2014) run over FreeBSD tree was useful as astarting point.
Correct an misunderstanding of MDSRCS.MDSRCS it intended to allow assembly versions of funtions with Cimplementations listed in MISRCS. The selection of the correctmachdep_ldis?.c for a given arc
Correct an misunderstanding of MDSRCS.MDSRCS it intended to allow assembly versions of funtions with Cimplementations listed in MISRCS. The selection of the correctmachdep_ldis?.c for a given architecture does not follow this patternand the file should be added to SRCS directly.Reviewed by: emaste, imp, jhbMFC after: 1 weekSponsored by: DARPA, AFRLDifferential Revision: https://reviews.freebsd.org/D9841
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
Reduce duplicate NOASM and PSEUDO definitionsThe initial value of NOASM is nearly the same in all cases and theinitial value of PSEUDO is the same in all cases so reduce duplication(and hopefully
Reduce duplicate NOASM and PSEUDO definitionsThe initial value of NOASM is nearly the same in all cases and theinitial value of PSEUDO is the same in all cases so reduce duplication(and hopefully, future merge conflicts) by machine independent defaults.Also document the PSEUDO variable.Reviewed by: jhb, kibObtained from: CheriBSDSponsored by: DARPA, AFRLDifferential Revision: https://reviews.freebsd.org/D7820
Rewrite ptrace(2) wrappers in C.Besides removing hand-translation to assembler, this also adds missingwrappers for arm64 and risc-v.Reviewed by: emaste, jhbSponsored by: The FreeBSD FoundationM
Rewrite ptrace(2) wrappers in C.Besides removing hand-translation to assembler, this also adds missingwrappers for arm64 and risc-v.Reviewed by: emaste, jhbSponsored by: The FreeBSD FoundationMFC after: 1 weekDifferential revision: https://reviews.freebsd.org/D7694
Remove unusedd and obsolete openbsd_poll system call. (Phase 1)Reported by: brooksReviewed by: brooks,jhbDifferential Revision: https://reviews.freebsd.org/D7548
Replace use of the pipe(2) system call with pipe2(2) with a zero flagsvalue.This eliminates the need for machine dependant assembly wrappers forpipe(2).It also make passing an invalid address t
Replace use of the pipe(2) system call with pipe2(2) with a zero flagsvalue.This eliminates the need for machine dependant assembly wrappers forpipe(2).It also make passing an invalid address to pipe(2) return EFAULT ratherthan triggering a segfault. Document this behavior (which was alreadytrue for pipe2(2), but undocumented).Reviewed by: andrewApproved by: re (gjb)Sponsored by: DARPA, AFRLDifferential Revision: https://reviews.freebsd.org/D6815
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.
12345