Commit Graph

7918 Commits

Author SHA1 Message Date
cgd
57daa57e46 * fix handling of invalid arguments (was jumping to wrong label!)
(found by... running the regress test!)
* clean up punctuation.
* create a proper frame for the child fn that follows the o32 calling
  conventions.  In particular, leave 4 stack slots that the child
  fn can write on, put the GP above them, and invoke .cprestore
  properly in light of the child fn arg area.  (realized it was a
  problem upon inspection, verified using the regress test compiled
  -O0.)
2003-02-08 00:28:25 +00:00
cgd
351f7a02f1 looks like nobody ever seriously tried the _REENTRANT version of this
code (which, uh, seems the default for a fresh build)...  it wasn't
setting up v1 properly (the instruction to set up v1 was after the
return jump, in "reorder" code...  i.e.  after the end of the function).
That would break error returns from 64-bit syscalls (e.g. checks
in dd and who knows what else) to see if input or output are pipes.
It looks like the non-_REENTRANT version was broken (on the nathanw-sa
branch) in rev 1.9.2.1 and fixed in 1.9.2.2, but the _REENTRANT version
was never fixed, and the broken bits were merged back on to the trunk.
2003-02-07 20:35:05 +00:00
petrov
12784e54c3 Correct unsigned to float conversions, add license, adjust style. 2003-02-06 20:23:35 +00:00
jdolecek
ef9eed1dac pthread_kill() was implemented, remove from list
pthread_cond_timedwait() now works even before SA initialization, but some
other routines do not; update the paragraph for this
2003-02-06 09:55:47 +00:00
kleink
d58cfc7d35 Sprinkle some restrict. 2003-02-05 23:13:07 +00:00
gmcgarry
0d72c02993 Xref gencat(1) 2003-02-05 05:05:50 +00:00
perry
1f4ad37fe3 "Utilize" has exactly the same meaning as "use," but it is more
difficult to read and understand. Most manuals of English style
therefore say that you should use "use".
2003-02-05 00:02:24 +00:00
perry
8a49ec08e4 "Utilize" has exactly the same meaning as "use," but it is more
difficult to read and understand. Most manuals of English style
therefore say that you should use "use".
2003-02-04 23:07:28 +00:00
jdolecek
9cac4b3f36 minor whitespace changes 2003-02-04 20:14:10 +00:00
jdolecek
d644334729 update copyright dates and .Dd 2003-02-04 09:07:20 +00:00
jdolecek
ebec5a4dfb Introduce EVFILT_TIMER, which allows a process to establish an
arbitrary number of timers, both oneshot and periodic.

from FreeBSD
2003-02-04 09:05:42 +00:00
elric
1b4eceb53f When looking up gids with hesiod, use the gid map and fall back to the
group map.

Addresses PR lib/20145
2003-02-03 04:22:20 +00:00
kleink
71d7654509 Add sysconf(3) knobs for recent additions. 2003-02-02 20:33:05 +00:00
jdc
ea7837ba99 Redo the conflict calculation (again).
Assume that "me" clears all attributes apart from acs.
Problem noticed when working on window(1).
2003-02-02 17:54:38 +00:00
jdc
60f7009432 I was slightly too agressive removing clearok() in revision 1.8.
Add back a clearok(stdscr) for terminals where the startup sequence
doesn't clear the screen.
2003-02-02 17:52:29 +00:00
christos
45103cd2c0 delint (unsigned long long) -> (unsigned long) casts. 2003-02-02 02:29:59 +00:00
christos
acc1cc5b41 undo mallocvar.h change! 2003-02-02 02:25:50 +00:00
tron
edb9087c05 Include "sys/mallocvar.h" with "_KERNEL" defined in time to avoid
build failure because MALLOC_DECLARE() is not defined.
2003-02-01 21:12:25 +00:00
tron
6b521c7489 Fix build problem by rearranging the order of "#include" statements so
that "sys/mallocvar.h" gets include while "_KERNEL" is defined.
2003-02-01 17:22:44 +00:00
martin
912ab5ad59 Check how the compiler expects the return value of this function
by testing SOFTFLOATSPARC64_FOR_GCC.

Should fix PR port-sparc64/20140.
2003-02-01 09:19:58 +00:00
nathanw
34c915eb3d Revert the conversion to libpthread's recursive mutexes. Too much
trouble is caused by the memory allocation in the mutex initialization,
and uncontested mutexes and condition variables have become faster in the
meantime.
2003-02-01 03:25:00 +00:00
nathanw
947e41dfa9 Arrange to pause for a while if pthread_cond_wait() or
pthread_cond_timedwait() is called before any threads have been
created and the SA infrastructure is up and running.

Addresses PR lib/20139.

XXX probably need to do this for all of the pthread_*_timedlock()
functions, too.
2003-02-01 00:57:31 +00:00
jdolecek
6034a0fc70 use right function name in HISOTRY, this is not _lwp_create(2) 2003-01-31 22:06:45 +00:00
uwe
4eb408dcd9 Avoid cgetcap &co prototypes conflicting with those provided by the host.
With this change we can cross-compile on FreeBSD 4.x.
2003-01-31 20:50:29 +00:00
tron
8cf036775b Add a missing bracket to make this compile. 2003-01-31 12:27:19 +00:00
pk
453f6b99a3 Include <sys/types.h>
Remove v9 register defs.
2003-01-31 12:06:27 +00:00
nathanw
96b5a26db2 Use pthread__sched_sleepers() instead of iterating over sleep queues
ourself.
2003-01-31 04:59:40 +00:00
nathanw
029982e17b Add a new internal function, pthread__sched_sleepers(), which iterates
over a sleep queue and puts everything on the run queue. This permits
the iteration to be inside the acquisition of the run queue spinlock,
avoiding repetitive acquire/release cycles.
2003-01-31 04:58:57 +00:00
nathanw
69367db47f Do a similar tuneup on pthread_cond_signal() and
pthread_cond_broadcast(): use double-checked locking to avoid
pthread__self() and pthread_spinlock() when signaling or broadcasting
on a condition variable with no waiters.
2003-01-31 04:26:50 +00:00
nathanw
6cca91fc86 Mutex tuneup.
* Use a double-checked locking technique to avoid taking
   the interlock in pthread_mutex_unlock().

 * In pthread_mutex_lock() and pthread_mutex_trylock(), only store the
   stack pointer, not the thread ID, in ptm_owner. Do the translation
   to a thread ID in the slow-lock, errorcheck, and recursive mutex
   cases rather than in the common path.

 * Juggle where pthread__self() is called, to move it out of the fast path.

Overall, this means that neither pthread_self() nor
pthread_spin[un]lock() are used in the course of locking and unlocking
an uncontested mutex. Speeds up the fast path by 40-50%, and
eliminates about 98% of spinlocks used by a couple of large threaded
applications.

(Still a GET_MUTEX_PRIVATE() in the fast path... perhaps the type
should be in the main body of the mutex).
2003-01-31 02:55:00 +00:00
fvdl
1627b9c342 libpthread support for x86_64. 2003-01-30 02:10:31 +00:00
fvdl
894bd3ad9d Add ucontext glue for x86_64. 2003-01-30 02:07:30 +00:00
nathanw
f66d2f37f7 More rototilling:
* Implement pthread_kill().

  * Return the old thread mask, not the old process mask, in our
    interpositioned sigaction call.

  * Refer to _NSIG, not NSIG.

  * Gut pthread_sigmask(). It was handling a lot of corner cases that
    weren't legal anyway. Handle unblocked signals with a new
    pthread__kill_self() routine (also used by pthread_kill()).

  * Be more consistent with locking around pt_sigacts[].
2003-01-30 01:12:42 +00:00
nathanw
a8773f45f8 Simplify pthread__upcall() a bit by moving lock resolution before the big
switch statement, and moving upcall-type-specific code into that switch.
Beneficial side effect: don't manipulate a statelock before lock resolution
occurs.
2003-01-30 01:04:50 +00:00
nathanw
7d8ac1f6c2 Set a thread's state to RUNNABLE when yielding. 2003-01-30 01:00:58 +00:00
heinz
077e910e6d Provide some more details for papers by Bentley/M.D. McIlroy and by
P.M. McIlroy (after short e-mail conversation with M.D. McIlroy on
www@).
2003-01-29 22:12:53 +00:00
drochner
e81f9f1784 cosmetics 2003-01-29 14:03:08 +00:00
wiz
9115df8c49 success, not sucess. Noted by mjl. 2003-01-28 22:35:02 +00:00
jdolecek
5e8bddc2e7 __sigaction14(): sanity check 'sig' before use, same way as sigaction1()
in kernel
2003-01-28 21:04:37 +00:00
wiz
9804cdc7fc a, b, and c. 2003-01-28 20:33:25 +00:00
kleink
5b62d84e6e Add a manual page for flockfile(3) etc.; while here, also add *_unlocked()
to stdio(3) overview documentation.  Fixes PR lib/20096 from Jason Thorpe.
2003-01-28 20:26:04 +00:00
thorpej
2dcac9e4eb Make the generated .S files depend on ${.CURDIR}/sys/Makefile.inc. 2003-01-28 00:33:23 +00:00
jdc
6e91e33032 Increment the minor version (from 5 to 6) for the addition of
can_change_color() and no_color_video().
Add a note of things to change when the major version is incremented.
2003-01-27 21:14:33 +00:00
jdc
ec51d5cc4b Change the way we calculate conflicts when turning off attributes.
We now check the termcap entries for "\E[m" or "\E[0m" or a longer
"\E[ ... m" sequence containing a "0".
2003-01-27 21:12:29 +00:00
jdc
8ca56fe956 Check for conflict between colour and other attributes. The previous
checks when adding attributes could be inadequate if background colours
were later added to a window.
2003-01-27 21:11:12 +00:00
jdc
2d83114a86 ARemove (no longer used) __nca. 2003-01-27 21:09:20 +00:00
jdc
e46d737f27 Add can_change_color() and no_color_video(). 2003-01-27 21:08:09 +00:00
jdc
a3ce96fb84 Rename can_change_colors() to can_change_color().
Add can_change_colors() (that just calls can_change_color()).
Add no_color_video().
Replace __nca with _cursesi_screen->nca.
2003-01-27 21:06:16 +00:00
jdc
f62975e655 Remove check for attribute/colour conflict.
This is now handled in refresh.c as it's not possible to handle the
conflict with background colour here.
2003-01-27 21:04:10 +00:00
jdc
1482f4ac4b Rename can_change_colors() to can_change_color().
Add no_color_video().
2003-01-27 21:03:04 +00:00
nathanw
6505a5330c Add debug counters for mutex and condvar operations. 2003-01-27 21:01:00 +00:00
nathanw
05a755440a Add cancellation stubs for accept() and connect(). 2003-01-27 20:57:41 +00:00
fvdl
161423ddca Reset in_reclen and in_received after having received a full record in
the nonblocking case.
2003-01-27 20:56:45 +00:00
nathanw
c316063660 Move accept and connect stubs to WEAKASM so that they can be overridden. 2003-01-27 20:55:56 +00:00
nathanw
ee45767b84 printf format fixes. 2003-01-27 20:54:26 +00:00
kleink
326194c69f Update stack frame allocation for XMM state having been added to
mcontext_t; spotted by Frank van der Linden.
While here, also align the on-stack ucontext as required.
2003-01-26 18:14:03 +00:00
kleink
9b24979426 Fix comment typo, and convert to C-style comments. 2003-01-26 17:58:55 +00:00
fvdl
75b44dbf11 Fix comment that wasn't closed because of a typo (but harmless, since followed
by another comment).
2003-01-26 16:22:01 +00:00
fvdl
3a79855417 Fix wrong %esp fixup. 2003-01-26 15:54:35 +00:00
nathanw
9ff1e2d385 Make pthread_barrier_wait() handle spurious wakeups from pthread__block()
by adding a generation number to the barrier structure and incrementing it
when the barrier fires.

XXX this is an ABI change for anything using barriers, but the library is
new enough and nothing in the tree uses barriers so I'm going to let it
slide. Using the private data pointer for a field that will always be present
would be excessive.
2003-01-25 00:47:05 +00:00
nathanw
fe8e8dad4a More signal rearranging:
- Signal handlers now simply continue executing the current thread,
   rather than trying to put themselves back on the queue that they came
   from, which was rather fragile. As a result, all callers of
   pthread__block() must be prepared to handle spurious wakeups.

 - When a signal arrives for a thread that is blocked in the kernel,
   note this in another field in pthread_st and set a flag. Process the
   signal and set up the trampoline for the handler *after* the thread
   unblocks, so that both the trampoline and the returned state from
   the kernel are preserved.

 - Factor out some code into a pthread__deliver_signal() routine;
   the signal-taking code in pthread_sigmask() should be able to use this
   soon.

This is still gross, and there are still some terrible MP issues lurking here,
but progress crawls along.
2003-01-25 00:43:38 +00:00
nathanw
564fe117cc Make pthread_join() accomodate spurious wakeups from pthread__block(). 2003-01-25 00:37:01 +00:00
fvdl
a3ff3a3038 Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
2003-01-24 21:55:02 +00:00
jdolecek
254ff213ae unlock pt_statelock _after_ changing pt_state, not before
problem found and fix suggested by Nick Hudson
2003-01-24 17:43:45 +00:00
thorpej
c04d6591c0 Correct omission in notice. 2003-01-24 01:54:02 +00:00
thorpej
c184191ce3 p1003.1b semaphore manual pages have been moved to librt. 2003-01-24 01:53:27 +00:00
thorpej
37946878c4 Add librt, which provides POSIX 1003.1b Real-time extensions not
present in libc.  Currently includes 1003.1b semaphores.
2003-01-24 01:52:42 +00:00
matt
61687fc220 Add the *context.? sources to SRCS.
Make getcontext _getcontext and add a getcontext weak alias.
2003-01-23 23:56:13 +00:00
thorpej
1b4d724c8e sem_init(): oops, only destroy the ksem on error if it is a ksem. 2003-01-22 23:18:06 +00:00
thorpej
c151b13c1f Rewrite to use our internal scheduling primitives. 2003-01-22 22:51:42 +00:00
kleink
35a8bdf8fa While we're here, document EPERM. 2003-01-22 15:28:37 +00:00
kleink
75adcdd6f1 Add a STANDARDS section; requested by Thomas Klausner. 2003-01-22 15:24:03 +00:00
scw
b5ca8aee09 Yay! Working pthreads for sh5. 2003-01-22 13:52:48 +00:00
scw
04c6e0b141 pthread__lock_ras_start and pthread__lock_ras_end need to be declared
as function pointers, not character arrays, for the benefit of
platforms (e.g. SH5) where the two types are quite distinct.
2003-01-22 13:52:03 +00:00
scw
5f7bdeae84 Need to include <string.h> for memcmp() prototype. 2003-01-22 13:49:14 +00:00
scw
aa338c0862 Now make these actually work. 2003-01-22 13:44:36 +00:00
nathanw
dc651e62df Don't bother acquiring the tsd_lock and reading the destructor function
if the corresponding TSD entry is empty.

Cuts down lock/unlock pairs for this operation from 256 to the number
of active TSD entries; sicne this is done when every thread exits, it saves
many total lock/unlock pairs.
2003-01-21 23:29:22 +00:00
nathanw
6003a24dd4 Use recursive mutexes from libpthread rather than implementing
our own with normal mutexes and condition variables.
2003-01-21 23:26:02 +00:00
wiz
831ba492c3 Replace -1 with \-1 for PostScript output; drop a trailing space and fix two typos. 2003-01-21 23:00:56 +00:00
kleink
8b314175ec Add ns32k ucontext userland portions. Untested, but compiled in the
recent past and presumed working.
2003-01-21 21:03:25 +00:00
kleink
7a9f64971b Add swapcontext() lint stub. 2003-01-21 20:26:10 +00:00
kleink
cd9f53e12c Add swapcontext() lint stub. 2003-01-21 20:14:07 +00:00
kleink
a26c2fe5e2 A function wrapper cannot be used for getcontext(), so error out
if neither weak aliases nor indirect references are available.
2003-01-21 19:15:05 +00:00
christos
f24857bf36 Add a uniquefier for the history function. 2003-01-21 18:40:23 +00:00
christos
98e93eb66e fix directory descriptor leak [from michael at moria dot de] 2003-01-21 17:41:38 +00:00
wiz
9b5abffe9d Add makecontext(3) from Klaus Klein. 2003-01-21 12:39:08 +00:00
wiz
ab206b65a6 New sentence, new line. 2003-01-21 11:48:03 +00:00
wiz
2caa76989f Replace -1 with \-1. 2003-01-21 11:47:32 +00:00
scw
ff288f9424 Make these compile. 2003-01-21 11:31:38 +00:00
scw
980dea552e Add _UC_USER_BIT. 2003-01-21 11:30:52 +00:00
scw
fd2dcace1f Make these compile. 2003-01-21 11:29:29 +00:00
jdolecek
69371cb504 .Rv needs a function name as parameter 2003-01-21 03:33:30 +00:00
christos
3bcbc56f02 add manual pages. 2003-01-21 02:24:41 +00:00
scw
9566978c66 First cut of MD pthread glue for sh5. 2003-01-21 00:34:56 +00:00
christos
4e5f58dd38 more sem to _sem_st 2003-01-20 20:52:24 +00:00
christos
90135cf7e8 add support for p1003.1b semaphores. From FreeBSD 2003-01-20 20:10:19 +00:00
scw
11e9fa3a9b Initialise the FPSCR to a sane value. 2003-01-20 20:09:59 +00:00
christos
111839200d Add _ksem stubs. 2003-01-20 20:09:27 +00:00
scw
b896a7171e _{get,set,swap}context_u() for SH5. 2003-01-20 17:03:58 +00:00
dsl
c673281c37 Fix lib/17248 properly
'ls -l-' now reports unknown option -- -
'env -' and 'su -' both work ok
(change approved by christos)
2003-01-20 09:06:35 +00:00