Commit Graph

335 Commits

Author SHA1 Message Date
kent
63a8cde231 save&restore %fs and %gs registers for USER_LDT applications.
PR#26900
2004-11-10 01:12:57 +00:00
fvdl
5febc5eef5 Fix thread context switching to take the stack ABI into account.
From Wolfgang Solfrank.
2004-10-21 16:49:47 +00:00
mycroft
2b4ccae3e9 Remove pt_blockuc. If the debugger attempts to muck with the state of a
blocked thread, return an error; this should be done through ptrace(2).
2004-10-12 22:17:56 +00:00
nathanw
7c7a36f21d In nanosleep(), loop until the timer fires or a signal is taken; other
spurious wakeups (such as those caused by gdb) should not cause
nanosleep to return prematurely.
2004-08-24 02:08:08 +00:00
nathanw
f83d3766b4 Mark when a thread has taken a signal. 2004-08-24 01:46:30 +00:00
nathanw
3f53b40ca7 Local whitespace police. 2004-08-24 01:45:54 +00:00
nathanw
15c2d9148c Add a flag that indicates that a thread took a signal. 2004-08-24 01:44:08 +00:00
rearnsha
cd8021f51e Use RET macro for returning. 2004-08-21 11:31:44 +00:00
chs
c6736a59b3 redo the fix for PR 26392 differently: instead of changing the stack bounds
for the initial stack, just change the initial thread's pt_uc to point to
the opposite end of the stack (away from the argv, environment, etc).
2004-08-17 14:16:00 +00:00
yamt
6b2b9c625f - fix pthread_detach with an already exit'ed thread.
namely, put the thread to deadqueue rather than just leaking it.
- fix a race between pthread_detach/join and pthread_exit,
  which also causes dead thread leaks.
2004-08-12 10:54:13 +00:00
yamt
129567b88f pthread_rwlock_timedrdlock/pthread_rwlock_timedwrlock:
fix lock/unlock inversions in ERRORCHECK.
2004-08-03 11:50:45 +00:00
yamt
5fc4e57d71 pthread_rwlock_timedwrlock: return ETIMEDOUT appropriately. 2004-08-03 11:40:24 +00:00
nathanw
8bf7374bcf In cond_wait() and cond_timedwait(), do the ERRORCHECK testing of the
waiters list in all cases, not just on cancellation; there are other
sources of spurious wakeups, such as single-stepping in the debugger.

regress/lib/libpthread/conddestroy1 now passes.
2004-07-27 21:44:48 +00:00
chs
503ca60040 in pthread__initmain(), don't reuse the part of the initial stack that
is occupied by the argv and environment (and MD stuff like the page-table
mapping on x86).  fixes PR 26392.
2004-07-25 23:22:43 +00:00
he
b17ac49bb1 Cast result of pthread__uc_pc() via intptr_t before using as a pointer.
Fixes compile problem for evbsh5.
2004-07-20 12:40:53 +00:00
chs
6c4049f2ff fix some stack-pointer math in the previous revision. 2004-07-20 01:51:49 +00:00
chs
e348d7e175 add hppa MD libpthread bits. translated from MIPS. 2004-07-19 03:39:02 +00:00
chs
94a458cedd enhance MI pthreads code to support hppa:
- statically initialize all global spin locks.  on hppa, 0 means
   the lock is held, so leaving them with the default value doesn't work.
 - compare functions pointers using a function-pointer type rather than
   an integral type.  on hppa, function pointers may be indirect,
   so we need to trigger gcc to emit calls to the function-pointer
   canonicalization routines in the millicode.
 - on hppa the stack grows up, so handle that using the STACK_* macros.
2004-07-18 21:24:52 +00:00
nathanw
cb111b5e34 When _SOFT_FLOAT is defined, don't save or restore user FP context.
(note: still needs some mk rules tweaking for MKSOFTFLOAT=yes to pass
-msoft-float to asm builds).
2004-07-10 20:57:00 +00:00
nathanw
821dde500e Fix a comment to say "Edit" instead of "Exit". 2004-07-07 18:21:33 +00:00
simonb
b4f0be566a Catch up with changes to __fpregset_t.
In __longjmp14(), copy the FP CSR from the correct array and array slot.

Completes fix for PR port-mips/25942.
2004-07-03 05:10:06 +00:00
drochner
0e6c93b9fa const'ify the arguments to pthread__assertfunc and _errorfunc;
needed because the __func__ pseudo-var is strictly "const*" in gcc-3.4
2004-06-25 16:33:32 +00:00
nathanw
47513cedb9 If the sleep sleeps for its full time and rmtp is non-NULL, clear it;
sleep(3) expects this, even though it's not a documented property of
nanosleep().

Fixes a problem where sleep() in a threaded program would return
nonzero even on success.
2004-06-24 22:18:11 +00:00
christos
93b9ee2332 simplify and make more efficient (YAMAMOTO Takashi) 2004-06-03 19:32:27 +00:00
nathanw
44a1e00a08 Remove a comment made obsolete by the previous commit. 2004-06-02 22:39:52 +00:00
pooka
aff31bed2f pthread_spin_lock.3 also describes pthread_spin_trylock(),
so link them together
2004-06-02 14:07:07 +00:00
uwe
521748fbfa Fix typo in comment. 2004-05-28 22:58:25 +00:00
christos
556949a68e Oops, forgot to commit this. 2004-05-24 01:20:17 +00:00
christos
7168861fac Provide access to _res in the non-threaded case, and abort in the threaded
case.
2004-05-22 15:44:26 +00:00
kleink
6b3fbf5d75 IEEE Std 1003.1-2001/Cor 2-2004, item XSH/TC2/D6/5: fdatasync() shall
have cancellation points.

Note: we ride today's resolver-related version bumps.
2004-05-21 17:15:42 +00:00
christos
627129c2d3 bump the version of this too. 2004-05-21 04:09:13 +00:00
christos
9b99e159b4 add pool code for res state.
XXX: could be more efficient.
2004-05-21 03:40:51 +00:00
kleink
5a6f0c93e7 In the nothread version, don't return EINTR if select() was interrupted
since this value is explicitly ruled out by POSIX.  Instead, return 0,
like a spurious wakeup.  From YAMAMOTO Takashi in PR standards/24240.
2004-05-03 09:13:34 +00:00
simonb
9bc855a931 s/the the/the/ (only in sources that aren't regularly imported from
elsewhere).
2004-04-23 02:58:27 +00:00
lha
8b387b156a Fix a problem where pthread_kill can set a signal while the process
have the signal blocked, this ends up making target thread getting
later stuck in a loop if it uses pthread_sigmask.

ok, cl and christos
2004-03-24 20:01:37 +00:00
he
99f69b6c5f It appears that <sys/lock.h> requires <sys/types.h>, so include that as well. 2004-03-14 12:49:31 +00:00
cl
f3f745b9af fix comment for recent pthread_stack* var rename 2004-03-14 01:20:01 +00:00
cl
f2f106648c add libpthread part of concurrency support for SA on MP systems
- enable concurrency according to environment variable PTHREAD_CONCURRENCY
- add idle VP wakeup if there are additional jobs and idle VPs
- make reidlequeue per VP
- enable spinning for locks
- fix race condition in alarm processing
- fix race condition in mutex locking
- make debugging output line buffered and add VP prefix to debug lines
2004-03-14 01:19:41 +00:00
thorpej
1cda93b426 Use the new RAS_*() macros. 2004-03-03 21:06:07 +00:00
wiz
85746c6759 Spell interrupt with two rs. From Peter Postma. 2004-02-24 15:16:04 +00:00
wiz
f05e6f1a3a occured -> occurred. From Peter Postma. 2004-02-24 15:12:51 +00:00
wiz
d20841bb64 Uppercase CPU, plural is CPUs. 2004-02-13 11:36:08 +00:00
nathanw
94fc83a6be Add ucontext conversion macros for an "extra" register set. 2004-02-11 21:04:10 +00:00
nathanw
0a6afcc70d Rename pt_stacksize, pt_stacksize_lg, and pt_stackmask to pthread_*. External
symbols can't start with pt_, as that is in the application namespace.
2004-02-02 20:36:18 +00:00
kleink
9f0429b6cc ; may be a comment character in assembly, use \n as a separator instead.
This instance spotted by Martin Husemann.
2004-01-19 16:18:33 +00:00
cl
359b937c80 - delay making a thread unblocked until it's put on the runqueue.
- simplify handling of blocked idle threads.

This should fix the ``assertion "target->pt_state != PT_STATE_RUNNING
|| target->pt_blockgen != target->pt_unblockgen" failed'' problem
reported by Marc Recht and Steve Bellovin on current-users.

Also g/c unused pthread__sched_bulk call left over from pthread_sa.c
rev. 1.22 change.
2004-01-16 15:23:31 +00:00
cl
c8017c0dc6 - add deadlock check to pthread_rwlock_wrlock and pthread_rwlock_timedwrlock
- return EPERM when unlocking a lock which isn't held
=> prevent the failure in PR 24023, where the citrus code had a deadlocking
   code path

- remove deadlock check in pthread_rwlock_tryrdlock, return EBUSY instead
=> makes pthread_rwlock_tryrdlock standards compliant
2004-01-09 18:08:28 +00:00
cl
f35871411a make siglongjmp out of a signal handler work:
- strong alias __sigprocmask14 to pthread_sigmask
- call _sys___sigprocmask14 where appropriate
- make pthread_sigmask not set the signal mask lazily when pthreads
  aren't started yet
2004-01-02 19:24:44 +00:00
cl
33622a5943 userland part of no-syscall upcall stack return
- add pt_stackinfo to struct __pthread_st
- add pthread__stackinfo_offset returning the offset from ss_sp to
  pt_stackinfo
- pass stackinfo_offset to sa_register and set SA_FLAG_STACKINFO to
  make the kernel use it
- call pthread__sa_recycle in pthread__resolve_locks; g/c recycleq and
  pthread__recycle_bulk
- return stack in pthread__sa_recycle by incrementing sasi_stackgen
- make pthread__sa_recycle debugging output formatting conditional on
  pthread__debug_newline
2004-01-02 19:14:00 +00:00
cl
90e89977d4 - libc.so.12.109 and libpthread.so.0.4
- add ssize_t stackinfo_offset argument to sa_register syscall
- remove sa_unblockyield syscall
- make __sigprocmask14 syscall weak
- in pthread__sa_start: catch up with 4-argument sa_register syscall
2004-01-02 18:56:39 +00:00