summaryrefslogtreecommitdiff
path: root/lib/libc/arm
Commit message (Collapse)AuthorAgeFilesLines
* arm/ffs.S: remove stale comment.Pedro F. Giffuni2019-12-281-3/+0
| | | | | | | | | We already use the CLZ instruction. Discussed with: andrew Notes: svn path=/head/; revision=356141
* Move all sources from the llvm project into contrib/llvm-project.Dimitry Andric2019-12-201-1/+1
| | | | | | | | | | | | | This uses the new layout of the upstream repository, which was recently migrated to GitHub, and converted into a "monorepo". That is, most of the earlier separate sub-projects with their own branches and tags were consolidated into one top-level directory, and are now branched and tagged together. Updating the vendor area to match this layout is next. Notes: svn path=/head/; revision=355940
* armv6 soft float build fixedWarner Losh2019-11-143-5/+5
| | | | | | | | | | | Add ifdefs in the assembler for soft-float compile case. Submitted by: Hiroki Mori Reviewed by: ray@ Differential Review: https://reviews.freebsd.org/D22352 Notes: svn path=/head/; revision=354700
* Add arm_sync_icache() and arm_drain_writebuf() sysarch syscall wrappers.Ian Lepore2019-07-136-0/+250
| | | | | | | | | | | | | | | | NetBSD and OpenBSD have libc wrapper functions for the ARM_SYNC_ICACHE and ARM_DRAIN_WRITEBUF sysarch operations. This change adds compatible functions to our library. This should make it easier for various upstream sources to support *BSD operating systems with a single variation of cache maintence code in tools like interpreters and JIT compilers. I consider the argument types passed to arm_sync_icache() to be especially unfortunate, but this is intended to match the other BSDs. Differential Revision: https://reviews.freebsd.org/D20906 Notes: svn path=/head/; revision=349972
* Reorganize the SRCS lists as one file per line, and then alphabetize them.Ian Lepore2019-07-101-6/+24
| | | | | | | No functional changes. Notes: svn path=/head/; revision=349891
* Fix initial exec TLS mode for dynamically loaded shared objects.Konstantin Belousov2019-03-291-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove MD __sys_* private symbols.Brooks Davis2018-12-051-3/+0
| | | | | | | | | | | | | No references to any of these exist in the tree. The list was also erratic with different architectures exporting different things (arm64 and riscv exported none). Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18425 Notes: svn path=/head/; revision=341509
* Revert r336773: it removed too much.Warner Losh2018-07-272-0/+1792
| | | | | | | | | | r336773 removed all things xscale. However, some things xscale are really armv5. Revert that entirely. A more modest removal will follow. Noticed by: andrew@ Notes: svn path=/head/; revision=336783
* Remove xscale supportWarner Losh2018-07-272-1792/+0
| | | | | | | | | | | | | The OLD XSCALE stuff hasn't been useful in a while. The original committer (cognet@) was the only one that had boards for it. He's blessed this removal. Newer XSCALE (GUMSTIX) is for hardware that's quite old. After discussion on arm@, it was clear there was no support for keeping it. Differential Review: https://reviews.freebsd.org/D16313 Notes: svn path=/head/; revision=336773
* Reimplement brk() and sbrk() to avoid the use of _end.Mark Johnston2018-06-044-180/+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
* Move softfloat symbol map entries to softfloat/Symbol.map.John Baldwin2018-03-051-18/+0
| | | | | | | | | | | | | The arm, mips, and riscv MD Symbol.map files listed some (but not all) of the softfloat symbols that were actually defined in softfloat.c. While here, also remove entries for __fixuns[sd]fsi which are provided by libcompiler_rt and not by libc. Sponsored by: DARPA / AFRL Notes: svn path=/head/; revision=330525
* libc: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2512-5/+29
| | | | | | | | | | | | | | | 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
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. 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. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* spdx: initial adoption of licensing ID tags.Pedro F. Giffuni2017-11-181-1/+3
| | | | | | | | | | | | | | | | | | | | 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. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Initially, only tag files that use BSD 4-Clause "Original" license. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133 Notes: svn path=/head/; revision=325966
* Save VFP state in getcontext(3) on ARM.Michal Meloun2017-10-162-1/+100
| | | | | | | | | | | This is a last followup of r315974, which fixes userland part of VFP save/restore problems described in PR 217611. PR: 217611 MFC after: 2 weeks Notes: svn path=/head/; revision=324660
* Support armv7 builds for userlandWarner Losh2017-10-053-5/+5
| | | | | | | | | | | | | | | | | | | Make armv7 as a new MACHINE_ARCH. Copy all the places we do armv6 and add armv7 as basically an alias. clang appears to generate code for armv7 by default. armv7 hard float isn't supported by the the in-tree gcc, so it hasn't been updated to have a new default. Support armv7 as a new valid MACHINE_ARCH (and by extension TARGET_ARCH). Add armv7 to the universe build. Differential Revision: https://reviews.freebsd.org/D12010 Notes: svn path=/head/; revision=324340
* Start to remove _libc_arm_fpu_present checks. We don't support the VFP onAndrew Turner2017-06-292-50/+10
| | | | | | | | | | | | | ARMv4 or ARMv5, and only support it when it's present on ARMv6 and later. As such always store the VFP register in setjmp and restore them in longjmp when building for armv6. Reviewed by: mmel Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D11393 Notes: svn path=/head/; revision=320470
* 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-4/+11
| | | | | | | | | | | | | | | | - 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
* Publish fp[get][set]sticky() for ARMv6.Michal Meloun2017-02-171-0/+5
| | | | | | | | | | | | Although fp[get][set]sticky() functions are obsolete, they are still required for GNU fortran49 library. MFC after: 2 months Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D9634 Notes: svn path=/head/; revision=313873
* Publish __aeabi_uidiv and __aeabi_idiv as compatible symbols from libc.Michal Meloun2017-02-173-1/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to bug[1] in libcompiler_rt, all symbols declared by DEFINE_AEABI_FUNCTION_ALIAS() are not hidden. All these but two are explicitly exported from libc and don't causes problems. Remaining two, __aeabi_uidiv and __aeabi_idiv, infecting all non-versioned shared libraries. And these symbols are consumed by many (if not all) packages[2]. As workaround, export these from libc as compatible symbols, in global namespace. With this, these are still visible for rtld, but static linker doesn't use then. [1] DEFINE_AEABI_FUNCTION_ALIAS() macro uses '.set' directive for declaration of aliased symbol. Unfortunately, '.set' doesn't inherit visibility of base symbol, and macro don't explicitly sets visibility for aliased one. [2] Given symbols are exported from non-versioned libraries only if library itself uses them. So, if world is built for CPU with HW divide, these function are not used and given symbols are not exported. By this, contents of these libraries is not stable, and all packages fails to run. Note: Due to r313823 I'm forced to commit this too early, without leave enough time for proper review. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D9632 Notes: svn path=/head/; revision=313866
* 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
* 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
* Make armv6 hard float abi by default. Kill armv6hf.Warner Losh2016-05-183-4/+5
| | | | | | | | | | Allow CPUTYPE=soft to build the current soft-float abi libraries. Add UPDATING entry to announce this. Approved by: re@ (gjb) Notes: svn path=/head/; revision=300119
* Revert a change that sneeked with 297619Andrew Turner2016-04-061-3/+1
| | | | Notes: svn path=/head/; revision=297620
* Disable support for compat syscalls on arm64. These symbols were neverAndrew Turner2016-04-061-1/+3
| | | | | | | | | | shipped since arm64 exists only on 11+. Submitted by: brooks Reviewed by: emaste, imp Notes: svn path=/head/; revision=297619
* libc: stop exporting cerrorEd Maste2016-03-301-1/+0
| | | | | | | | | | | | | i386 stopped exporting .cerror in r240152, and likewise for amd64 in r240178. It is not used by other libraries on any platform, so apply the same change to the remaining architectures. Reviewed by: jhibbits, jilles Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5774 Notes: svn path=/head/; revision=297418
* 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
* 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-2929-0/+55
| | | | | | | | | | the non-executable stack. Reviewed by: andrew Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=288373
* Add include for declaration of _set_tp(). Eliminates -Wmissing-prototypes ↵Craig Rodrigues2015-09-201-0/+1
| | | | | | | warnings. Notes: svn path=/head/; revision=288019
* Export the ARM __aeabi_mem* functions from libc, they are needed by the gccAndrew Turner2015-06-162-8/+17
| | | | | | | | | | from ports as it doesn't include these in the copy of libgcc it installs uses. Obtained from: ABT Systems Ltd Notes: svn path=/head/; revision=284451
* Add the needed if-then instructions to build as Thumb-2.Andrew Turner2015-05-316-0/+53
| | | | Notes: svn path=/head/; revision=283831
* Remove __ARM_EABI__ from more places in libc as this is the only ARM ABIAndrew Turner2015-05-313-19/+7
| | | | | | | we support. Notes: svn path=/head/; revision=283824
* Use a register to set the cpsr bits. The ip register is safe to be changedAndrew Turner2015-05-312-8/+12
| | | | | | | | | | | within all of these functions, and is only stored in some to correctly pad the stack. This will be needed to build as Thumb-2 as, unlike with ARM instructions, the msr instruction only takes a register as the input. Notes: svn path=/head/; revision=283807
* 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
* Teach bits of libc about Thumb. This adds the if-then instructions neededAndrew Turner2015-05-125-4/+48
| | | | | | | | | | | | to handle the ARM conditional execution. While here fix a bug found by this in the hard-float code, cc is the opposite of cs. The former is used for 'less than' in floating-point code and is executed when the C (carry) bit is clear, the latter is used when greater than, equal, or unordered, and is executed when the C bit is set. Notes: svn path=/head/; revision=282816
* 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
* Remove duplicate copies of trivial getcontextx.cEd Maste2015-01-122-78/+3
| | | | | | | | | | | | | Only i386 and amd64 provide a non-trivial __getcontextx(). Use a common trivial implementation in gen/ for other architectures, rather than copying the file to each MD subdirectory. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1472 Notes: svn path=/head/; revision=277078
* Apparently more Makefiles use stuff from compiler-rt, so fix them upDimitry Andric2015-01-081-1/+1
| | | | | | | too. (This did not show during a make universe, strangely.) Notes: svn path=/head/; revision=276853
* Switch to the ARM unified assembly language as the clang integrated as onlyAndrew Turner2014-11-297-123/+138
| | | | | | | | | | supports it. Binutils supports it when the ".syntax unified" directive is set. Sponsored by: ABT Systems Ltd Notes: svn path=/head/; revision=275256