summaryrefslogtreecommitdiff
path: root/lib/libc/arm/sys
Commit message (Collapse)AuthorAgeFilesLines
* Reimplement brk() and sbrk() to avoid the use of _end.Mark Johnston2018-06-043-179/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Previously, libc.so would initialize its notion of the break address using _end, a special symbol emitted by the static linker following the bss section. Compatibility issues between lld and ld.bfd could cause the wrong definition of _end (libc.so's definition rather than that of the executable) to be used, breaking the brk()/sbrk() interface. Avoid this problem and future interoperability issues by simply not relying on _end. Instead, modify the break() system call to return the kernel's view of the current break address, and have libc initialize its state using an extra syscall upon the first use of the interface. As a side effect, this appears to fix brk()/sbrk() usage in executables run with rtld direct exec, since the kernel and libc.so no longer maintain separate views of the process' break address. PR: 228574 Reviewed by: kib (previous version) MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D15663 Notes: svn path=/head/; revision=334626
* Remove architecture specific shmat.S files.Brooks Davis2018-04-052-10/+1
| | | | | | | | | | | | 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 <ali@mashtizadeh.com> Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D14976 Notes: svn path=/head/; revision=332080
* Remove architecture specific sigreturn.S files.Brooks Davis2018-04-042-45/+1
| | | | | | | | | | | | | All of these files are identical (modulo license blocks and VCS IDs) to the files generated by lib/libc/sys/Makefile.inc and serve no purpose. Reported by: Ali Mashtizadeh <ali@mashtizadeh.com> Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14953 Notes: svn path=/head/; revision=332048
* libc: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-251-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326193
* Reduce duplicate NOASM and PSEUDO definitionsBrooks Davis2016-09-081-3/+1
| | | | | | | | | | | | | | | | The initial value of NOASM is nearly the same in all cases and the initial 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, kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D7820 Notes: svn path=/head/; revision=305630
* Rewrite ptrace(2) wrappers in C.Konstantin Belousov2016-08-292-52/+1
| | | | | | | | | | | | | Besides removing hand-translation to assembler, this also adds missing wrappers for arm64 and risc-v. Reviewed by: emaste, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D7694 Notes: svn path=/head/; revision=305012
* Remove unusedd and obsolete openbsd_poll system call. (Phase 1)George V. Neville-Neil2016-08-181-1/+1
| | | | | | | | | Reported by: brooks Reviewed by: brooks,jhb Differential Revision: https://reviews.freebsd.org/D7548 Notes: svn path=/head/; revision=304395
* Implement userspace gettimeofday(2) with HPET timecounter.Konstantin Belousov2016-08-171-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now, userspace (fast) gettimeofday(2) on x86 only works for RDTSC. For older machines, like Core2, where RDTSC is not C2/C3 invariant, and which fall to HPET hardware, this means that the call has both the penalty of the syscall and of the uncached hw behind the QPI or PCIe connection to the sought bridge. Nothing can me done against the access latency, but the syscall overhead can be removed. System already provides mappable /dev/hpetX devices, which gives straight access to the HPET registers page. Add yet another algorithm to the x86 'vdso' timehands. Libc is updated to handle both RDTSC and HPET. For HPET, the index of the hpet device to mmap is passed from kernel to userspace, index might be changed and libc invalidates its mapping as needed. Remove cpu_fill_vdso_timehands() KPI, instead require that timecounters which can be used from userspace, to provide tc_fill_vdso_timehands{,32}() methods. Merge i386 and amd64 libc/<arch>/sys/__vdso_gettc.c into one source file in the new libc/x86/sys location. __vdso_gettc() internal interface is changed to move timecounter algorithm detection into the MD code. Measurements show that RDTSC even with the syscall overhead is faster than userspace HPET access. But still, userspace HPET is three-four times faster than syscall HPET on several Core2 and SandyBridge machines. Tested by: Howard Su <howard0su@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D7473 Notes: svn path=/head/; revision=304285
* Replace use of the pipe(2) system call with pipe2(2) with a zero flagsBrooks Davis2016-06-222-54/+1
| | | | | | | | | | | | | | | | | | | value. This eliminates the need for machine dependant assembly wrappers for pipe(2). It also make passing an invalid address to pipe(2) return EFAULT rather than triggering a segfault. Document this behavior (which was already true for pipe2(2), but undocumented). Reviewed by: andrew Approved by: re (gjb) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D6815 Notes: svn path=/head/; revision=302092
* Do not compile ARMv6 instructions on ARMv4/v5. Although clang is fineKonstantin Belousov2015-12-241-0/+7
| | | | | | | | | | | with mrrc, gcc is not. The disabled code is not executed on ARMv4 anyway. Reported and reviewed by: ian Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=292709
* Add support for usermode (vdso-like) gettimeofday(2) andKonstantin Belousov2015-12-072-1/+80
| | | | | | | | | | | | | | | | | | | | | clock_gettime(2) on ARMv7 and ARMv8 systems which have architectural generic timer hardware. It is similar how the RDTSC timer is used in userspace on x86. Fix a permission problem where generic timer access from EL0 (or userspace on v7) was not properly initialized on APs. For ARMv7, mark the stack non-executable. The shared page is added for all arms (including ARMv8 64bit), and the signal trampoline code is moved to the page. Reviewed by: andrew Discussed with: emaste, mmel Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D4209 Notes: svn path=/head/; revision=291937
* Annotate arm userspace assembler sources stating their tolerance toKonstantin Belousov2015-09-299-0/+18
| | | | | | | | | | the non-executable stack. Reviewed by: andrew Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=288373
* Removed unused special fork() implementations.Brooks Davis2015-05-291-49/+0
| | | | | | | | | | | | | | The arm version hasn't been used in ages. The mips version uses a valid, but pointless check of v1 and has been unhooked from the build since r276630. Differential Revision: https://reviews.freebsd.org/D2592 Reviewed by: emaste Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=283751
* Use the GOT_* macros to help simplify the code, these work with both picAndrew Turner2015-05-112-26/+9
| | | | | | | and non-pic code, and to build for Thumb. Notes: svn path=/head/; revision=282782
* The lseek(2), mmap(2), truncate(2), ftruncate(2), pread(2), andKonstantin Belousov2015-04-181-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | pwrite(2) syscalls are wrapped to provide compatibility with pre-7.x kernels which required padding before the off_t parameter. The fcntl(2) contains compatibility code to handle kernels before the struct flock was changed during the 8.x CURRENT development. The shims were reasonable to allow easier revert to the older kernel at that time. Now, two or three major releases later, shims do not serve any purpose. Such old kernels cannot handle current libc, so revert the compatibility code. Make padded syscalls support conditional under the COMPAT6 config option. 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: peter Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=281714
* libc: Eliminate duplicate copies of __vdso_gettc.cEd Maste2015-04-022-49/+1
| | | | | | | | Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2152 Notes: svn path=/head/; revision=281004
* In ARM asm code, ensure that every ENTRY(foo) has a matching END(foo).Ian Lepore2014-08-316-0/+6
| | | | | | | | | | | | The EABI unwind info requires a .fnend for every .fnstart, and newer binutils will complain about seeing two .fnstart in a row. This change allows newer tools to compile our code. Reported by: bapt Reviewed by: imp Notes: svn path=/head/; revision=270882
* Convert from WITHOUT_SYSCALL_COMPAT to MK_SYSCALL_COMPAT.Warner Losh2014-04-051-1/+1
| | | | Notes: svn path=/head/; revision=264155
* Rework the __vdso_* symbols attributes to only make the symbols weak,Konstantin Belousov2013-01-302-0/+50
| | | | | | | | | | | | | but use normal references instead of weak. This makes the statically linked binaries to use fast gettimeofday(2) by forcing the linker to resolve references and providing the neccessary functions. Reported by: bde Tested by: marius (sparc64) MFC after: 2 weeks Notes: svn path=/head/; revision=246117
* These warnings are only relevant on NetBSD it seems. They don't seemWarner Losh2009-02-191-3/+0
| | | | | | | to be relevant to FreeBSD at all. Notes: svn path=/head/; revision=188827
* Mark uname(), getdomainname() and setdomainname() with COMPAT_FREEBSD4.Ed Schouten2008-11-091-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | Looking at our source code history, it seems the uname(), getdomainname() and setdomainname() system calls got deprecated somewhere after FreeBSD 1.1, but they have never been phased out properly. Because we don't have a COMPAT_FREEBSD1, just use COMPAT_FREEBSD4. Also fix the Linuxolator to build without the setdomainname() routine by just making it call userland_sysctl on kern.domainname. Also replace the setdomainname()'s implementation to use this approach, because we're duplicating code with sysctl_domainname(). I wasn't able to keep these three routines working in our COMPAT_FREEBSD32, because that would require yet another keyword for syscalls.master (COMPAT4+NOPROTO). Because this routine is probably unused already, this won't be a problem in practice. If it turns out to be a problem, we'll just restore this functionality. Reviewed by: rdivacky, kib Notes: svn path=/head/; revision=184789
* Classify mmap, lseek, pread, pwrite, truncate, ftruncate as pseudoPeter Wemm2007-07-041-3/+6
| | | | | | | | | | | | | syscalls, unless WITHOUT_SYSCALL_COMPAT is defined. The default case will 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) Notes: svn path=/head/; revision=171218
* Fix sbrk.S to use _end symbol the same way brk.s was fixed some timeAlexander Kabaev2007-06-271-2/+2
| | | | | | | | | | ago. sbrk.S should have gotten the same change then but was forgotten. Approved by: re (bmah) PR: kern/114049 Notes: svn path=/head/; revision=171061
* Use built-in _end symbol insteadof 'end' for consistency with otherAlexander Kabaev2007-05-191-2/+2
| | | | | | | architectures. Linker defines end is synonym for _end. Notes: svn path=/head/; revision=169722
* Cleanup: we always have to use __error() now, and we shouldn't provide aOlivier Houchard2006-11-092-58/+1
| | | | | | | | | errno symbol, so completely remove the !_REENTRANT case. Spotted out by: ru Notes: svn path=/head/; revision=164109
* Use the RET macro.Olivier Houchard2004-11-096-6/+7
| | | | | | | | For setjmp() and longjmp(), put the signal mask where it's supposed to be, instead of in the space reserved for fp regs. Notes: svn path=/head/; revision=137464
* Remove getcontext.S, it is not needed.Olivier Houchard2004-11-052-64/+1
| | | | Notes: svn path=/head/; revision=137285
* Import the FreeBSD/arm libc bits.Olivier Houchard2004-05-1412-0/+655
Obtained from: NetBSD Notes: svn path=/head/; revision=129202