History log of /freebsd-10.0-release/lib/libc/i386/gen/rfork_thread.S
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

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

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

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


# 240152 05-Sep-2012 jilles

libc/i386: Do not export .cerror.

For some reason, libc exports the symbol .cerror (HIDENAME(cerror)), albeit
in the FBSDprivate_1.0 version. It looks like there is no reason for this
since it is not used from other libraries. Given that it cannot be accessed
from C and its strange calling convention, it is rather unlikely that other
things rely on it. Perhaps it is from a time when symbols could not be
hidden.

Not exporting .cerror causes it to be jumped to directly instead of via the
PLT.

This change also takes advantage of .cerror's new status by not saving and
loading %ebx before jumping to it. (Therefore, .cerror now saves and loads
%ebx itself.) Where there was a conditional jump to a jump to .cerror, the
conditional jump has been changed to jump to .cerror directly (many modern
CPUs don't do static prediction and in any case it is not much of a benefit
anyway).

This change makes libc.so.7 a few kilobytes smaller.

Reviewed by: kib


# 217106 07-Jan-2011 kib

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


# 184548 02-Nov-2008 peter

Add missing END() macros, as per rev 184547 for amd64. The lack of these
is mostly harmless, but it does upset some of valgrind's functionality.


# 114804 07-May-2003 jhb

Properly cleanup the stack before jumping to cerror() if rfork(2) fails.

Submitted by: Igor Sysoev <is@rambler-co.ru>
Approved by: re (scottl)


# 93000 23-Mar-2002 obrien

Standardize on our SCM ID style.


# 87006 27-Nov-2001 jhb

Use 'mov' instead of 'lea' for setting the syscall number in %eax as that
is clearer about what we are actually doing.

Requested by: bde


# 64003 29-Jul-2000 peter

Fix some rather interesting bugs that managed to not turn up in various
testing and real-life applications:
1) If you returned from the thread function, you got a segv instead of
calling _exit() with your return code.
2) clean up some bogus stack management. There was also an underflow
on function return.
3) when making syscalls, the kernel is expecting to have to leave space
for the function's return address. We need to duplicate this. It was
an accident that the rfork syscall actually worked here. :-/


# 64000 29-Jul-2000 peter

rfork(2) wrapper for simple rfork-style threads. I have lost count of
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.