Commit Graph

819 Commits

Author SHA1 Message Date
matt
6cf6fe02a9 New files for Userland support of UCB RISC-V (both 32-bit and 64-bit) 2014-09-19 17:36:24 +00:00
matt
27620987b8 New files for OR1K support 2014-09-03 19:34:25 +00:00
matt
11614bb2b2 MKCOMPAT fixes for when compat MACHINE_CPU != normal MACHINE_CPU 2014-08-10 23:25:49 +00:00
matt
beb9c6d1b5 Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
2014-08-10 05:47:35 +00:00
riastradh
6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
dholland
1e9d60e3bf typo 2014-03-12 07:32:46 +00:00
matt
1de2b6f186 This is no different from the 32bit powerpc one.
Remove the redundancy.
2014-03-07 07:26:42 +00:00
rmind
2e17c78b61 pthread__mutex_lock_slow: fix the handling of a potential race with the
non-interlocked CAS in the fast unlock path -- it is unsafe to test for
the waiters-bit while the owner thread is running, we have to spin for
the owner or its state change to be sure about the presence of the bit.
Split off the logic into the pthread__mutex_setwaiters() routine.

This is a partial fix to the named lockup problem (also see PR/44756).
It seems there is another race which can be reproduced on faster CPUs.
2014-02-03 15:51:01 +00:00
christos
cdce479a47 remove compatibility code for handling CLOCK_MONOTONIC and handle it in the
syscall directly.
2014-01-31 20:44:01 +00:00
christos
de79b4937c PR/44756: Sad Clouds: Prevent leakage of errno = ESRCH from _lwp_park. This
has two parts:
	- in pthread_cond_timedwait() if the thread we are trying to unpark
	  exited, retry the the _lwp_park call without it.
	- pthread_mutex() was affecting errno since it is calling _lwp_park()
	  from pthread_mutex_lock_slow(). preserve the original errno.
Note that the example problem still causes an occassional deadlock on machines
with many CPUs and it is the same deadlock we observe with named.
2014-01-31 19:22:00 +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
matt
77f07e0bd7 Use the thumb1 versions of sev/wfe for thumb && armv6+.
if using armv5t don't do anything for thumb.
2013-08-15 22:37:29 +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
wiz
a5684d07dd Use Mt for email addresses. 2013-07-20 21:39:55 +00:00
christos
53c7ca1dc2 s/inherited/inherit/ 2013-05-10 21:06:14 +00:00
christos
bbae94036a bump for pthread_cond_setclock 2013-04-03 15:45:21 +00:00
christos
5ef4443346 for safety, declare mono on the outermost block it is used. 2013-04-01 13:28:21 +00:00
christos
1f8d3d6eb5 PR/47703: Yasushi Oshima: pthread_cond_timedwait() does not wait
after call pthread_condattr_setclock(CLOCK_MONOTONIC)

_lwp_park(2) expects a realtime clock, and it gets passed a monotonic
one.  Since monotonic < real, it never sleeps. This patch adjusts
the monotonic clock to be a real one before it passes is to
_lwp_park(2). This is the minimal hacky fix and it will be fixed
properly in _lwp_park(2) in the future.

XXX: pullup to 6.
2013-03-28 18:07:12 +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
yamt
a74bc62145 add comments
whitespace
2013-03-06 11:31:34 +00:00
yamt
93af5b695c add assertions 2013-03-06 11:30:56 +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
dsl
2bf5f9db37 Don't rely on sys/lwp.h includeing sys/resource.h for us. 2013-01-01 18:42:39 +00:00
christos
fe230c9d39 Don't call the destructor in pthread_key_delete() following the standard. 2012-11-22 08:32:36 +00:00
christos
55f47ec332 Replace the simple implementation of pthread_key_{create,destroy}
and pthread_{g,s}etspecific functions, to one that invalidates
values of keys in other threads when pthread_key_delete() is called.
This fixes chromium, which expects pthread_key_delete() to do
cleanup in all threads.
2012-11-21 19:19:24 +00:00
christos
cb292d56ab add argsused 2012-11-14 23:25:05 +00:00
uwe
ed34834025 Mark up (unsupported) PTHREAD_PROCESS_SHARED with .Dv macro. 2012-11-12 23:34:50 +00:00
uwe
7fe27706ff Refer to init_routine in the DESCRIPTION section with .Fa instead of .Fn 2012-11-12 23:28:11 +00:00
uwe
b5c99d4306 Use
.Vt type var No = Dv INITIALIZER;

to provide examples of static initialization in SYNOPSIS section.
.Va macro does the wrong thing (check groff PostScript output) and the
need for .Pp kludge (now dropped) should have been an indication too.

While here move static initialization example to be right after the
declaration of *_init().
2012-11-12 23:11:05 +00:00
uwe
b89e4203ae Each get function "has" a set counterpart, it doesn't "contain" it. 2012-11-10 23:12:36 +00:00
apb
9d94c0263d Remove duplicate "const" modifier found by clang -Wduplicate-decl-specifier 2012-11-06 09:03:03 +00:00
rmind
d79b47c370 libpthread: replace the use of obsolete sys/tree.h interface with rbtree(9). 2012-11-03 23:42:27 +00:00
wiz
2268525138 Fix pasto. 2012-11-03 09:20:36 +00:00
christos
2a29ccd3da add pthread_condattr_setclock(3) 2012-11-03 03:10:50 +00:00
christos
284dc1a8fd cast return of sysconf 2012-11-03 03:10:35 +00:00
matt
8837651bdf Use .inst instead of wfe/sev to shut up gas. 2012-09-19 07:57:14 +00:00
matt
426a76190c Only copy the ucontext_t in pthread_setcontext if _UC_TLSBASE is set.
Conditionalize the test on _UC_TLSBASE being defined.
2012-09-12 14:55:48 +00:00
manu
bba80928a8 setcontext() used to be incompatible with -lpthread since it affected
the TLS pointer, therefore wrecking the pthread environement.

Some ports had _UC_TLSBASE flag or equivalent (_UC_UNIQUE on alpha)
that controlled whether setcontext() would change the TLS pointer.
This change let libpthread override setcontext() with its own version
that unsets _UC_TLSBASE, enabling safe usage of setcontext() with
-lpthread.

We also have the following required changes here:
- rename alpha's _UC_UNIQUE into _UC_TLSBASE
- add _UC_TLSBASE definition in header file for all ports
  (powerpc, sh3, sparc and sparc64 lack the implementation for now)
- introduce a libc stub that can be overriden for setcontext()
- modify MD libcs swapcontext() implementations so that they use the
  setcontext() libc stub instead of doing a plain system call.

While we are there:
- document various MD _UC_* flags in header file
- add libc and libpthread tests for swapcontext() behavior
  (hopefully helpful to spot MD problems introduced with this change)

Future work:
- Deciding whether kernel support or _UC_TLSBASE should be added for
  powerpc, sh3, sparc and sparc64 is left to portmasters
  sparc64

Approved by core@
2012-09-12 02:00:51 +00:00
matt
2f1e74f8c5 Add a pthread__smt_wake and add support for it on arm along with
pthread__smt_pause.  These are implemented using the ARM instructions
SEV (wake) and WFE (pause).  These are treated as NOPs on ARM CPUs that
don't support them.
2012-08-16 04:49:47 +00:00
drochner
b0ce37c2b0 return errno if pthread_create hits the system limit, not just -1
(this is not entirely correct because it can return ENOMEM which is
not mentioned in the spec, but there are other places in pthread_create
whete ENOMEM is returned -- it at all, this should be fixed everywhere)
2012-08-15 13:28:32 +00:00
matt
234b053454 -Wfoo goes into CWARNFLAGS 2012-08-04 15:13:09 +00:00
joerg
0645d95b42 Prefer sysconf to obtain number of CPUs. 2012-08-02 12:43:41 +00:00
joerg
74a7f3e6f2 Do not mark pthread_cond_timedwait explicitly as inlineable, since it
calls pthread__self, which is static.
2012-06-15 19:20:44 +00:00
joerg
8050d45d71 Simplify check for TLS definition to not hide code. Drop it in another
place as it is redundant.
2012-05-04 12:26:33 +00:00
enami
3cdda33922 Store allocated lwpctl state in the thread actually forked,
which is the only thread lives in the child process.

The problem originally reported here:
  https://bugs.ruby-lang.org/issues/6341
2012-04-26 00:21:44 +00:00
christos
5662c2716e trailing whitespace police. 2012-04-04 17:47:03 +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
agc
76f4f39125 Add a pthread cancel stub for sigwait, following Onno van der Linden's
analysis in PR 45131.  Kindly tested by Hisashi T Fujinaka (using csup
as the test case) with a successful outcome.

OK martin@
2012-04-04 06:29:16 +00:00