summaryrefslogtreecommitdiffstats
path: root/lib/libc/arm
Commit message (Collapse)AuthorAgeFilesLines
* Clean up our ARM assembly:andrew2014-12-147-123/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC 275256: Switch to the ARM unified assembly language as the clang integrated as only supports it. Binutils supports it when the ".syntax unified" directive is set. Sponsored by: ABT Systems Ltd MFC 275264: Update _ENTRY to use _EENTRY to reduce the common code. MFC 275321: Remove extra labels, ENTRY_NP already provides them. Sponsored by: ABT Systems Ltd MFC 275322: Correctly a few incorrect uses of ENTRY/EENTRY and END/EEND Sponsored by: ABT Systems Ltd MFC 275416: Fix the name of the coprocessor to include the "p" prefix, the clang integrated assembler expects this. Sponsored by: ABT Systems Ltd MFC 275418: Switch to unified syntax so these can be built with clang 3.5. Sponsored by: ABT Systems Ltd MFC 275519: Add missing END macros to some of the xscale functions. Sponsored by: ABT Systems Ltd MFC 275520: Use the unified syntax in a few more assembly files Sponsored by: ABT Systems Ltd MFC 275521: Set the alignment to 4-bytes after a string as clang 3.5 can switch to thumb mode if this is incorrect. Sponsored by: ABT Systems Ltd MFC 275522: Place the literal pool after a RET otherwise clang 3.5 tries to put it too far away from a ldr psuedo instruction. With this clang will place the literal value here where it's close enough to be loaded. Sponsored by: ABT Systems Ltd MFC 275523: Switch to an armv6k cpu, without this clang 3.5 complains "bx lr" is unsupported as it needs a newer cpu. Sponsored by: ABT Systems Ltd MFC 275524: Switch to a .cpu directive. These will work when clang 3.5 is imported where the .arch directive is a nop. Sponsored by: ABT Systems Ltd
* MFC r269956:andrew2014-10-291-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | From https://sourceware.org/ml/newlib/2014/msg00113.html By Richard Earnshaw at ARM > >GCC has for a number of years provides a set of pre-defined macros for >use with determining the ISA and features of the target during >pre-processing. However, the design was always somewhat cumbersome in >that each new architecture revision created a new define and then >removed the previous one. This meant that it was necessary to keep >updating the support code simply to recognise a new architecture being >added. > >The ACLE specification (ARM C Language Extentions) >(http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.set.swdev/index.html) >provides a much more suitable interface and GCC has supported this >since gcc-4.8. > >This patch makes use of the ACLE pre-defines to map to the internal >feature definitions. To support older versions of GCC a compatibility >header is provided that maps the traditional pre-defines onto the new >ACLE ones. Stop using __FreeBSD_ARCH_armv6__ and switch to __ARM_ARCH >= 6 in the couple of places in tree. clang already implements ACLE. Add a define that says we implement version 1.1, even though the implementation isn't quite complete.
* MFC r273088:andrew2014-10-228-1/+337
| | | | | | Add support for the __aeabi_c*cmp* functions. These are similar to the existing functions with the exception they use the condition flags to store the result.
* MFC r270882, r270930:ian2014-09-0922-1/+36
| | | | | | | | | | | | | 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 newer binutils will complain about seeing two .fnstart in a row. This change allows newer tools to compile our code. Do not generate unwind info in asm functions if _STANDALONE is defined. The .fnend op causes the assembler to emit RELOC references to unwind support functions that don't exist in libstand. Approved by: re(gjb)
* MFC r268993, r268893, r268994, plus partial r264070, r264082ian2014-08-103-1/+111
| | | | | | | | Fix C++ exception handling for ARM EABI. Just the part of r264070 that creates the FBSD_1.4 namespace in libc is hand-applied, and then r264082 which creates the Versions.def entry is MFC'd.
* MFC 265059: Set the new floating point exception mask correctly.ian2014-05-171-1/+1
|
* MFC 264696, 264721,ian2014-05-177-0/+304
| | | | | | | Add the deprecated fp{get,set}* functions, a few ports use them. Rename the fp{get,set}* files so they no longer conflict with the softfloat version of these files.
* MFC 263631, 263637, 263664, 263676, 263679, 263698, 263711,ian2014-05-171-10/+14
| | | | | | | | | | | | | | | | | | Implement __flt_rounds for ARMv6 hard-float. The fpscr register stores the current rounding mode used by the VFP unit. Simplify how we build MACHINE_ARCH. There are 3 options that may be set however only arm, armeb, armv6, and soon armv6hf will be used. Add the llvm/clang patch for r263619. Reorder the pmap macros so "ARM_MMU_V6 + ARM_MMU_V7" is first. As they are identical this allows us to build for both v6 and v7 together. Add code for enabling second CPU core for A20 SoC. Enable SMP on Cubieboard2. Switch to freebsd.org emal address in copyright.
* MFC 262989, 263210, 263230, 263231, 263239, 263242, 263243,ian2014-05-177-124/+539
| | | | | | | | | | | | | | | | | Export _libc_arm_fpu_present as a private symbol to be used by other system libraries, for example libm. On armv6 access both the softfloat and, when available, the vfp to get and set the floating-point environment. Build fenv-vfp.c with the softfp float abi. Without this gcc generates an incorrect assembly file that doesn't allow for vfp instructions. Only build the vfp/softfp switching code on armv6 as we don't support vfp on anything earlier than this. This should fix the armeb and arm builds when using gcc. Add an optimised version of the float and double helper functions.
* On ARM EABI double precision floating point values are stored in theandrew2013-09-073-3/+3
| | | | | | endian the CPU is in, i.e. little-endian on most ARM cores. This allows ARMv4 and ARMv5 boards to boot with the ARM EABI.
* Teach siglongjmp about the VFP version of the setjmp buffer.andrew2013-07-211-3/+5
| | | | | This fixes a bug where a call to sigsetjmp followed by siglongjmp may fail when run on a machine with VFP enabled.
* Finish pulling in the NetBSD setjmp/longjmp updates on ARM.andrew2013-06-074-4/+162
| | | | | | | | Store/restore the VFP registers in setjmp/longjmp on ARM EABI if VFP is enabled in the kernel. It checks the hw.floatingpoint sysctl to see if floating-point is available and uses this to determine if it should store them. If it does it uses a different magic value so longjmp is able to know if it should load them.
* Include machine/setjmp.h to get the definition of _JB_MAGIC__SETJMP. Thisandrew2013-06-071-1/+3
| | | | allows us to remove it from the ARM copy of machine/asm.h.
* Remove part of the NetBSD longjmp code that was not ready to be merged.andrew2013-06-051-2/+1
|
* Start to merge the updated ARM NetBSD setjump/longjmp functions. To beginandrew2013-06-042-75/+52
| | | | | | | | | | with merge the functions but leave out the code to save/load the VFP registers as that requires other changes to ensure the VFP is enabled first. This removes storing the old fpa registers. These were never fully supported, and the only user of this code I can find have moved to newer CPUs which use a VFP.
* The getcontext() from the __fillcontextx() call in thekib2013-05-281-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | check_deferred_signal() returns twice, since handle_signal() emulates the return from the normal signal handler by sigreturn(2)ing the passed context. Second return is performed on the destroyed stack frame, because __fillcontextx() has already returned. This causes undefined and bad behaviour, usually the victim thread gets SIGSEGV. Avoid nested frame and the need to return from it by doing direct call to getcontext() in the check_deferred_signal() and using a new private libc helper __fillcontextx2() to complement the context with the extended CPU state if the deferred signal is still present. The __fillcontextx() is now unused, but is kept to allow older libthr.so to be used with the new libc. Mark __fillcontextx() as returning twice [1]. Reported by: pgj Pointy hat to: kib Discussed with: dim Tested by: pgj, dim Suggested by: jilles [1] MFC after: 1 week
* When clang builds libc it may insert calls to __aeabi_* functions. Normallyandrew2013-02-121-0/+19
| | | | | | | | | | this is not a problem as they are resolved by libgcc. The exception is for the __aeabi_mem* functions. These call back into libc to the appropriate function. This causes issues for static binaries as we only link against libc once so there is no way for it to call into libgcc and back. The fix for this is to include these symbols in libc but keep them hidden so binaries use the libgcc version.
* Rework the __vdso_* symbols attributes to only make the symbols weak,kib2013-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
* Add the required __aeabi_* functions to libc.andrew2013-01-197-0/+361
| | | | | The floating point functions are here rather than compiler-rt because the libc softfloat code allows us to set the rounding mode.
* Use the compiler-rt version __{u,}divsi3 and __{u,}modsi3 on ARM EABIandrew2013-01-194-5/+27
|
* Update the syscall calling convention for ARM EABI. We store the syscallandrew2013-01-191-0/+8
| | | | | | in r7 and use ip to store the old version of r7 as it is not guaranteed to be kept when calling a subroutine. The kernel will preserve the register across system calls.
* Silence a clang warning by telling it we are only interested in leftandrew2013-01-061-1/+1
| | | | shifting the lower 32bits of the floating point value when we demangle it.
* Merging of projects/armv6, part 2gonzo2012-08-152-0/+10
| | | | Handle TLS for ARMv6 and ARMv7
* Per kib, since __flt_rounds is being added to FreeBSD 10, itkientzle2012-06-151-0/+3
| | | | | | belongs in FBSD_1.3. MFC after: 1 week
* __flt_rounds is a public symbol (expands from the FLT_ROUNDS macro),kientzle2012-06-141-1/+1
| | | | | | | | | | so include it in the public namespace on arm just as with other architectures. This corrects r236816. Submitted by: Jan Sieka MFC after: 1 week
* __flt_rounds was omitted from the exported symbols here.kientzle2012-06-091-0/+1
| | | | | | Submitted by: Jan Sieka Reviewed by: arm@ MFC after: 1 week
* Replace the C implementation of __aeabi_read_tp with an assembly version.andrew2012-04-162-14/+9
| | | | | | This ensures we follow the ABI by preserving registers r1-r3. Reviewed by: jmallett, imp
* Unlike other functions __aeabi_read_tp function must preserve r1-r3. Theandrew2012-04-081-2/+5
| | | | | | | currently generated code clobbers r3. Fix this by loading ARM_TP_ADDRESS using inline assembly. Approved by: imp (mentor)
* - Revert part of r234005, which I did not intend to commit.stas2012-04-071-1/+1
| | | | Sorry! :(
* - Add kernel config file for QEMU-emulated gumstix board.stas2012-04-071-1/+1
|
* Unbreak trhe build by including proper headergonzo2012-03-181-1/+1
|
* Fix TLS for statically linked binariesgonzo2012-03-181-0/+4
| | | | Approved by: cognet
* Add __aeabi_read_tp to the symbol list.cognet2012-03-041-0/+1
|
* Add __aeabi_read_tp function required for thread-local storagegonzo2012-02-142-1/+43
| | | | Reviewed by: cognet
* Make the sys/ucontext.h self-contained by changing the return typekib2012-02-011-1/+1
| | | | | | | of __getcontextx_size(3) from size_t to int. PR: ports/164654 MFC after: 1 month
* Add API for obtaining extended machine context states that cannot bekib2012-01-212-1/+70
| | | | | | | | | | | fit into existing mcontext_t. On i386 and amd64 do return the extended FPU states using getcontextx(3). For other architectures, getcontextx(3) returns the same information as getcontext(2). Tested by: pho MFC after: 1 month
* Don't inline fenv.h functions on arm for now. Inlining makes sense:das2012-01-201-0/+2
| | | | | | | | the function bodies require only 2 to 10 instructions. However, it leads to application binaries that refer to a private ABI, namely, the softfloat innards in libc. This could complicate future changes in the implementation of the floating-point emulation layer, so it seems best to have programs refer to the official fe* entry points in libm.
* Implement FLT_ROUNDS for arm. Some (all?) arm FPUs lack support fordas2012-01-162-1/+64
| | | | | | | | dynamic rounding modes, but FPUless chips that use softfloat can support it because everything is emulated anyway. (We presently have incomplete support for hardware FPUs.) Submitted by: Ian Lepore
* Convert softfloat to use the standard exception flag and rounding macrosdas2012-01-161-14/+14
| | | | | | in fenv.h instead of the non-standard and incomplete ones in ieeefp.h. Thanks to Ian Lepore for testing this patch.
* Correct some bugs that resulted from arm/_fpmath.h being blindly copieddas2012-01-161-1/+2
| | | | | | | from the x86 version, which has a completely different long double format. Submitted by: Maks Verver
* Merge index() and strchr() together.ed2012-01-031-4/+3
| | | | | | | | | | | | | | | | | As I looked through the C library, I noticed the FreeBSD MIPS port has a hand-written version of index(). This is nice, if it weren't for the fact that most applications call strchr() instead. Also, on the other architectures index() and strchr() are identical, meaning we have two identical pieces of code in the C library and statically linked applications. Solve this by naming the actual file strchr.[cS] and let it use __strong_reference()/STRONG_ALIAS() to provide the index() routine. Do the same for rindex()/strrchr(). This seems to make the C libraries and static binaries slightly smaller, but this reduction in size seems negligible.
* Replace a proliferation of buggy MD implementations of modf() with adas2011-10-213-109/+1
| | | | | | | working MI one. The MI one only needs to be overridden on machines with non-IEEE754 arithmetic. (The last supported one was the VAX.) It can also be overridden if someone comes up with a faster one that actually passes the regression tests -- but this is harder than it sounds.
* Fix typos - remove duplicate "the".brucec2011-02-211-1/+1
| | | | | | PR: bin/154928 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days
* The NetBSD Foundation has granted permission to remove clause 3 and 4 fromjoel2010-03-024-28/+0
| | | | | | their software. Obtained from: NetBSD
* Remove unneeded stdlib directories.ed2009-06-231-4/+0
| | | | | | | It's not necessary to add stdlib directories for each architecture, even if the architecture doesn't implement any files of its own. Submitted by: Christoph Mallon
* - Eliminate extra subcs instruction. I have not noticed before that westas2009-06-211-2/+1
| | | | | always perform substraction now, so no instruction could be rordered to eliminate the conditional substraction.
* - Fix strncmp on arm. Return 0 as result without performing thestas2009-06-211-5/+9
| | | | | | | | main cycle only if the len passed is equal to 0. If end address overflows use last possible address as the end address. Based on: discussion on arm@ MFC after: 1 month
* Use GCC's __SOFTFP__ to test whether we're being compiledmarcel2009-05-313-10/+8
| | | | | with softfloat or not. Now -msoft-float can be overridden more easily.
* revert r191633; this breaks at91 & xscale (likely all arm)sam2009-05-061-4/+4
|
* Change the test at the beginning of strncmp(), from being if (len - 1) < 0cognet2009-04-281-4/+4
| | | | | | | | | to if (len == 0). The length is supposed to be unsigned, so len - 1 < 0 won't happen except if len == 0 anyway, and it would return 0 when it shouldn't, if len was > INT_MAX. Spotted out by: Channa <channa kad gmail com>
OpenPOWER on IntegriCloud