Commit Graph

98 Commits

Author SHA1 Message Date
rin ea48808d5f libpthread/Makefile: trailing whitespace 2023-09-14 03:17:02 +00:00
lukem cfee6e9176 fix rump URLs
Link to https://github.com/rumpkernel/ instead of
a site now taken over by an SEO squatter.

Per discussion on github.com/rumpkernel issues with pooka.

PR misc/57501
2023-07-14 23:28:01 +00:00
joerg 76c7fc5f6b Update LLVM to 10.0.0git (01f3a59fb3e2542fce74c768718f594d0debd0da) 2019-11-11 22:44:56 +00:00
brad 2e0a32871b Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}.  The general effect is to move them
from /usr/lib to /lib.  Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.

Run tested on amd64 and i386 and compile tested on evbarm.
2019-09-22 18:45:19 +00:00
maya 07975b2231 Make CLEANFILES actually work. .TARGET is not defined when not in a target
rule.

Thanks xtos for the heads up.
2019-05-07 18:45:37 +00:00
maya 53af5ae4cc Replace the link command for libpthread.a so that we create a single section
with all the libpthread symbols in it.
This makes -lpthread behave like to -Wl,--whole-archive -lpthread.

This avoids a situation where threaded static binaries use some libc thread
stubs, which are racy.

Fixes PR lib/54001: call_once2_32, call_once2_static test cases failing on
amd64 since gcc7 import.

Suggested by Jonathan Wakely, thanks!
2019-05-07 18:12:53 +00:00
kamil a9ca1710c0 Add a complete C11 threads(3) implementation
C11 Thread support library is a portable threading C API between OSs,
similar to std::threads in the C++ world.

The library is implemented as a thin shim over POSIX interfaces.

NetBSD implements the API as a part of the POSIX threading library
(libpthread(3)).

C11 threads(3) are in the process of making them an integral part
of the POSIX standard. The interface has been implemented in major
OSs and used with stopgap libraries for older versions of them.

C11 threading library is already used (with a stopgap implementation)
in the NetBSD distribution in MESA.

Original implementation by myself from 2016.

ATF tests are new and cover almost all interfaces.

Proposed on tech-userlevel@.
2019-04-24 11:43:19 +00:00
thorpej 68e270a267 Implement support for "pshared" POSIX semaphores.
Fixes lib/53273 (and Firefox's multi-process tab feature).
2019-02-03 03:20:23 +00:00
christos aa66956410 But set NOSANITIZER 2018-06-09 23:45:56 +00:00
christos 64715b9aa8 We can't build those three with MKSANITIZER, they are used too early. 2018-06-09 22:41:55 +00:00
chs 9f52f2295e remove hard-coded -fomit-frame-pointer for pthread stuff,
let these use the same setting as the rest of the tree.
the performance difference is marginal and this allows
dtrace ustack() to work better.
2018-02-25 18:51:18 +00:00
christos 7cf7644fc7 GSoC 2016 Charles Cui: Implement thread priority protection based on work
by Andy Doran. Also document the get/set pshared thread calls as not
implemented, and add a skeleton implementation that is disabled.
XXX: document _sched_protect(2).
2016-07-03 14:24:58 +00:00
christos d394d2a9b5 Add pthread_getcpuclockid(3) 2016-04-23 23:12:19 +00:00
pooka 082d249a16 Allow for arbitrary MI scheduler implementations.
A concrete result is enabling unpatched libpthread to run on the
rumprun stacks (e.g. Xen and bare metal) with a non-NetBSD scheduler.
Those schedulers hook into the existing _lwp_frobnitz() NetBSD syscall
interfaces (well, "syscall" interfaces in that scenario ;)

More specifically about the change itself:

1) instead of calling _lwp_makecontext() followed by _lwp_create()
   and passing the entry point in ucontext_t (MD) through the calls, roll
   the calls into pthread__makelwp() and allow alternate implementations
   for that MI interface.

2) allow compile-time overriding of __lwp_gettcb_fast() or
   __lwp_getprivate_fast, which are inline and leak MD scheduler/thread
   details into libpthread


Additionally, two small nits:

I)  define LIB=pthread before including mk.conf so that it's possible
    to test for LIB==pthread in mk.conf

II) make it possible to leave out pthread_cancelstub.c.  This is required
    by the current implementation of rumprun-posix (i.e. rumprun on
    POSIX hosts) due to symbol collisions.  It needs to be fixed properly
    some day, but for now allows an almost-correct libpthread to run.
    I am sure @justin will be happy to explain the details ;)


no change to NetBSD
tested: anita+atf
2014-12-16 20:05:54 +00:00
matt 11614bb2b2 MKCOMPAT fixes for when compat MACHINE_CPU != normal MACHINE_CPU 2014-08-10 23:25:49 +00:00
matt fa741d8823 Use MACHINE_CPU for m68k. Use similar logic for both tests. 2013-10-09 22:33:41 +00:00
matt 06cb4b73b7 Add support for an optional ARCHSUBDIR/Makefile.inc 2013-08-15 22:38:24 +00:00
joerg a6c6eb019c Some architectures can't create unwind tables without the frame pointer,
so don't use -fomit-frame-pointer on those.
2013-08-12 17:15:46 +00:00
christos 71d484f921 - Allow libpthread to be dlopened again, by providing libc stubs to libpthread.
- Fail if the dlopened libpthread does pthread_create(). From manu@
- Discussed at length in the mailing lists; approved by core@
- This was chosen as the least intrusive patch that will provide
  the necessary functionality.
XXX: pullup to 6
2013-03-21 16:49:11 +00:00
apb 6cee3c7cf5 Explain what PTHREAD__COMPAT is for. This comment in
src/libpthread/Makefile is adated from a comment in
src/doc/CHANGES.prev.
2013-02-25 17:04:46 +00:00
riastradh d86328195e Add pthread_condattr_setclock(3) man page link. 2013-01-31 20:57:58 +00:00
matt 234b053454 -Wfoo goes into CWARNFLAGS 2012-08-04 15:13:09 +00:00
joerg b757af438b Disable new -Wstring-plus-int warning where needed for now.
Adjust various places that add GCC-only options to check for the active
compiler first.
2012-04-04 10:59:44 +00:00
matt fa835e8c8b These directories default to WARNS?=5 2012-03-21 05:37:42 +00:00
joerg 77bfe129a9 Move pthread_once implementation into a separate file, it doesn't depend
on the mutex implementation in any way.
2012-03-12 21:35:10 +00:00
yamt 9c5d9163d1 document pthread_curcpu_np 2011-11-10 14:01:11 +00:00
christos 5353040f23 document non-literal format strings 2011-08-16 10:35:03 +00:00
skrll f1d73a2c94 Add support for DF_1_BIND_NOW, DF_1_NODELETE and DF_1_NOOPEN marked
objects, and the RTLD_NODELETE and RTLD_NOLOAD flags to dlopen(3).

Mark libpthread as DF_1_NOOPEN and use it to test the functionality.

Somewhat taken from FreeBSD.

Fixes PR 42029.

OK from christos and joerg.
2010-12-24 12:41:42 +00:00
christos ea1f852ab8 document pthread_getattr_np 2010-08-06 05:35:42 +00:00
jruoho 6aa4892177 Rationalize by moving
pthread_key_delete(3) to pthread_key_create(3); and
	pthread_setspecific(3) to pthread_getspecific(3)
2010-07-09 08:22:04 +00:00
jruoho 3cc3be4df9 Rationalize by moving
pthread_attr_setname_np(3) to pthread_attr_getname_np(3); and
	pthread_setname_np(3) to pthread_getname_np(3).
2010-07-09 07:31:01 +00:00
jruoho ec0cdba3c9 Group also pthread_attr_getschedparam(3) and pthread_attr_getschedpolicy(3),
as these two pages fit well together.
2010-07-08 22:19:26 +00:00
rmind d199be9733 Merge/group man pages:
- pthread_barrier_{init,destroy,wait} into pthread_barrier(3).
- pthread_cond_* into pthread_cond(3).
- pthread_mutex_* into pthread_mutex(3).
- pthread_rwlock_* into pthread_rwlock(3).
- pthread_spin_* into pthread_spin(3).
Cross-link amongst groups.
OK jruoho@
2010-07-08 19:20:16 +00:00
jruoho 1540fc21ba Finally, split pthread_attr_getschedpolicy() and pthread_attr_setschedpolicy()
to their own page.
2010-07-07 16:22:30 +00:00
jruoho edddb28a67 Split pthread_attr_getschedparam() and pthread_attr_setschedparam() to a
separate page.
2010-07-07 16:04:19 +00:00
jruoho cf6053f7b6 Split pthread_attr_getinheritsched() and pthread_attr_setinheritsched() to a
separate page, and actually document these.
2010-07-07 15:30:32 +00:00
jruoho 904af291c8 Move pthread_attr_getguardsize() and pthread_attr_setguardsize() to a
separate page, and actually document these.
2010-07-07 13:04:20 +00:00
jruoho 2bf45345db Move the thread stack attribute functions to a separate page. In addition,
document pthread_attr_getstack() and pthread_attr_setstack(). Try to also
document these a little better (in particular, note some items in the long
list of caveats and questions related to application-controlled thread stack).
2010-07-07 11:04:52 +00:00
jruoho dbb0e63cfb Split pthread_attr_getdetachstate(3) and pthread_attr_setdetachstate(3) to a
separate page. Once ready, the main page, pthread_attr(3), will contain a
summary of the various thread attribute functions.
2010-07-07 08:57:36 +00:00
jruoho 69ff1aa9c5 Move pthread_attr_{g,s}etscope() to a separate page and try to document
these better. Should fix PR lib/41831 from Wolfgang Stukenbrock.

XXX: Please proofread.
2010-07-07 08:22:53 +00:00
jruoho 935deb263f Document pthread_attr_get_np(). Fixes PR lib/39289 from ahoka@. 2010-07-06 21:36:34 +00:00
jruoho 9bfaa34d66 Build links for rest of the pthread_attr(3) functions.
Hopefully I got all of them right in the setlist...
2010-05-19 20:04:42 +00:00
ad a61915e94f Remove unused code that's confusing when using cscope/opengrok. 2009-05-16 22:20:40 +00:00
mrg fb8d95d826 check for ${PTHREAD_MACHINE_ARCH} before ${MACHINE_ARCH} or ${MACHINE_CPU} 2008-10-26 00:00:27 +00:00
ad fdc51b51d9 Adjust the compat stuff slightly so that the changes are mostly self
contained (Makefile, pthread_compat.c).
2008-10-08 08:27:07 +00:00
ad 844fcfc979 make PTHREAD__COMPAT=1
Builds a libpthread that can be dropped into a NetBSD 2/3/4 chroot.

This makes threading work in the chroot when using a NetBSD 5 kernel, no
other modifications required.
2008-09-29 08:48:15 +00:00
rmind e6acd90e07 - Add affinity(3) manual page, which describes thread affinity,
pthread_setaffinity_np(3) and pthread_getaffinity_np(3) functions,
  provides simple code example.
- Add cpuset(3) manual page, which describes API of CPU-sets.

Thanks <wiz> for many improvements!
2008-06-16 14:25:49 +00:00
rmind 2ac12931eb Add sched(3) manual page, and appropriate links.
Thanks <wiz> for review and fixes!
2008-03-10 14:47:06 +00:00
ad a67e1e3475 - Remove libpthread's atomic ops.
- Remove the old spinlock-based mutex and rwlock implementations.
- Use the atomic ops from libc.
2008-02-10 18:50:54 +00:00
rmind 5c71a4d49f Implementation of processor-sets, affinity and POSIX real-time extensions.
Add schedctl(8) - a program to control scheduling of processes and threads.

Notes:
- This is supported only by SCHED_M2;
- Migration of LWP mechanism will be revisited;

Proposed on: <tech-kern>. Reviewed by: <ad>.
2008-01-15 03:37:10 +00:00