When the syscall number has to be loaded from a pc-relative location,abuse END macros to place the number at the end of the syscall wrapperrather than in the middle of it, so that there is no need
When the syscall number has to be loaded from a pc-relative location,abuse END macros to place the number at the end of the syscall wrapperrather than in the middle of it, so that there is no need to brancharound it; this saves two instructions per syscall number >= 128.While there, also tweak the error return (SET_ERRNO_AND_RETURN) to onlyreturn a 64-bit value for lseek; this saves another instruction forall other syscalls.With input from guenther@; "Anything that makes the machine faster" deraadt@
show more ...
Populate the non-LOAD openbsd.syscalls section (and PT_OPENBSD_SYSCALL)with {uint offset, uint syscall#} entries in libc & ld.so.In libc a few syscall# entries (break, sigprocmask, _tfork, _threxit
Populate the non-LOAD openbsd.syscalls section (and PT_OPENBSD_SYSCALL)with {uint offset, uint syscall#} entries in libc & ld.so.In libc a few syscall# entries (break, sigprocmask, _tfork, _threxit)are duplicated because additional or inline uses occur (that situationis handled elsewhere)ok kettenis
_C_LABEL() and _ASM_LABEL() are no longer useful in the "everythingis ELF" world. Eliminate use of them in landisk code.ok deraadt@
Use a shorter system call invocation template for system calls in the range0-127, where immediate addressing can be used to load the system call numberin r0, rather than performing a memory load us
Use a shorter system call invocation template for system calls in the range0-127, where immediate addressing can be used to load the system call numberin r0, rather than performing a memory load using pc-relative addressing.No functional change, but rm(1) runs a couple cycles faster per file now.
Consistently reference '_end' instead of 'end' in the brk/sbrk implementationok deraadt@
Save and restore 'gbr' register when enter/leaving the kernel, and useit for the TCB pointer. Eliminate __cerror."looks good" kettenis@, testing and ok deraadt@
Remove sigreturn declaration and the now-unused libc syscall stub
Use a Thread Information Block in both single and multi-threaded programs.This stores errno, the cancelation flags, and related bits for each threadand is allocated by ld.so or libc.a. This is an
Use a Thread Information Block in both single and multi-threaded programs.This stores errno, the cancelation flags, and related bits for each threadand is allocated by ld.so or libc.a. This is an ABI break from 5.9-stable!Make libpthread dlopen'able by moving the cancelation wrappers into libcand doing locking and fork/errno handling via callbacks that libpthreadregisters when it first initializes. 'errno' *must* be declared via<errno.h> now!Clean up libpthread's symbol exports like libc.On powerpc, offset the TIB/TCB/TLS data from the register per the ELF spec.Testing by various, particularly sthen@ and patrick@ok kettenis@
This is sigprocmask, not sigpending.
Merge the sigaction() and sigprocmask() overloads/wrappers from libpthreadinto libc, and move pthread_sigmask() as well (just a trivial wrapper).This provides consistent handling of SIGTHR between
Merge the sigaction() and sigprocmask() overloads/wrappers from libpthreadinto libc, and move pthread_sigmask() as well (just a trivial wrapper).This provides consistent handling of SIGTHR between single- and multi-threadedprograms and is a step in the merge of all the libpthread overloads, providingsome ASM and Makefile bits that the other wrappers will need.ok deraadt@ millert@
Adds hidden _libc_FOO aliases for the system call stubs.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 sym
Adds hidden _libc_FOO aliases for the system call stubs.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.alpha, arm, m88k, sh, sparc, and vax assistance miod@hppa assistance kettenis@ok deraadt@ miod@
Hide many (194!) symbols that nothing should be using.Delete exect(2); it wasn't portable across archs and nothing used it.ports test build by naddy@ok deraadt@ kettenis@
Make pthread_atfork() track the DSO that called it like atexit() does,unregistering callbacks if the DSO is unloaded. Move the callbackhandling from libpthread to libc, though libpthread still ove
Make pthread_atfork() track the DSO that called it like atexit() does,unregistering callbacks if the DSO is unloaded. Move the callbackhandling from libpthread to libc, though libpthread still overrides theinner 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 childfor a long time, so there's no need to test the second return register herein the asm stub.ok and testing of many arch
Simplify fork/vfork logic: the kernel has handled returning zero in the childfor a long time, so there's no need to test the second return register herein the asm stub.ok and testing of many archs by krw@ miod@
Remove #ifdef _REENTRANT code that isn't used here. These days, the codehandling per-thread errno lives in librthread.ok miod@, espie@
Convert cpp | as rules in bsd.lib.mk and lib/libc/sys/Makefile.inc to pure ccinvocations. This allows us to use the compiler builtin define __PIC__ to checkfor PIC/PIEness rather than passing -DPI
Convert cpp | as rules in bsd.lib.mk and lib/libc/sys/Makefile.inc to pure ccinvocations. This allows us to use the compiler builtin define __PIC__ to checkfor PIC/PIEness rather than passing -DPIC. Simplifies PIE work a lot.ok matthew@, conceptually ok kurt@
adapt the NetBSD code to make sigpending work on shok miod@ kettenis@
__tfork() needs to set the stack address of the new thread in the kernel,so that it can't get a signal while still running on the parent thread'sstack. Also, pass in sizeof(struct __tfork) to prov
__tfork() needs to set the stack address of the new thread in the kernel,so that it can't get a signal while still running on the parent thread'sstack. Also, pass in sizeof(struct __tfork) to provide forward compatwhen more members are added. This is an ABI change, so switch syscallnumbers and bump lib majors this time.ok deraadt@ matthew@
remove rfork(); ok guenther miod
Move __tfork_thread() from rthreads (libpthread) to libc so thatit can be used for not-strictly-threading purposesok matthew@ kurt@
Move __cerror to ___cerror with a weak alias so that rthreads can override it.On mips64, also correct the name called from plain cerror to __cerror."looks correct" miod@
Dont double fork, and since the assembles the same, use -1, instead of 0xffto subtract one.
Preliminary userland bits for OpenBSD/landisk, many things coming fromNetBSD.