Add sched_getcpu()(cherry picked from commit 77b2c2f81451db8119e4ea6398fe76813db790de)
libc/<arch>/sys/cerror.S: fix typo(cherry picked from commit 4c2e9c35fb1958544040493e4fd8d8b8a0927677)
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
show more ...
[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
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
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
The lseek(2), mmap(2), truncate(2), ftruncate(2), pread(2), andpwrite(2) syscalls are wrapped to provide compatibility with pre-7.xkernels which required padding before the off_t parameter. Thefc
The lseek(2), mmap(2), truncate(2), ftruncate(2), pread(2), andpwrite(2) syscalls are wrapped to provide compatibility with pre-7.xkernels which required padding before the off_t parameter. Thefcntl(2) contains compatibility code to handle kernels before thestruct flock was changed during the 8.x CURRENT development. Theshims were reasonable to allow easier revert to the older kernel atthat time.Now, two or three major releases later, shims do not serve anypurpose. Such old kernels cannot handle current libc, so revert thecompatibility code.Make padded syscalls support conditional under the COMPAT6 configoption. For COMPAT32, the syscalls were under COMPAT6 already.Remove WITHOUT_SYSCALL_COMPAT build option, which only purpose was to(partially) disable the removed shims.Reviewed by: jhb, imp (previous versions)Discussed with: peterSponsored by: The FreeBSD FoundationMFC after: 1 week
libc: Eliminate duplicate copies of __vdso_gettc.cSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D2152
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
Convert from WITHOUT_SYSCALL_COMPAT to MK_SYSCALL_COMPAT.
Rework the __vdso_* symbols attributes to only make the symbols weak,but use normal references instead of weak. This makes the staticallylinked binaries to use fast gettimeofday(2) by forcing the
Rework the __vdso_* symbols attributes to only make the symbols weak,but use normal references instead of weak. This makes the staticallylinked binaries to use fast gettimeofday(2) by forcing the linker toresolve references and providing the neccessary functions.Reported by: bdeTested by: marius (sparc64)MFC after: 2 weeks
This commit adds profiling support for powerpc64. Now we can do applicationprofiling and kernel profiling. To enable kernel profiling one has to buildkgmon(8). I will enable the build once I manage
This commit adds profiling support for powerpc64. Now we can do applicationprofiling and kernel profiling. To enable kernel profiling one has to buildkgmon(8). I will enable the build once I managed to build and test powerpc(32-bit) kernels with profiling support.- add a powerpc64 PROF_PROLOGUE for _mcount.- add macros to avoid adding the PROF_PROLOGUE in certain assembly entries.- apply these macros where needed.- add size information to the MCOUNT function.MFC after: 3 weeks, together with r230291
Turn off default generation of userland dot symbols on powerpc64 now thatwe have a binutils that supports it. Kernel dot symbols remain on to assistDDB.
Mark assembler sources from libc as working with non-executable stack.Reviewed and tested by: nwhitehorn
Fix stack alignment (required to be to 16 bytes) instead of ptrace andcerror on powerpc64.
Make sure to specify the alignment of minbrk and curbrk. They were correctlyaligned by accident with earlier binutils, but no longer are, causing linkfailures.Submitted by: nwhitehornObtained fr
Make sure to specify the alignment of minbrk and curbrk. They were correctlyaligned by accident with earlier binutils, but no longer are, causing linkfailures.Submitted by: nwhitehornObtained from: projects/binutils-2.17
Provide 64-bit PowerPC support in libc.Obtained from: projects/ppc64