Add sched_getcpu()(cherry picked from commit 77b2c2f81451db8119e4ea6398fe76813db790de)
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
show more ...
Remove architecture specific shmat.S files.These files are identical to the generated system calls.In the case of MIPS, the file was already disconnected from the build.Submitted by: Ali Mashtiz
Remove architecture specific shmat.S files.These files are identical to the generated system calls.In the case of MIPS, the file was already disconnected from the build.Submitted by: Ali Mashtizadeh <[email protected]>Reviewed by: kibDifferential Revision: https://reviews.freebsd.org/D14976
Remove architecture specific sigreturn.S files.All of these files are identical (modulo license blocks and VCS IDs) tothe files generated by lib/libc/sys/Makefile.inc and serve no purpose.Report
Remove architecture specific sigreturn.S files.All of these files are identical (modulo license blocks and VCS IDs) tothe files generated by lib/libc/sys/Makefile.inc and serve no purpose.Reported by: Ali Mashtizadeh <[email protected]>Reviewed by: kibSponsored by: DARPA, AFRLDifferential Revision: https://reviews.freebsd.org/D14953
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.
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
Implement userspace gettimeofday(2) with HPET timecounter.Right now, userspace (fast) gettimeofday(2) on x86 only works forRDTSC. For older machines, like Core2, where RDTSC is not C2/C3invarian
Implement userspace gettimeofday(2) with HPET timecounter.Right now, userspace (fast) gettimeofday(2) on x86 only works forRDTSC. For older machines, like Core2, where RDTSC is not C2/C3invariant, and which fall to HPET hardware, this means that the callhas both the penalty of the syscall and of the uncached hw behind theQPI or PCIe connection to the sought bridge. Nothing can me doneagainst the access latency, but the syscall overhead can be removed.System already provides mappable /dev/hpetX devices, which givesstraight access to the HPET registers page.Add yet another algorithm to the x86 'vdso' timehands. Libc is updatedto handle both RDTSC and HPET. For HPET, the index of the hpet deviceto mmap is passed from kernel to userspace, index might be changed andlibc invalidates its mapping as needed.Remove cpu_fill_vdso_timehands() KPI, instead require thattimecounters which can be used from userspace, to providetc_fill_vdso_timehands{,32}() methods. Merge i386 and amd64libc/<arch>/sys/__vdso_gettc.c into one source file in the newlibc/x86/sys location. __vdso_gettc() internal interface is changedto move timecounter algorithm detection into the MD code.Measurements show that RDTSC even with the syscall overhead is fasterthan userspace HPET access. But still, userspace HPET is three-fourtimes faster than syscall HPET on several Core2 and SandyBridgemachines.Tested by: Howard Su <[email protected]>Sponsored by: The FreeBSD FoundationMFC after: 1 monthDifferential revision: https://reviews.freebsd.org/D7473
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
Do not compile ARMv6 instructions on ARMv4/v5. Although clang is finewith mrrc, gcc is not. The disabled code is not executed on ARMv4anyway.Reported and reviewed by: ianSponsored by: The Free
Do not compile ARMv6 instructions on ARMv4/v5. Although clang is finewith mrrc, gcc is not. The disabled code is not executed on ARMv4anyway.Reported and reviewed by: ianSponsored by: The FreeBSD Foundation
Add support for usermode (vdso-like) gettimeofday(2) andclock_gettime(2) on ARMv7 and ARMv8 systems which have architecturalgeneric timer hardware. It is similar how the RDTSC timer is used inuser
Add support for usermode (vdso-like) gettimeofday(2) andclock_gettime(2) on ARMv7 and ARMv8 systems which have architecturalgeneric timer hardware. It is similar how the RDTSC timer is used inuserspace on x86.Fix a permission problem where generic timer access from EL0 (oruserspace on v7) was not properly initialized on APs.For ARMv7, mark the stack non-executable. The shared page is added forall arms (including ARMv8 64bit), and the signal trampoline code ismoved to the page.Reviewed by: andrewDiscussed with: emaste, mmelSponsored by: The FreeBSD FoundationDifferential revision: https://reviews.freebsd.org/D4209
Annotate arm userspace assembler sources stating their tolerance tothe non-executable stack.Reviewed by: andrewSponsored by: The FreeBSD Foundation
Removed unused special fork() implementations.The arm version hasn't been used in ages.The mips version uses a valid, but pointless check of v1 and has beenunhooked from the build since r276630.
Removed unused special fork() implementations.The arm version hasn't been used in ages.The mips version uses a valid, but pointless check of v1 and has beenunhooked from the build since r276630.Differential Revision: https://reviews.freebsd.org/D2592Reviewed by: emasteSponsored by: DARPA, AFRL
Use the GOT_* macros to help simplify the code, these work with both picand non-pic code, and to build for Thumb.
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
In ARM asm code, ensure that every ENTRY(foo) has a matching END(foo).The EABI unwind info requires a .fnend for every .fnstart, and newerbinutils will complain about seeing two .fnstart in a row.
In ARM asm code, ensure that every ENTRY(foo) has a matching END(foo).The EABI unwind info requires a .fnend for every .fnstart, and newerbinutils will complain about seeing two .fnstart in a row. This changeallows newer tools to compile our code.Reported by: baptReviewed by: imp
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
These warnings are only relevant on NetBSD it seems. They don't seemto be relevant to FreeBSD at all.
Mark uname(), getdomainname() and setdomainname() with COMPAT_FREEBSD4.Looking at our source code history, it seems the uname(),getdomainname() and setdomainname() system calls got deprecatedsome
Mark uname(), getdomainname() and setdomainname() with COMPAT_FREEBSD4.Looking at our source code history, it seems the uname(),getdomainname() and setdomainname() system calls got deprecatedsomewhere after FreeBSD 1.1, but they have never been phased outproperly. Because we don't have a COMPAT_FREEBSD1, just useCOMPAT_FREEBSD4.Also fix the Linuxolator to build without the setdomainname() routine byjust making it call userland_sysctl on kern.domainname. Also replace thesetdomainname()'s implementation to use this approach, because we'reduplicating code with sysctl_domainname().I wasn't able to keep these three routines working in ourCOMPAT_FREEBSD32, because that would require yet another keyword forsyscalls.master (COMPAT4+NOPROTO). Because this routine is probablyunused already, this won't be a problem in practice. If it turns out tobe a problem, we'll just restore this functionality.Reviewed by: rdivacky, kib
Classify mmap, lseek, pread, pwrite, truncate, ftruncate as pseudosyscalls, unless WITHOUT_SYSCALL_COMPAT is defined. The default casewill have the .c wrappers still. If you define WITHOUT_SYSCAL
Classify mmap, lseek, pread, pwrite, truncate, ftruncate as pseudosyscalls, unless WITHOUT_SYSCALL_COMPAT is defined. The default casewill have the .c wrappers still. If you define WITHOUT_SYSCALL_COMPAT,the .c wrappers will go away and libc will make direct syscalls.After 7-stable starts, the direct syscall method will be default.Approved by: re (kensmith)
Fix sbrk.S to use _end symbol the same way brk.s was fixed some timeago. sbrk.S should have gotten the same change then but was forgotten.Approved by: re (bmah)PR: kern/114049
Use built-in _end symbol insteadof 'end' for consistency with otherarchitectures. Linker defines end is synonym for _end.
12