History log of /freebsd-9.3-release/lib/libc/amd64/gen/setjmp.S
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 229008 30-Dec-2011 kib

MFC r227023:
Make sure that stack is 16-byte aligned before calling a function,
as it is required by amd64 ABI. Add a comment for the places were
the stack is accidentally properly aligned already.

PR: amd64/162214


# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 217106 07-Jan-2011 kib

Add section .note.GNU-stack for assembly files used by 386 and amd64.


# 184547 02-Nov-2008 peter

We've been lax about matching END() macros in asm code for some time. This
is used to set the ELF size attribute for functions. It isn't normally
critical but some things can make use of it (gdb for stack traces).
Valgrind needs it so I'm adding it in. The problem is present on all
branches and on both i386 and amd64.


# 180080 28-Jun-2008 das

Two FP-related setjmp/longjmp changes:

1. Save and restore the control part of the MXCSR in addition to the
i387 control word to ensure that the two are consistent.

Note that standards don't require longjmp to restore either control
word, and none of Linux, MacOS X 10.3 and earlier, NetBSD, OpenBSD,
or Solaris do it. However, it is historical FreeBSD behavior, and
bde points out that it is needed to make longjmping out of a signal
handler work properly, given the way FreeBSD clobbers the FPU state
on signal handler entry.

2. Don't clobber the FPU exception flags in longjmp. C99 requires them
to remain unchanged.


# 165903 08-Jan-2007 imp

Per Regents of the University of Calfornia letter, remove advertising
clause.

# If I've done so improperly on a file, please let me know.


# 115745 02-Jun-2003 peter

Cosmetic; record offsets used within jmpbuf


# 114835 08-May-2003 peter

SIG_SETMASK is 3, not 1. Sigh.


# 114829 08-May-2003 peter

Fix an embarresing transcription error from i386 to amd64. Put the arguments
to sigprocmask(2) int the correct order. *blush*.
For sigsetjmp(), match up the pushq/popq in the non-savemask case.


# 114309 30-Apr-2003 peter

Update for AMD64 contexts. Note that this still has some x87-style FPU
instructions here, these may need to be updated for SSE.
(Repocopied from i386/gen)


# 92999 23-Mar-2002 obrien

Restore CSRG ID's lost in January 1995.


# 85437 24-Oct-2001 peter

De-orbit DEFS.h - the other arches do not use it, and it got replaced
with <machine/asm.h>.

Reviewed by: bde


# 81586 13-Aug-2001 ru

Removed duplicate VCS ID tags, as per style(9).


# 71579 24-Jan-2001 deischen

Remove _THREAD_SAFE and make libc thread-safe by default by
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


# 59933 04-May-2000 jasone

Use assembler directives rather than ALTENTRY() so that longjmp() and
siglongjmp() are weak symbols. This is necessary to allow static linking
with the linuxthreads library port.


# 56345 20-Jan-2000 jasone

Remove unnecessary alternate entry points for *setjmp(). Make the main
entry point the standard name when not compiling libc_r (for example,
longjmp is the main entry point instead of __longjmp).

Suggested by: bde


# 56276 19-Jan-2000 jasone

Make minor entry point changes to support libc_r.


# 55837 12-Jan-2000 jasone

Add three-tier symbol naming in support of POSIX thread cancellation
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().


# 55375 03-Jan-2000 jasone

Unbreak profiling. bde says this is not the cleanest way to fix the
problem, but that it works.

Submitted by: bde


# 55068 23-Dec-1999 jasone

Creating weak symbols doesn't work correctly when building an aout libc.
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


# 54607 14-Dec-1999 jasone

Make setjmp, longjmp, sigsetjmp, and siglongjmp weak aliases for
__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.


# 52083 10-Oct-1999 marcel

\begin{quote}
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


# 51794 29-Sep-1999 marcel

sigset_t change (part 5 of 5)
-----------------------------

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.


# 50476 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 35504 29-Apr-1998 jb

Stop renaming these in libc_r because wrappered versions don't make sense.
PR: i386/4826, bin/5953


# 22993 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 15634 05-May-1996 peter

Add support to enable libc to be compiled in ELF format. (#ifdef __ELF__)
In a nutshell, this macroizes the local/global symbol scoping rules
that are different in a.out and ELF. It also makes the i386 assembler
stubs conform to i386 PIC calling conventions - the a.out ld.so didn't
object, but the ELF one needs it as it implements PIC jumps via PLT's as
well as calls. The a.out rtld only worked because it was accidently
snooping the grandparent calling function's return address off the stack..

This also affects the libc_r code a little, because of cpp macro nesting.


# 13545 21-Jan-1996 julian

Reviewed by: julian and (hsu?)
Submitted by: John Birrel(L?)

changes for threadsafe operations


# 5790 22-Jan-1995 dg

First round of changes to clean up the RCSID mess in libc:

1) Changed LIB_SCCS and SYSLIB_SCCS to LIB_RCS and SYSLIB_RCS.
2) Changed sccsid[] variables to rcsid[]
3) Moved all RCSID strings into .text
4) Converted all SCCSID's to RCS $Id$'s
5) Added missing $Id$'s after copyright.


# 5244 27-Dec-1994 bde

Remove unnecessary .align statement.


# 1849 04-Aug-1994 wollman

First crack at making libc work with the new make macros. It compiles on
my machine, and a simple static (genassym) and shared (sysctl) executable
both work. Still to be done: RPCand YP merge.