summaryrefslogtreecommitdiffstats
path: root/lib/libc/arch/amd64 (follow)
Commit message (Collapse)AuthorAgeFilesLines
* "the the" -> "the" in commentmmcc2015-12-111-2/+2
|
* Split the non-syscall ASM bits from SYS.h into DEFS.h and use that in theguenther2015-11-1413-41/+80
| | | | | | non-syscall .S source ok millert@ miod@
* Wrap the remaining math functions in libc: __fpclassify*(), __flt_rounds(),guenther2015-10-273-5/+7
| | | | | | and ldexp(). ok millert@
* Merge the sigaction() and sigprocmask() overloads/wrappers from libpthreadguenther2015-10-232-4/+6
| | | | | | | | | into libc, and move pthread_sigmask() as well (just a trivial wrapper). This provides consistent handling of SIGTHR between single- and multi-threaded programs and is a step in the merge of all the libpthread overloads, providing some ASM and Makefile bits that the other wrappers will need. ok deraadt@ millert@
* Rename SYSEXIT() to SYSCALL_END() for consistency with most other archs.guenther2015-10-175-25/+14
| | | | | | No change in resulting object files ok millert@
* Wrap <stdlib.h> so that calls go direct and the symbols not in theguenther2015-09-132-3/+2
| | | | | | C standard are all weak. Apply __{BEGIN,END}_HIDDEN_DECLS to gdtoa{,imp}.h, hiding the arch-specific __strtorx, __ULtox_D2A, __strtorQ, __ULtoQ_D2A symbols.
* Do provide hidden _libc_* aliases for sig{block,setmask} and use them inguenther2015-09-132-22/+6
| | | | | | | the ASM *setjmp implementations. Skip the PLT when calling them on amd64 (other archs to do this after testing) ok miod@
* Adds hidden _libc_FOO aliases for the system call stubs.guenther2015-09-057-34/+38
| | | | | | | | Stop generating _brk and _sbrk symbols: they've already been hidden. Set the ELF symbol size on the syscall stubs. Give the __{min,cur}brk symbols a size and type, and hide more jump labels. ok deraadt@
* Add framework for resolving (pun intended) libc namespace issues, usingguenther2015-08-3111-31/+53
| | | | | | | | | | | | wrapper .h files and asm labels to let internal calls resolve directly and not be overridable or use the PLT. Then, apply that framework to most of the functions in stdio.h, string.h, err.h, and wchar.h. Delete the should-have-been-hidden-all-along _v?(err|warn)[cx]? symbols while here. tests clean on i386, amd64, sparc64, powerpc, and mips64 naming feedback from kettenis@ and millert@ ok kettenis@
* Hide many (194!) symbols that nothing should be using.guenther2015-08-265-81/+12
| | | | | | | Delete exect(2); it wasn't portable across archs and nothing used it. ports test build by naddy@ ok deraadt@ kettenis@
* Explicitly list the symbols permitted to be exported by libc.guenther2015-08-221-0/+18
| | | | | | | | This is primed with the current list of exported symbols so it doesn't change the ABI yet, but will prevent unintentional additions in the future and sets the stage for reductions. ok deraadt@ kettenis@
* Set FUNC symbol sizes of auto-generated and hand-written syscall wrappers.uebayasi2015-06-1710-14/+40
| | | | | | Original diff from guenther@, adjusted by me. OK guenther@
* Reuse SYSENTRY_HIDDEN() in SYSENTRY(); no functional changes.uebayasi2015-06-121-2/+2
|
* Put END() matching _ENTRY() (== ENTRY() w/o prof).uebayasi2015-06-011-1/+2
|
* Put END() matching ENTRY().uebayasi2015-06-011-1/+2
|
* Put END() where appropriate.uebayasi2015-05-294-10/+12
| | | | While here, kill redundant use of _C_LABEL() in ENTRY().
* Put obvious END() macros that match ENTRY() entries.uebayasi2015-05-2912-12/+51
|
* Sprinkle END() in some straightforward *.S files that have ENTRY(). Theuebayasi2015-05-2910-5/+17
| | | | resulting *.o have "FUNC" symbols with size set.
* Make index/rindex weak aliases of strchr/strrchr since they are notmillert2015-05-152-4/+4
| | | | | part of the ISO C standard and have also been dropped from POSIX. OK guenther@ kettenis@
* Eliminate the last uses of *fork's second syscall return register; the pidguenther2015-04-211-3/+3
| | | | | | is zero in the child ok deraadt@ miod@
* Make pthread_atfork() track the DSO that called it like atexit() does,guenther2015-04-072-7/+26
| | | | | | | | | | unregistering callbacks if the DSO is unloaded. Move the callback handling from libpthread to libc, though libpthread still overrides the inner call to handle locking and thread-library reinitialization. Major version bump for both libc and libpthread. verification that this fixes various ports ajacoutot@ asm assistance miod@; ok millert@ deraadt@
* Simplify fork/vfork logic: the kernel has handled returning zero in the childguenther2015-03-312-15/+3
| | | | | | | for a long time, so there's no need to test the second return register here in the asm stub. ok and testing of many archs by krw@ miod@
* remove code for ancient gcc.daniel2015-01-041-7/+1
| | | | ok millert@, kettenis@
* Import new amd64 assembly versions of strchr/index, strrchr/rindex,reyk2014-12-095-95/+442
| | | | | | | | | and strlen that provide a significantly faster performance than our previous .c or .S implementations. Based on NetBSD's code. Tested with different amd64 CPUs. ok deraadt@ mikeb@
* restructure libc/string + libc/arch/*/string coperation regardingderaadt2014-11-309-5/+359
| | | | | | | | | | | | | | | | (potentially) MD versions (function dependent, not filename dependent) split out memcpy/memmove/bcopy and strchr/index/strrchr/rindex Bring back amd64 .S versions And the final touch: switch all architectures temporarily to MI memcpy.c, which contains syslog + abort for overlapping copies. A nice harsh undefined behaviour. We will clean the entire userland of the remaining issues in this catagory, then switch to the optimised memcpy which skips the memmove check. I tried to cut this change into pieces, but testing each sub-step on every architecture is too time consuming and mindnumbing. ok miod
* One of these optimized stubs creates some incredibly subtle damage,deraadt2014-11-2012-391/+4
| | | | | causing as(1) to create a wrong nop-sled for text segment aligns. Revert, until it is found and fixed.
* Add amd64 assembler versions of some standard functions to libc. Thereyk2014-11-2012-4/+391
| | | | | | | | code is already used in the kernel and the files are unmodified copies from src/sys/lib/libkern/arch/amd64/. Depending on the function, this gives us some speedup in userland. ok deraadt@, no objections from miod@
* Nuke the machinery to sync libkern with libc, it's not been used in themiod2014-06-091-4/+1
| | | | | | last 15 years and there is no point to use it in the future. From Jean-Philippe Ouellet
* Apply "unifdef -D__STDC__" to libc/arch/*/SYS.hmatthew2014-06-041-11/+1
| | | | | | | | A while back, pascal@ converted our system call stubs from using "cpp | as" to "cc -x assembler-with-cpp", so there's no need to stay compatible with ancient preprocessor semantics. ok miod
* add proto for amd64 case; unify otherwisederaadt2013-11-121-2/+4
|
* Do a PC-relative relocation for _map rather than going throughmartynas2013-04-231-2/+2
| | | | | | | | | GOTPCREL. Uncovered after the binutils patch where it isn't optimized away at assembly and is forced to go through GOTPCREL. But _map is effectively a local variable. Found with cephes by guenther@. OK guenther@, kettenis@, deraadt@.
* remove lint leftovers; ok guenther@okan2012-09-042-5/+2
|
* Convert cpp | as rules in bsd.lib.mk and lib/libc/sys/Makefile.inc to pure ccpascal2012-08-2213-28/+28
| | | | | | | invocations. This allows us to use the compiler builtin define __PIC__ to check for PIC/PIEness rather than passing -DPIC. Simplifies PIE work a lot. ok matthew@, conceptually ok kurt@
* __tfork() needs to set the stack address of the new thread in the kernel,guenther2012-06-211-5/+4
| | | | | | | | | so that it can't get a signal while still running on the parent thread's stack. Also, pass in sizeof(struct __tfork) to provide forward compat when more members are added. This is an ABI change, so switch syscall numbers and bump lib majors this time. ok deraadt@ matthew@
* rely on the compiler giving us a built-in alloca. any new architecturederaadt2012-04-192-16/+1
| | | | | or compiler we use will. ok millert
* alloca.c cannot be usedderaadt2012-04-121-2/+1
|
* remove rfork(); ok guenther miodderaadt2012-04-121-44/+0
|
* Move __tfork_thread() from rthreads (libpthread) to libc so thatguenther2012-03-221-0/+94
| | | | | | it can be used for not-strictly-threading purposes ok matthew@ kurt@
* Remove assembly version of strlen from i386 and amd64, where it'smikeb2012-01-171-18/+0
| | | | | | | up to 3 times slower than the C code most of the time. This was brought up by DragonflyBSD guys initially. ok deraadt, guenther. miod will not miss it.
* Reimplement mutexes, condvars, and rwlocks to eliminate bugs,guenther2012-01-172-5/+5
| | | | | | | | | | | | | particularly the "consume the signal you just sent" hang, and putting the wait queues in userspace. Do cancellation handling in pthread_cond_*wait(), pthread_join(), and sem_wait(). Add __ prefix to thr{sleep,wakeup,exit,sigdivert}() syscalls; add 'abort" argument to thrsleep to close cancellation race; make thr{sleep,wakeup} return errno values via *retval to avoid touching userspace errno.
* Change to syscall is done, so delete an XXX commentguenther2011-10-111-5/+1
|
* Switch sigreturn() to the normal syscall entry instead of int$80.guenther2011-09-052-26/+3
| | | | | | This was done for the sigreturn call in sigcode before 5.0. ok deraadt@ for post-5.0
* Revert (leaving the complex math part alone). Some stuff is dependingmartynas2011-07-083-2/+110
| | | | | on this historical behavior; so we're stuck in this stupid situation. No cookie for me.
* Move fabs(3), frexp(3), and modf(3) to libm--nothing has been usingmartynas2011-07-083-110/+2
| | | | them in libc for a very long time. OK guenther@.
* Move __cerror to ___cerror with a weak alias so that rthreads can override it.guenther2011-04-042-3/+6
| | | | | | On mips64, also correct the name called from plain cerror to __cerror. "looks correct" miod@
* remove from gen so that lint doesn't check gen if assembly versionsmartynas2009-04-211-2/+2
| | | | are available. spotted by theo
* - ldexp implementation has issues. switch to the one from libmmartynas2009-04-191-2/+2
| | | | | | - remove frexp in hppa64, cloned from hppa - move generic ieee754 implementations of modf and ldexp to gen ok kettenis@, "looks good" millert@
* these were not neededmartynas2008-12-091-2/+1
|
* ditto frexpl and ldexplmartynas2008-12-091-1/+2
|
* - add long double signbitmartynas2008-12-096-6/+38
| | | | | | | | | | | | | - make long double versions weak aliases to double versions, on archs where long doubles are 64 bits - no need to have two finites. finite() and finitef() are non-standard 3BSD obsolete versions of isfinite. remove from libm. make them weak_alias in libc to __isfinite and __isfinitef instead. similarly make 3BSD obsolete versions of isinf, isinff, isnan, isnanf weak_aliases to C99's __isinf, __isinff, __isnan, __isnanf - bump major ok millert@