summaryrefslogtreecommitdiffstats
path: root/lib/libc/amd64/gen
Commit message (Collapse)AuthorAgeFilesLines
* Fix a typo in the !__GNUC__ case and remove an obsolete comment.das2004-02-161-3/+1
|
* Fix some aliasing problems.das2004-02-161-14/+19
|
* Rewrite fabs.S to use pure SSE2 operations. I got the clues how to dopeter2004-02-081-10/+35
| | | | this from looking at code generated by gcc.
* "Fix" makecontext() so that the C code begins execution with itspeter2003-12-051-2/+6
| | | | | | | | | | | | | ABI-required stack alignment. C code expects that the push of the return address disturbed the 16 byte alignment and it will take corrective measures to fix it before making another call. Of course, if its wrong to start with, then all hell breaks loose. Essentially we "fix" this by making the stack alignment odd to start with. This was one of the things that broke on libkse with apps that use floating point/varargs/etc. Approved by: re (scottl)
* Add rfork_thread(3).alc2003-10-132-1/+102
|
* Fix fabs(). This commit brought to you by the letter 'l'.peter2003-09-261-1/+1
| | | | | | | | | (fstp stores a mem32 value, fstpl stores a mem64 value) This fixes ghostscript for 'make release' on amd64. Ghostscript for some reason thinks it is a good idea to use -fno-builtin, which means it is vulnerable to bugs in libc that are normally hidden by the builtin gcc functions. Oops.
* Set mc_len to sizeof(mcontext_t), otherwise it is an invalid context.davidxu2003-07-261-0/+1
|
* Instantiate explicit callable versions of the machine/ieeefp.h inlinespeter2003-07-229-1/+67
| | | | for the use of non-GCC compilers and C++ code.
* Add amd64 versions of makecontext() and signalcontext() neededdeischen2003-07-193-1/+208
| | | | | for libkse (makecontext() is also needed for libthr). These probably will need some tweaking.
* This is unusable on amd64. Remove it before it causes more confusion.peter2003-06-131-53/+0
| | | | | | It is only possible to do this on an ABI that has a compulsory frame pointer, which the amd64 ABI does not. Thus, it is only possible to implement this as a compiler builtin.
* Use C99 compatible ASM statements.obrien2003-06-101-1/+1
| | | | | (untested, but existing state breaks http://triangle.rtp.freebsd.org/~des/tinderbox-CURRENT-amd64-amd64.brief)
* Cosmetic; record offsets used within jmpbufpeter2003-06-023-30/+30
|
* Fix sigsetjmp(). It helps if we do not try to save the old signal maskpeter2003-06-021-0/+1
| | | | to a random memory location. Perl works a lot better with this.
* Update ldexp.c for amd64.peter2003-05-102-7/+1
|
* SIG_SETMASK is 3, not 1. Sigh.peter2003-05-081-1/+1
|
* Fix an embarresing transcription error from i386 to amd64. Put the argumentspeter2003-05-082-13/+12
| | | | | to sigprocmask(2) int the correct order. *blush*. For sigsetjmp(), match up the pushq/popq in the non-savemask case.
* Tidy up modf.S and make it actually work. It wasn't extractingpeter2003-05-081-16/+13
| | | | | the value out of ST(0) before copying it to %xmm0. Also remove bogus stack frame and work in the red zone.
* Fix typo, even though this is unused.peter2003-05-081-1/+1
|
* Turn off alloca.S - it cannot possibly work like this since on AMD64, gccpeter2003-05-071-1/+1
| | | | | | | doesn't use stack frames. It uses offsets relative to %rsp, not %rbp. So we cannot just change %rsp like this. Approved by: re (blanket amd64)
* Convert the i386 alloca(3) to the x86-64 ISA.obrien2003-05-011-0/+53
| | | | Alignment hack from: NetBSD
* Update for AMD64 contexts. Note that this still has some x87-style FPUpeter2003-04-303-105/+112
| | | | | instructions here, these may need to be updated for SSE. (Repocopied from i386/gen)
* Reduce the SRCS to what compilespeter2003-04-301-3/+3
|
* Floating point libc functions traditionally written in ASM.obrien2003-04-302-0/+113
| | | | | | | AMD64 does away with the x87 in 64-bit long mode, so we have to play the SSE/SSE2 game now. Obtained from: NetBSD/x86-64
* o Implement C99 classification macros isfinite(), isinf(), isnan(),mike2003-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>
* Implement fpclassify():mike2003-02-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Disconnect the userland get/set/swapcontext() functions fromdeischen2002-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.
* Re-apply the previously backed-out commit that fixes the problem wherearchie2002-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
* Revert previous commit to unbreak world until we figure out thearchie2002-09-201-1/+1
| | | | right way to do it.
* Fix a problem with the definition of HUGE_VAL causing the gcc warningarchie2002-09-191-1/+1
| | | | | | "cast increases required alignment of target type" on some platforms. Reviewed by: bde
* Fixed editing error in previous commit (*blush*).bde2002-09-171-1/+1
|
* Fixed unsorting of SRCS.bde2002-09-171-2/+2
|
* Save and restore FPU state properly in ucontext_t's.mini2002-09-161-1/+1
| | | | | Reviewed by: deischen, julian Approved by: -arch
* Restore CSRG ID's lost in January 1995.obrien2002-03-236-13/+26
|
* Fix the style of the SCM ID's.obrien2002-03-224-13/+9
| | | | I believe have made all of libc .c's as consistent as possible.
* Move swapcontext.c to the ${MACHINE_ARCH}/gen/Makefile.inc area, otherwisepeter2002-03-211-1/+1
| | | | | it causes undefined references to getcontext() and setcontext() on platforms other than i386 and alpha.
* Fixed unsorting and splitting of SRCS in previous commit.bde2002-01-111-2/+2
|
* Add getcontext, setcontext, makecontext, and swapcontext. Thesedeischen2002-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
* De-orbit DEFS.h - the other arches do not use it, and it got replacedpeter2001-10-243-3/+1
| | | | | | with <machine/asm.h>. Reviewed by: bde
* Removed duplicate VCS ID tags, as per style(9).ru2001-08-136-15/+6
|
* Remove _THREAD_SAFE and make libc thread-safe by default bydeischen2001-01-243-36/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* rfork(2) wrapper for simple rfork-style threads. I have lost count ofpeter2000-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.
* Use assembler directives rather than ALTENTRY() so that longjmp() andjasone2000-05-042-10/+8
| | | | | siglongjmp() are weak symbols. This is necessary to allow static linking with the linuxthreads library port.
* Remove unnecessary alternate entry points for *setjmp(). Make the mainjasone2000-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
* Make minor entry point changes to support libc_r.jasone2000-01-193-6/+6
|
* Add three-tier symbol naming in support of POSIX thread cancellationjasone2000-01-123-10/+18
| | | | | | 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().
* Unbreak profiling. bde says this is not the cleanest way to fix thejasone2000-01-042-4/+4
| | | | | | problem, but that it works. Submitted by: bde
* Creating weak symbols doesn't work correctly when building an aout libc.jasone1999-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
* Make setjmp, longjmp, sigsetjmp, and siglongjmp weak aliases forjasone1999-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.
* \begin{quote}marcel1999-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
* sigset_t change (part 5 of 5)marcel1999-09-293-31/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ----------------------------- 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.
OpenPOWER on IntegriCloud