aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/aarch64
Commit message (Collapse)AuthorAgeFilesLines
...
* Add an implementation of .mcount on arm64Andrew Turner2022-03-231-0/+1
| | | | | | | | | | | | | | | To support cc -pg on arm64 we need to implement .mcount. As clang and gcc think it is function like it just needs to load the arguments to _mcount and call it. On gcc the first argument is passed in x0, however this is missing on clang so we need to load it from the stack. As it's the caller return address this will be at a known location. PR: 262709 Reviewed by: emaste (earlier version) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34634
* libc: Remove _get_tp() and _set_tp().John Baldwin2021-12-094-91/+0
| | | | | | | | | Their uses have been replaced by _tcb_get() and _tcb_set() from <machine/tls.h>. Reviewed by: kib, jrtc27 Sponsored by: The University of Cambridge, Google Inc. Differential Revision: https://reviews.freebsd.org/D33354
* Switch to Arm Optimized Routines for mem* & str*Andrew Turner2021-11-195-15/+57
| | | | | | | | | | | These are the updated version of the older Cortex Strings Library we previously used. The Arm Optimized Routines also support CPU features that are currently in development on FreeBSD, e.g. Branch Target Identification (BTI). Rather than add BTI support to the old code it's easier to just use the maintained version. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32774
* Add sched_getcpu()Konstantin Belousov2021-11-101-1/+2
| | | | | | | | | for compatibility with Linux. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32901
* libc: add _get_tp() private functionKonstantin Belousov2021-04-092-0/+46
| | | | | | | | which returns pointer to tcb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D29623
* Fix initial exec TLS mode for dynamically loaded shared objects.Konstantin Belousov2019-03-291-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | If dso uses initial exec TLS mode, rtld tries to allocate TLS in static space. If there is no space left, the dlopen(3) fails. If space if allocated, initial content from PT_TLS segment is distributed to all threads' pcbs, which was missed and caused un-initialized TLS segment for such dso after dlopen(3). The mode is auto-detected either due to the relocation used, or if the DF_STATIC_TLS dynamic flag is set. In the later case, the TLS segment is tried to allocate earlier, which increases chance of the dlopen(3) to succeed. LLD was recently fixed to properly emit the flag, ld.bdf did it always. Initial test by: dumbbell Tested by: emaste (amd64), ian (arm) Tested by: Gerald Aryeetey <aryeeteygerald_rogers.com> (arm64) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D19072 Notes: svn path=/head/; revision=345703
* Don't export _end on arm64 and riscv.Mark Johnston2018-06-011-1/+0
| | | | | | | | | | These platforms don't support brk() and sbrk(), which are the reason for exporting _end in the first place. MFC after: 1 week Notes: svn path=/head/; revision=334505
* Remove architecture specific shmat.S files.Brooks Davis2018-04-052-36/+0
| | | | | | | | | | | | 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-36/+0
| | | | | | | | | | | | | 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
* Decrease relative branch brittleness.Jason Evans2017-06-201-2/+6
| | | | | | | | | Replace conditional branches with trampolines to unconditional branches when jumping to labels within other compilation units. This increases the offset range from +-1 MiB to +-128 MiB. Notes: svn path=/head/; revision=320136
* Do not use b.cs instruction to jump to cerror.Alexander Kabaev2017-04-071-2/+10
| | | | | | | | | | | | | The conditional jump can only be performed to targets up to 1MB in either direction and does not work too well when linker places cerror further that that from the caller. In that case linker will complain about relocation overflows. Reviewed by: emaste, andrew Differential Revision: https://reviews.freebsd.org/D10305 Notes: svn path=/head/; revision=316624
* Correct an misunderstanding of MDSRCS.Brooks Davis2017-03-021-1/+1
| | | | | | | | | | | | | | | MDSRCS it intended to allow assembly versions of funtions with C implementations listed in MISRCS. The selection of the correct machdep_ldis?.c for a given architecture does not follow this pattern and the file should be added to SRCS directly. Reviewed by: emaste, imp, jhb MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9841 Notes: svn path=/head/; revision=314557
* Correct MDSRCS use in <arch>/string/Makefile.inc.Brooks Davis2017-03-021-1/+2
| | | | | | | | | | | | | | | | - Remove .c files which duplicate entries in MISRCS. - Use the same, less merge conflict prone style in all cases. - Use MDSRCS for mips (.c and .S files both ended up in SRCS). - Remove pointless sparc64 Makefile.inc. - Remove uninformative foreign VCS ID entries. Reviewed by: emaste, imp, jhb MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9841 Notes: svn path=/head/; revision=314556
* Fix the comment showing the meaning of the first argument to sigprocmask.Andrew Turner2017-02-031-1/+1
| | | | | | | Sponsored by: ABT Systems Ltd Notes: svn path=/head/; revision=313146
* Fix the error value we write in cerror. __error returns an int *, howeverAndrew Turner2017-01-241-1/+1
| | | | | | | | | | | we were writing a 64 bit value meaning the 32 bits after this would be trashed. MFC after: 3 days Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=312703
* Replace dot-dot relative pathing with SRCTOP-relative paths where possibleEnji Cooper2017-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | This reduces build output, need for recalculating paths, and makes it clearer which paths are relative to what areas in the source tree. The change in performance over a locally mounted UFS filesystem was negligible in my testing, but this may more positively impact other filesystems like NFS. LIBC_SRCTOP was left alone so Juniper (and other users) can continue to manipulate lib/libc/Makefile (and other Makefile.inc's under lib/libc) as include Makefiles with custom options. Discussed with: marcel, sjg MFC after: 1 week Reviewed by: emaste Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D9207 Notes: svn path=/head/; revision=312451
* Attach the cortex strings library to the build. Only a subset of functionsAndrew Turner2016-09-191-0/+19
| | | | | | | | | | | have been added as some don't seem to be improvements over the libc C implementation. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=305974
* Reduce duplicate NOASM and PSEUDO definitionsBrooks Davis2016-09-081-10/+2
| | | | | | | | | | | | | | | | 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
* Remove commented out mention of ptrace.S.Konstantin Belousov2016-08-291-1/+0
| | | | | | | | | | After r305012 the asm wrapper is not needed. Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=305015
* Remove unusedd and obsolete openbsd_poll system call. (Phase 1)George V. Neville-Neil2016-08-181-1/+0
| | | | | | | | | 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-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-53/+0
| | | | | | | | | | | | | | | | | | | 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
* Remove brk and sbrk from arm64. They were defined in The Single UNIXAndrew Turner2016-05-204-155/+2
| | | | | | | | | | | | | | | | | | | | | | | | Specification, Version 2, but marked as legacy, and have been removed from later specifications. After 12 years it is time to remove them from new architectures when the main use for sbrk is an invalid method to attempt to find how much memory has been allocated from malloc. There are a few places in the tree that still call sbrk, however they are not used on arm64. They will need to be fixed to cross build from arm64, but these will be fixed in a follow up commit. Old copies of binutils from ports called into sbrk, however this has been fixed around 6 weeks ago. It is advised to update binutils on arm64 before installing a world that includes this change. Reviewed by: brooks, emaste Obtained from: brooks Relnotes: yes Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D6464 Notes: svn path=/head/; revision=300303
* arm64 libc: hide .cerror, .curbrk, .minbrk for WITHOUT_SYMVEREd Maste2016-04-143-0/+3
| | | | | | | | | | | | | When symver is in use these are hidden because they're not listed in the Symbol.map. Add an explicit .hidden so they are also hidden in the WITHOUT_SYMVER case. Reviewed by: andrew Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5775 Notes: svn path=/head/; revision=297973
* Disable support for compat syscalls on arm64. These symbols were neverAndrew Turner2016-04-062-0/+4
| | | | | | | | | | shipped since arm64 exists only on 11+. Submitted by: brooks Reviewed by: emaste, imp Notes: svn path=/head/; revision=297619
* libc: stop exporting curbrk and minbrk in the private namespaceEd Maste2016-03-241-2/+0
| | | | | | | | | | | | They are not used anywhere else in the base system and are an internal implementation detail that does not need to be exposed. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5728 Notes: svn path=/head/; revision=297238
* Add support for usermode (vdso-like) gettimeofday(2) andKonstantin Belousov2015-12-072-1/+75
| | | | | | | | | | | | | | | | | | | | | 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
* Add include for declaration of _set_tp(). Eliminates -Wmissing-prototypes ↵Craig Rodrigues2015-09-201-0/+1
| | | | | | | warnings. Notes: svn path=/head/; revision=288019
* Add the definitions of __infinity and __nan.Andrew Turner2015-08-203-0/+17
| | | | Notes: svn path=/head/; revision=286959
* Add support for makecontext. This supports up to 8 arguments as thisAndrew Turner2015-07-104-1/+129
| | | | | | | | | | simplifies the code, these can be passed in registers. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=285352
* Add hton and ntoh to the arm64 Symbols.map file, they exist but were notAndrew Turner2015-07-061-0/+4
| | | | | | | exported. Notes: svn path=/head/; revision=285201
* Cleanup brk and sbrk to use the same code to find curbrk and minbrk whenAndrew Turner2015-07-023-36/+13
| | | | | | | | | both compiling for PIC and non-PIC. Sponsored by: ABT Systems Ltd Notes: svn path=/head/; revision=285043
* Implement fpgetmask, it's needed by Python.Andrew Turner2015-06-253-0/+49
| | | | | | | | Approved by: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=284807
* Export __flt_rounds from the arm64 libc.soAndrew Turner2015-06-251-0/+1
| | | | Notes: svn path=/head/; revision=284806
* Implement fpsetmask. Some third-party software makes use of it, for exampleAndrew Turner2015-06-243-0/+54
| | | | | | | | | | perl. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=284769
* Set the alignment of the setjmp magic values correctly. The alignment needsAndrew Turner2015-06-243-3/+3
| | | | | | | | | | | to be before the lavel, otherwise an extra word may be added between the label and the data. Obtained from: ABT Systems Ltd Sponsored by: The FReeBSD Foundation Notes: svn path=/head/; revision=284768
* Set the correct register when calling sigprocmask in longjmp.Andrew Turner2015-06-061-1/+1
| | | | | | | | Submitted by: Patrick Wildt <patrick@bitrig.org> Obtained from: drahn@bitrig.org Notes: svn path=/head/; revision=284053
* Add fabs() to arm64 libcEd Maste2015-05-143-1/+36
| | | | | | | | Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2532 Notes: svn path=/head/; revision=282909
* Add the start of libc and libstand for arm64. Not all of the machineAndrew Turner2015-04-0721-0/+1012
| | | | | | | | | | | dependent functions have been implemented, but this is enough for world. Differential Revision: https://reviews.freebsd.org/D2132 Reviewed by: emaste Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=281197
* Start to import support for the AArch64 architecture from ARM. This changeAndrew Turner2015-03-191-0/+5
only adds support for kernel-toolchain, however it is expected further changes to add kernel and userland support will be committed as they are reviewed. As our copy of binutils is too old the devel/aarch64-binutils port needs to be installed to pull in a linker. To build either TARGET needs to be set to arm64, or TARGET_ARCH set to aarch64. The latter is set so uname -p will return aarch64 as existing third party software expects this. Differential Revision: https://reviews.freebsd.org/D2005 Relnotes: Yes Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=280259