Commit Graph

12023 Commits

Author SHA1 Message Date
skrll
9fdaf800d9 Merge nick-csl-alignment. 2007-09-10 11:34:05 +00:00
ad
e2c2fa5d09 Fix recursive mutexes to work again in non-threaded applications. 2007-09-09 20:13:23 +00:00
ad
debc2870e6 Update. 2007-09-08 23:00:31 +00:00
ad
f4fd6b797e - Get rid of self->pt_mutexhint and use pthread__mutex_owned() instead.
- Update some comments and fix minor bugs. Minor cosmetic changes.
- Replace some spinlocks with mutexes and rwlocks.
- Change the process private semaphores to use mutexes and condition
  variables instead of doing the synchronization directly. Spinlocks
  are no longer used by the semaphore code.
2007-09-08 22:49:50 +00:00
rmind
2cecf9bbe9 Implementation of POSIX message queues.
Reviewed by: <ad>, <tech-kern>
2007-09-07 18:56:02 +00:00
ad
8ccc6e060d - Don't take the mutex's spinlock (ptr_interlock) in pthread_cond_wait().
Instead, make the deferred wakeup list a per-thread array and pass down
  the lwpid_t's that way.

- In pthread_cond_wait(), take the mutex before dealing with early wakeup.
  In this way there should never be contention on the CV's spinlock if
  the app follows POSIX rules (there should only be contention on the
  user-provided mutex).

- Add a port of the kernel's rwlocks. The rwlock's spinlock is only taken if
  there is contention. This is enabled where atomic ops are available. Right
  now that is only i386 and amd64 because I don't have other hardware to
  test with. It's trivial to add stubs for other architectures as long as
  they have compare-and-swap. When we have proper atomic ops the old rwlock
  code can be removed.

- Add a new mutex implementation that's similar to the kernel's mutexes, but
  uses compare-and-swap to maintain the waiters list, so no spinlocks are
  involved. Same caveats apply as for the rwlocks.
2007-09-07 14:09:27 +00:00
ad
a6ed47a549 Add: pthread__atomic_cas_ptr, pthread__atomic_swap_ptr, pthread__membar_full
This is a stopgap until the thorpej-atomic branch is complete.
2007-09-07 00:24:56 +00:00
ad
c67dc640cd If a libpthread internal spinlock is held, nanosleep() for a tick instead of
yielding. This is a nasty band-aid but with many threads, looping over
sched_yield() wastes a huge amount of CPU time. It would be nice to have a
way to temporarily disable preemption, but it turns out that's yet another
no-brain concept that has been patented and the patent holder seems to be
suing people lately. Another alternative is probably to have kernel-assisted
spinlocks.
2007-09-07 00:07:54 +00:00
pooka
3875108e18 document puffs_framev_framebuf_ccpromote() 2007-09-06 18:01:34 +00:00
pooka
56b35d3b97 Give cmpframe() the ability to shortcircuit the comparison loop by
signalling back that the buffer under examination is not a response
at all.
2007-09-06 16:08:55 +00:00
jnemeth
8e9c7dbf0c PR/36933 - Robert Elz -- ARPA IPv6 -> IPv6 2007-09-06 09:32:52 +00:00
drochner
dce09ea075 clean up some definitions around rune_t which are not needed anymore 2007-09-03 20:31:56 +00:00
pooka
91872d550d xref refuse, don't bump date 2007-09-03 12:34:21 +00:00
pooka
dc9a91060d Add gotframe callback, which is called if an incoming frame matches
no outstanding request.
2007-09-01 16:42:42 +00:00
blymn
2b4f2c9caf Fix a crash caused by having a single NULL character as a string capability.
This fix is about the best we can do given the current interfaces. We
could extend the cgetcap(3) interfaces with a function that would return
a character count and handle this in libterm which would provide a more
complete fix and allow a NULL character in a string capability.
2007-08-28 12:28:18 +00:00
jdc
34bea28655 Fix resizing bug where the values of LINES and/or COLS changed while we
were resizing windows, leading to inconsistencies between the sizes of
stdscr and curscr.

Should fix the curses part of PR lib/36702.
2007-08-27 19:54:29 +00:00
pooka
8ffb2866a1 * clarify error behaviour for getmntopts()
* invert getmnt_silent description (a.k.a. "fix it")
2007-08-26 22:53:01 +00:00
pooka
5cf35d2a60 Emulate behaviour described in man page and return NULL if an error occurs. 2007-08-26 22:46:15 +00:00
pooka
ec5345d9bc Now that we don't dump operations by default, might as well detach
from the console by default also.  (but still would be nice if someone
provided options to toggle these using the fuse options framework)
2007-08-25 12:03:59 +00:00
pooka
b017aa6055 Pass usermount to errnotify, it might not be available there through
other structures.  CID 4496
2007-08-25 09:30:41 +00:00
ad
342557fb0f Update. 2007-08-23 19:21:40 +00:00
ad
0225b043d2 Acquire the correct lock in pthread_detach(). Spotted by Jan Kryl. 2007-08-23 19:13:23 +00:00
pooka
083b854262 Dump lookup/componentname specific info in opdump.
(sigh, I guess I guess I'll never do opdump properly at this rate)
2007-08-22 17:57:48 +00:00
pooka
e6d6dce9bf Mimic namei structure changes for puffs. bump both kernel & lib version. 2007-08-22 17:54:30 +00:00
drochner
a82b6826f5 replace the last cast through void* by the SET_FLOAT_WORD macro, inspired
by a similar change in FreeBSD
2007-08-21 20:12:27 +00:00
drochner
58960d86a5 Adopt an (older) fix from FreeBSD: using ceil() on values in (0,0.5]
leads to loss of precision, leading to rounding into the wrong direction
for the case 0.5-epsilon. use floor() instead.
This also fixes a wrong sign of zero returned with non-default rounding
directions.
2007-08-21 20:10:27 +00:00
perry
e34be9798b Never use "utilize". It means exactly the same thing as "use", but it
is longer and more cumbersome. It can always be replaced with "use"
without any change in meaning.
2007-08-20 16:07:05 +00:00
drochner
9d8b5fa74e Add C99 complex support, for double and float.
Most complex function implementations are from the "c9x-complex" library,
originating from the "cephes" math library, see
http://www.netlib.org/cephes/, from Stephen L. Moshier, incorporated and
redistributed with the NetBSD license by permission of the author.

Error behaviour and other boundary conditions (branch cuts)
need to be looked at.

For namespace sanity, I've done the rename/weak alias procedure to
most of the exported functions which are also used internally.
Didn't do so for sin/cos(f) yet because assembler implementations use
them directly, and renaming functions shared between the main libm
and the machine specific "overlay" might raise binary compatibility
issues.
2007-08-20 16:01:28 +00:00
pooka
f9009a84a6 puffs_cc_create/destroy aren't supposed to be exported to the user 2007-08-18 10:26:05 +00:00
pooka
4385b647e7 Add accessors for struct puffs_node to prepare for removal from
exported headers.
2007-08-17 17:25:31 +00:00
ad
40724da2ba pthread_suspend_np, pthread_resume_np, pthread_detach: return correct code
on error.
2007-08-17 14:28:31 +00:00
ad
cc383c5771 Minor correction for debug code and a cosmetic change. 2007-08-16 23:37:08 +00:00
ad
2639b90e3b One more micro-optimization.. 2007-08-16 14:53:45 +00:00
ad
d9adedd764 Trim fat off libpthread internal spinlock operations. Makes a mesurable
improvement across the board.
2007-08-16 13:54:16 +00:00
ad
b8833ff53f - Reinitialize the absolute minimum when recycling user thread state.
Chops another ~10% off create/join in a loop on i386.
- Disable low level debugging as this is stable. Improves benchmarks
  across the board by a small percentage. Uncontested mutex acquire
  and release in a loop becomes about 8% quicker.
- Minor cleanup.
2007-08-16 12:01:49 +00:00
ad
71197327ee Catch up with libpthread changes. 2007-08-16 01:09:50 +00:00
ad
9e28719960 Remove PT_FIXEDSTACKSIZE_LG. 2007-08-16 01:09:34 +00:00
ad
ed964af19e Cache thread context for creation instead of setting it up every time.
Speeds create/join loop by about 10-15% on i386.
2007-08-16 00:41:23 +00:00
ad
c94f5a91bc Simplify pthread_join(). Knocks about 5% off pthread_create/join in a loop. 2007-08-15 22:48:52 +00:00
pooka
25a346d4fb Nuke PUFFSLOOKUP_FOO and move to NAMEI_FOO 2007-08-15 14:19:19 +00:00
pooka
306d09812c In case a file system doesn't provide st_blksize, default to DEV_BSIZE. 2007-08-12 15:32:39 +00:00
christos
5f3802ca6e patches from Axel Thimm 2007-08-12 07:41:51 +00:00
pooka
ea9b8a0046 run realpath() on the mountpath 2007-08-11 18:04:50 +00:00
drochner
b36bcf93ef make the hypot/atan2 functions weak aliases, because they are used
internally by the historical cabs(), and the future c99 cabs/carg
2007-08-10 21:20:35 +00:00
he
fd961c4429 Add a new socket option for unix domain sockets: LOCAL_PEEREID, to make
it possible to get the pid, euid and egid of the process at the remote
end at the time it did bind() or connect().

Add a new libc function, getpeereid() to easily get at the euid and egid.
As a consequence, bump libc's minor number.

Document the LOCAL_PEEREID socket option in unix(4).

Based on contribution by Arne H. Juul, minor modifications by myself.
2007-08-09 15:23:01 +00:00
kristerw
3a6ef3e3c1 Keep track of atexit functions that are added while processing
atexit functions, to ensure that the new functions will be called.
2007-08-08 01:05:34 +00:00
kristerw
af220472c9 Ensure that the struct atexit_handler has been removed from the list
of pending atexit handlers before the structure is reused.  This prevents
__cxa_finalize from going into an infinite loop when an atexit handler
register a new atexit handler as in:

   #include <stdlib.h>

   void two(void) {
   }

   void one(void) {
           atexit(two);
   }

   int main(void) {
           atexit(one);
           return 0;
   }
2007-08-08 00:51:18 +00:00
wiz
90a93c1dcd Various improvements: sort errors; use more
markup; fixes for HTML and PostScript output.
2007-08-07 20:45:03 +00:00
ad
1d42dbd29a Missed variable rename.. 2007-08-07 19:58:30 +00:00
ad
c3f8e2ee55 Change the signature of _lwp_park() to accept an lwpid_t and second
hint pointer, but do so in a way that remains compatible with older
pthread libraries. This can be used to wake another thread before the
calling thread goes asleep, saving at least one syscall + involuntary
context switch. This turns out to be a fairly large win on the condvar
benchmarks that I have tried.
2007-08-07 19:04:21 +00:00