Commit Graph

185 Commits

Author SHA1 Message Date
uwe ea81adf86a Not that the branch in SETC doens't have a delay slot, remove the
.empty comment as it's no longer pertinent.
2003-07-05 23:01:25 +00:00
marcus 4e24351384 PIC patch from Valeriy E. Ushakov applied.
Also, removed bogus delay slot flag from branch instruction.
2003-07-05 22:50:09 +00:00
marcus cccf9dfce5 The field "pt_sleepuc" doesn't exist in struct pthread_st. 2003-07-05 21:27:23 +00:00
skrll ec57ccf92d Typos in comments. 2003-07-04 15:16:14 +00:00
wiz cf10d78423 Remove superfluous word. 2003-07-04 11:59:34 +00:00
wiz 3261c36039 Add comma. 2003-07-04 11:57:58 +00:00
wiz c9b0edd1ba Remove superfluous word. 2003-07-04 11:57:17 +00:00
wiz df617ae85c Fix typo. 2003-07-04 11:55:58 +00:00
wiz 9edf05479a Mark up a defined value. 2003-07-04 11:47:03 +00:00
wiz 63e8a90e85 New sentence, new line. 2003-07-04 10:19:42 +00:00
wiz 7398828105 Fix typo. 2003-07-04 10:18:46 +00:00
wiz 1e15cda14b > -> \*[Gt] 2003-07-04 08:43:33 +00:00
wiz 5b1fed0bc5 Sort sections. 2003-07-04 08:42:57 +00:00
wiz f84167245a .Pp fixes. 2003-07-04 08:42:20 +00:00
wiz 2f56847e01 Fix SEE ALSO. 2003-07-04 08:41:25 +00:00
wiz ba587118af Drop trailing whitespace. 2003-07-04 08:36:06 +00:00
wiz 7dd0ed6e01 We do not want empty lines in mdoc. 2003-07-01 10:23:52 +00:00
wiz 5231f1f288 Remove trailing whitespace. 2003-06-26 10:01:18 +00:00
nathanw 9639eeaf54 Adapt to pt_trapuc: change STACK_SWITCH to check for a value in pt_trapuc
and use it preferentially to a value in pt_uc, clearing it once on the new
stack. Move stores into pt_uc back to before the stack switch; storing
after the stack switch opened a one-instruction race condition where an upcall
that had just started a chain could be preempted again, and would bomb when
restarted due to its pt_uc not yet having been updated. Now that pt_trapuc
is what the upcall code writes to, it is safe to store to pt_uc before
switching stacks.

Remove obsolete pt_sleepuc code.
2003-06-26 01:45:31 +00:00
nathanw 487eb7e193 Initialize pt_trapuc in pthread__initthread(). 2003-06-26 01:30:39 +00:00
nathanw 1414a095ac Remove PT_SLEEPUC and add PT_TRAPUC. 2003-06-26 01:29:28 +00:00
nathanw 81a27fd0b2 Adapt to pt_trapuc: Store context obtained from upcalls there, clear it
in switchto targets and vitims, and print it in debug messages (including
indication of whether a context is trap or user context).

Remove obsolete pt_sleepuc handling.
2003-06-26 01:28:14 +00:00
nathanw 1af6125572 Clear pt_trapuc when idling threads. 2003-06-26 01:26:39 +00:00
nathanw 2534cd2bea Introduce a new pointer, pt_trapuc, that stores thread context captured
by the kernel. Separating this from pt_uc makes it possible to avoid a race
condition in pt_uc management near the STACK_SWITCH part of pthread__switch()
and pthread__locked_switch().

Remove pt_sleepuc pointer, which was made obsolete by the previous round of
UC juggling but still present in the assembler files.
2003-06-26 01:26:11 +00:00
nathanw 3ca7487c30 More printf format size tweaks. 2003-06-25 23:26:00 +00:00
nathanw 4a9ac109f0 Complain clearly if SA syscalls aren't avaliable. 2003-06-25 23:23:27 +00:00
nathanw 39f9ecfa06 Oops, reordering the PT_STATE/PT_SWITCHTOUC/PT_SWITCHTO assembly
killed a live value too soon. Fix by using a different register for
the PT_STATE immediate.
2003-06-24 18:54:56 +00:00
nathanw 96458e8892 Update the switch_return point name in the static case. 2003-06-23 22:50:23 +00:00
uwe b92f152573 First bits of SH3 support. Only _context_u.S is implemented (passess
cu[1-6] tests), the pthread_switch.S is stubbed out for now.

Code posted by Christian Groessler (cpg at aladdin dot de) to port-sh3.
2003-06-23 19:34:43 +00:00
martin f546abe798 Catch up with Nathan's changes to other archs. 2003-06-17 23:18:48 +00:00
nathanw 876d7e7eec Dodge a potential race condition in pthread__debuglog_printf(). It's
still possible for multiple threads to write into the same space, but
they shouldn't be able to corrupt the write pointer in the process.

Also, check for pointer-lapping a bit more carefully in the wrap
vs. non-wrap case.
2003-06-16 21:24:48 +00:00
martin aba86b525b Catch up with changes Nathan did to other archs. 2003-06-15 17:11:36 +00:00
scw 7d221cb560 Apply Nathan's switch-away fix and previous save-PT_UC from new stack fix. 2003-06-13 08:07:03 +00:00
scw 04f197eae9 Apply Nathan's switch-away fix and previous save-PT_UC from new stack fix.
Compile-tested only.
2003-06-13 07:45:17 +00:00
nathanw 4bd45b7b3b Oops, that's switch_return_point, not locked_return_point. The perils
of cut-and-paste.
2003-06-12 23:19:27 +00:00
nathanw aa6f5de228 STACKSPACE of 16 is too small, given the use of CALLFRAME_SIZ;
increase to match.
2003-06-12 23:01:17 +00:00
nathanw eb6ba6fbef Apply switch-away fix and previous save-PT_UC from new stack fix. 2003-06-12 23:00:28 +00:00
fvdl 1a31b8db4d Apply Nathan's switch-away fix. 2003-06-12 22:03:18 +00:00
nathanw b43f1c7405 In pthread__resolve_locks(), change the conditions for removing a normal
thread from the continuation chain: Not only must it have released all
spinlocks, but it must have signaled completion by finishing pthread__switch
or by having stored into pt_switchto.

Together with the previous pthread_switch.S changes, this fixes a couple of
crasehes caused by race conditions in the examination and use of pt_next,
and by switching to empty pt_switchtouc's.
2003-06-12 21:49:42 +00:00
nathanw f866ba061d Two fixes:
* In switch-away cases, write PT_SWITCHTO last (after PT_SWITCHTOUC), so
   that pthread__resolve_locks() doesn't see an empty SWITCHTOUC value. This
   also permits pthread__resolve_locks() to use the presence of PT_SWITCHTO
   as a sign that the thread has done all of its necessary chain work.

 * Make the return-point of pthread__switch global and visible, so that its
   address can be compared to the PC of a thread, again as a sign that its
   chain-work is done.

(other architectures in progress, after they get the *previous* asm fix...)
2003-06-12 21:46:03 +00:00
nathanw edc79413b1 Don't need to set the MSR field here; _INITCONTEXT_U_MD() takes care
of that where necessary.
2003-06-12 19:09:45 +00:00
thorpej e714d726a6 $NetBSD$, not $Header$. 2003-06-08 06:44:28 +00:00
nathanw 877f89857f Tiny bit of infrastructure for ABI-supported thread-ID storage. 2003-06-06 21:06:07 +00:00
nathanw 1809ee5c2c Fix typo in comment. 2003-06-06 19:35:03 +00:00
nathanw 33314cffa1 Make infrastructure for man pages. 2003-06-03 21:34:00 +00:00
nathanw 5581819638 Man pages for libpthread, adapted from FreeBSD by Stephen Degler. 2003-06-03 21:33:06 +00:00
nathanw 380bb3a8b0 Man pages for libpthread, written by Stephen Degler. 2003-06-03 21:31:36 +00:00
christos dc1665b80b Add pthread_attr_getstack{,size,addr} needed by jdk 2003-06-02 16:59:26 +00:00
christos 143f5a277a pass lint:
1. add new pthread__abort() and change pthread_assert(0) to it.
2. put constcond in the right place (in the macro).
3. no space after pthread__assert macro.
2003-05-27 15:24:24 +00:00
christos 4e29fa8276 add missing notreached lint comment. 2003-05-27 15:22:56 +00:00