aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/amd64
Commit message (Collapse)AuthorAgeFilesLines
* o Implement C99 classification macros isfinite(), isinf(), isnan(),Mike Barcroft2003-02-121-0/+2
| | | | | | | | | | | | isnormal(). The current isinf() and isnan() are perserved for binary compatibility with 5.0, but new programs will use the macros. o Implement C99 comparison macros isgreater(), isgreaterequal(), isless(), islessequal(), islessgreater(), isunordered(). Submitted by: David Schultz <dschultz@uclink.Berkeley.EDU> Notes: svn path=/head/; revision=110769
* Implement fpclassify():Mike Barcroft2003-02-082-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Add a MD header private to libc called _fpmath.h; this header contains bitfield layouts of MD floating-point types. o Add a MI header private to libc called fpmath.h; this header contains bitfield layouts of MI floating-point types. o Add private libc variables to lib/libc/$arch/gen/infinity.c for storing NaN values. o Add __double_t and __float_t to <machine/_types.h>, and provide double_t and float_t typedefs in <math.h>. o Add some C99 manifest constants (FP_ILOGB0, FP_ILOGBNAN, HUGE_VALF, HUGE_VALL, INFINITY, NAN, and return values for fpclassify()) to <math.h> and others (FLT_EVAL_METHOD, DECIMAL_DIG) to <float.h> via <machine/float.h>. o Add C99 macro fpclassify() which calls __fpclassify{d,f,l}() based on the size of its argument. __fpclassifyl() is never called on alpha because (sizeof(long double) == sizeof(double)), which is good since __fpclassifyl() can't deal with such a small `long double'. This was developed by David Schultz and myself with input from bde and fenner. PR: 23103 Submitted by: David Schultz <dschultz@uclink.Berkeley.EDU> (significant portions) Reviewed by: bde, fenner (earlier versions) Notes: svn path=/head/; revision=110566
* libc_r wasn't so tied to libc for 22 months.Ruslan Ermilov2002-11-181-2/+0
| | | | Notes: svn path=/head/; revision=107052
* Disconnect the userland get/set/swapcontext() functions fromDaniel Eischen2002-11-161-2/+2
| | | | | | | | | | | | libc. I want to keep these in some version for the thread library/ies, but don't know whether to have them repo-copied to libc_r or renamed and kept in libc. Change the name of an alpha macro that was changed with the system call commit. Notes: svn path=/head/; revision=106980
* Re-apply the previously backed-out commit that fixes the problem whereArchie Cobbs2002-10-311-1/+1
| | | | | | | | | | | HUGE_VAL is not properly aligned on some architectures. The previous fix now works because the two versions of 'math.h' (include/math.h and lib/msun/src/math.h) have since been merged into one. PR: bin/43544 Notes: svn path=/head/; revision=106268
* Revert previous commit to unbreak world until we figure out theArchie Cobbs2002-09-201-1/+1
| | | | | | | right way to do it. Notes: svn path=/head/; revision=103686
* Fix a problem with the definition of HUGE_VAL causing the gcc warningArchie Cobbs2002-09-191-1/+1
| | | | | | | | | "cast increases required alignment of target type" on some platforms. Reviewed by: bde Notes: svn path=/head/; revision=103653
* Fixed editing error in previous commit (*blush*).Bruce Evans2002-09-171-1/+1
| | | | Notes: svn path=/head/; revision=103501
* Fixed unsorting of SRCS.Bruce Evans2002-09-171-2/+2
| | | | Notes: svn path=/head/; revision=103488
* Initiate deorbit burn for the i386-only a.out related support. Moves arePeter Wemm2002-09-171-5/+1
| | | | | | | | | | | | | | | | | | under way to move the remnants of the a.out toolchain to ports. As the comment in src/Makefile said, this stuff is deprecated and one should not expect this to remain beyond 4.0-REL. It has already lasted WAY beyond that. Notable exceptions: gcc - I have not touched the a.out generation stuff there. ldd/ldconfig - still have some code to interface with a.out rtld. old as/ld/etc - I have not removed these yet, pending their move to ports. some includes - necessary for ldd/ldconfig for now. Tested on: i386 (extensively), alpha Notes: svn path=/head/; revision=103436
* Save and restore FPU state properly in ucontext_t's.Jonathan Mini2002-09-161-1/+1
| | | | | | | | Reviewed by: deischen, julian Approved by: -arch Notes: svn path=/head/; revision=103406
* Use '_end' symbol instead of 'end' to initialize minbrk and curbrkAlexander Kabaev2002-08-081-3/+3
| | | | | | | | | | | | | | | | variables. Both symbols are set to the same value by the linker, and _end symbol has less chances to clash with application defined global symbols. alpha, ia64 and sparc64 ports already use _end, i386 is now consistent with them. Reviewed by: bde Approved by: obrien Reported by: pirzyk Notes: svn path=/head/; revision=101536
* Generate the normal asm stubs for all sysv system calls. Use these insteadJake Burkholder2002-05-231-5/+3
| | | | | | | | | | of C wrappers for the *sys indirect system calls. The indirect system calls are horribly broken on sparc64. Submitted by: tmm Notes: svn path=/head/; revision=97191
* Restore CSRG ID's lost in January 1995.David E. O'Brien2002-03-2320-75/+96
| | | | Notes: svn path=/head/; revision=92999
* Fix the style of the SCM ID's.David E. O'Brien2002-03-221-2/+1
| | | | | | | I believe have made all of libc .h's as consistent as possible. Notes: svn path=/head/; revision=92991
* Fix the style of the SCM ID's.David E. O'Brien2002-03-224-13/+9
| | | | | | | I believe have made all of libc .c's as consistent as possible. Notes: svn path=/head/; revision=92986
* Move swapcontext.c to the ${MACHINE_ARCH}/gen/Makefile.inc area, otherwisePeter Wemm2002-03-211-1/+1
| | | | | | | | it causes undefined references to getcontext() and setcontext() on platforms other than i386 and alpha. Notes: svn path=/head/; revision=92862
* o Move NTOHL() and associated macros into <sys/param.h>. These areMike Barcroft2002-02-184-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | deprecated in favor of the POSIX-defined lowercase variants. o Change all occurrences of NTOHL() and associated marcros in the source tree to use the lowercase function variants. o Add missing license bits to sparc64's <machine/endian.h>. Approved by: jake o Clean up <machine/endian.h> files. o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>. o Remove prototypes for non-existent bswapXX() functions. o Include <machine/endian.h> in <arpa/inet.h> to define the POSIX-required ntohl() family of functions. o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>, and <sys/param.h>. o Prepend underscores to the ntohl() family to help deal with complexities associated with having MD (asm and inline) versions, and having to prevent exposure of these functions in other headers that happen to make use of endian-specific defines. o Create weak aliases to the canonical function name to help deal with third-party software forgetting to include an appropriate header. o Remove some now unneeded pollution from <sys/types.h>. o Add missing <arpa/inet.h> includes in userland. Tested on: alpha, i386 Reviewed by: bde, jake, tmm Notes: svn path=/head/; revision=90868
* Fixed unsorting and splitting of SRCS in previous commit.Bruce Evans2002-01-111-2/+2
| | | | Notes: svn path=/head/; revision=89267
* Add getcontext, setcontext, makecontext, and swapcontext. TheseDaniel Eischen2002-01-101-0/+1
| | | | | | | | | | | | functions are defined in SUSv2 and the latest POSIX spec. Thanks to Bernd Walter <ticso@cicely8.cicely.de> for helping debug my alpha assembly. Approved by: -arch Notes: svn path=/head/; revision=89177
* Use 'mov' instead of 'lea' for setting the syscall number in %eax as thatJohn Baldwin2001-11-276-9/+9
| | | | | | | | | is clearer about what we are actually doing. Requested by: bde Notes: svn path=/head/; revision=87006
* Cleanups after previous change:John Baldwin2001-11-131-9/+2
| | | | | | | | | | | | | | - Renumber labels since the previous revision removed one. - Remove useless and wrong comment. - Repeating the function name is just redundant. - The previous revision made the comment about %edx useless. - The comment about %eax was wrong (but did explain why %eax used to be fixed up). Submitted by: bde Notes: svn path=/head/; revision=86325
* The kernel already fixes up %eax for parents that return from fork, soJohn Baldwin2001-11-132-6/+2
| | | | | | | | don't bother manually fixing up %eax for the parent process by testing the value in %edx and zeroing and already zeroed %eax. Notes: svn path=/head/; revision=86314
* De-orbit DEFS.h - the other arches do not use it, and it got replacedPeter Wemm2001-10-249-9/+6
| | | | | | | | | with <machine/asm.h>. Reviewed by: bde Notes: svn path=/head/; revision=85437
* Just use RSYSCALL.Ruslan Ermilov2001-10-191-2/+1
| | | | Notes: svn path=/head/; revision=85160
* Removed duplicate VCS ID tags, as per style(9).Ruslan Ermilov2001-08-1320-43/+6
| | | | Notes: svn path=/head/; revision=81586
* MAN[1-9] -> MAN.Ruslan Ermilov2001-03-271-2/+2
| | | | Notes: svn path=/head/; revision=74870
* Clean up syscall generation in libc by removing HIDDEN_SYSCALLSDaniel Eischen2001-01-294-38/+9
| | | | | | | | | | | | | | | | | and treating (almost) all system calls the same way: __sys_foo - actual syscall foo, _foo - weak definitions to __sys_foo Change PSEUDO syscalls (currently only _exit and _getlogin) to be __sys_foo (T) and _foo (W). Add $FreeBSD$ to a few files to satisfy commitprep. Suggested by: bde Notes: svn path=/head/; revision=71770
* Comment only change; s/_thread_sys_/__sys_/Daniel Eischen2001-01-261-2/+2
| | | | Notes: svn path=/head/; revision=71663
* Remove _THREAD_SAFE and make libc thread-safe by default byDaniel Eischen2001-01-246-60/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adding (weak definitions to) stubs for some of the pthread functions. If the threads library is linked in, the real pthread functions will pulled in. Use the following convention for system calls wrapped by the threads library: __sys_foo - actual system call _foo - weak definition to __sys_foo foo - weak definition to __sys_foo Change all libc uses of system calls wrapped by the threads library from foo to _foo. In order to define the prototypes for _foo(), we introduce namespace.h and un-namespace.h (suggested by bde). All files that need to reference these system calls, should include namespace.h before any standard includes, then include un-namespace.h after the standard includes and before any local includes. <db.h> is an exception and shouldn't be included in between namespace.h and un-namespace.h namespace.h will define foo to _foo, and un-namespace.h will undefine foo. Try to eliminate some of the recursive calls to MT-safe functions in libc/stdio in preparation for adding a mutex to FILE. We have recursive mutexes, but would like to avoid using them if possible. Remove uneeded includes of <errno.h> from a few files. Add $FreeBSD$ to a few files in order to pass commitprep. Approved by: -arch Notes: svn path=/head/; revision=71579
* Remove last vestiges of thr_sleep and thr_wakeup from libc.Jake Burkholder2000-12-021-1/+1
| | | | Notes: svn path=/head/; revision=69515
* Prefix the register argument of indirect 'jmp's with a * to make gas 2.10.xJohn Baldwin2000-11-281-1/+1
| | | | | | | happy. Notes: svn path=/head/; revision=69332
* Add a couple of debug register helper functions to assist in settingBrian S. Dean2000-09-211-2/+4
| | | | | | | | | and clearing watchpoints. Reviewed by: jwd@FreeBSD.org, -hackers@ Notes: svn path=/head/; revision=66174
* rfork(2) wrapper for simple rfork-style threads. I have lost count ofPeter Wemm2000-07-291-1/+1
| | | | | | | | | | | | | | | | | | the number of times I have given this to people and got asked: why isn't it in libc? It is impossible to do this without assembler glue to reset the stack for the new child process. int rfork_thread(flags, stack_addr, start_fnc, start_arg) int flags; Flags to rfork system call. See rfork(2). void *stack_addr; Top of stack for thread. int (*start_fnc)(void *); Address of thread function to call in child. void *start_arg; Argument to pass to the thread function in child. This is deliberately not documented or prototyped in includes until the corresponding alpha version is written. Notes: svn path=/head/; revision=64000
* Use assembler directives rather than ALTENTRY() so that longjmp() andJason Evans2000-05-042-10/+8
| | | | | | | | siglongjmp() are weak symbols. This is necessary to allow static linking with the linuxthreads library port. Notes: svn path=/head/; revision=59933
* Take care to avoid having "strong" and "weak" symbols of the same name inJason Evans2000-03-161-4/+0
| | | | | | | libc_r. Notes: svn path=/head/; revision=58126
* Undo the ill-conceived breakage of the previous commit and really fix:Jason Evans2000-01-291-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For libc_r renamed syscalls, correct symbol naming from _thread_sys_foo() <-- _foo() to _thread_sys_foo() <-- _foo() <-- foo(). This is necessary for system calls which libc_r doesn't define foo(). Some weak symbols such as poll() are defined twice. From what I understand, depending on one weak symbol or the other to be used is a bad idea. All such weak symbols defined in the libc_r-specific code should therefore be made strong (non-weak?). Simplify PSEUDO() to not define any weak symbols, since they aren't ever needed. alpha/SYS.h: Correct reversed usage of WEAK_ALIAS(), which has reversed arguments from __weak_reference(). Also, fix reversal of symbols, so that syscall foo() is a weak alias for _foo(). Add WEAK_ALIAS() call to PRSYSCALL(), which unlike the i386 version of PRSYSCALL(), is not defined in terms of PSYSCALL(). Make PSEUDO() equivalent to the i386 version. Notes: svn path=/head/; revision=56809
* For syscalls that are renamed to _thread_sys_foo, create a weak aliasJason Evans2000-01-281-7/+7
| | | | | | | called _foo, not _thread_sys_foo. Notes: svn path=/head/; revision=56773
* Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),Jason Evans2000-01-271-6/+7
| | | | | | | | | | | | | | | | | | | | just use _foo() <-- foo(). In the case of a libpthread that doesn't do call conversion (such as linuxthreads and our upcoming libpthread), this is adequate. In the case of libc_r, we still need three names, which are now _thread_sys_foo() <-- _foo() <-- foo(). Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(), nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo(). Remove all internal libc usage of: creat(), pause(), sleep(), system(), tcdrain(), wait(), and waitpid(). Make thread cancellation fully POSIX-compliant. Suggested by: deischen Notes: svn path=/head/; revision=56698
* Remove unnecessary alternate entry points for *setjmp(). Make the mainJason Evans2000-01-203-15/+18
| | | | | | | | | | entry point the standard name when not compiling libc_r (for example, longjmp is the main entry point instead of __longjmp). Suggested by: bde Notes: svn path=/head/; revision=56345
* Make minor entry point changes to support libc_r.Jason Evans2000-01-193-6/+6
| | | | Notes: svn path=/head/; revision=56276
* Add three-tier symbol naming in support of POSIX thread cancellationJason Evans2000-01-124-12/+25
| | | | | | | | | points. For library functions, the pattern is __sleep() <-- _libc_sleep() <-- sleep(). The arrows represent weak aliases. For system calls, the pattern is _read() <-- _libc_read() <-- read(). Notes: svn path=/head/; revision=55837
* Unbreak profiling. bde says this is not the cleanest way to fix theJason Evans2000-01-042-4/+4
| | | | | | | | | problem, but that it works. Submitted by: bde Notes: svn path=/head/; revision=55375
* Creating weak symbols doesn't work correctly when building an aout libc.Jason Evans1999-12-242-8/+4
| | | | | | | | | | | | | | | Doing the "right thing" here is difficult, so create two ENTRY points for each function (for example, __setjmp and setjmp are equivalent). This isn't pretty, but it works for both aout and ELF. libc symbol naming needs an overhaul in order to properly support function wrapping, specifically in the case of a real libpthread, and these duplicate entry points should be fixed as part of that overhaul. Pointed out by: bde Notes: svn path=/head/; revision=55068
* Make setjmp, longjmp, sigsetjmp, and siglongjmp weak aliases forJason Evans1999-12-142-4/+12
| | | | | | | | | | | __setjmp, __longjmp, __sigsetjmp, and __siglongjmp, respectively. This supports cancellation in the linuxthreads port. In the long run, a much more comprehensive solution will necessitate more dramatic changes to libc symbol naming, and these aliases will probably need modification at that time. Notes: svn path=/head/; revision=54607
* Remove osig* from NOASM. It bogus now.Marcel Moolenaar1999-10-141-2/+1
| | | | Notes: svn path=/head/; revision=52232
* \begin{quote}Marcel Moolenaar1999-10-101-1/+1
| | | | | | | | | | | | | | setjmp() gets the jmp_buf pointer from the wrong place (the place where the return address is) in the shlib case, and uses it (only) to fetch the current signal mask to address (return_address + 28). This address is normally read-only (I hope), so the sigprocmask() call has no effect except to return an error code. \end{quote} Submitted by: bde Notes: svn path=/head/; revision=52083
* Remove syscall wrappers.Marcel Moolenaar1999-10-091-3/+2
| | | | Notes: svn path=/head/; revision=52062
* sigset_t change (part 5 of 5)Marcel Moolenaar1999-09-294-34/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ----------------------------- Most of the userland changes are in libc. For both the alpha and the i386 setjmp has been changed to accomodate for the new sigset_t. Internally, libc is mostly rewritten to use the new syscalls. The exception is in compat-43/sigcompat.c The POSIX thread library has also been rewritten to use the new sigset_t. Except, that it currently only handles NSIG signals instead of the maximum _SIG_MAXSIG. This should not be a problem because current applications don't use any signals higher than NSIG. There are version bumps for the following libraries: libdialog libreadline libc libc_r libedit libftpio libss These libraries either a) have one of the modified structures visible in the interface, or b) use sigset_t internally and may cause breakage if new binaries are used against libraries that don't have the sigset_t change. This not an immediate issue, but will be as soon as applications start using the new range to its fullest. NOTE: libncurses already had an version bump and has not been given one now. NOTE: doscmd is a real casualty and has been disconnected for the moment. Reconnection will eventually happen after doscmd has been fixed. I'm aware that being the last one to touch it, I'm automaticly promoted to being maintainer. According to good taste this means that I will receive a badge which either will be glued or mechanically stapled, drilled or otherwise violently forced onto me :-) NOTE: pcvt/vttest cannot be compiled with -traditional. The change cause sys/types to be included along the way which contains the const and volatile modifiers. I don't consider this a solution, but more a workaround. Notes: svn path=/head/; revision=51794
* $Id$ -> $FreeBSD$Peter Wemm1999-08-2825-45/+45
| | | | Notes: svn path=/head/; revision=50476