Commit Graph

12050 Commits

Author SHA1 Message Date
dogcow
b8d6c11ba4 <machine/profile.h> needs <sys/types.h>; why crt0.c needs <machine/profile.h>
(and only on amd64) is another question altogether.
2007-09-27 10:51:18 +00:00
tnn
aa8a5e0d63 remove extraneous "has" 2007-09-25 09:42:51 +00:00
junyoung
8fa93f7dc6 Farewell to gccism. 2007-09-25 08:22:44 +00:00
junyoung
4271bf2ec5 Massive cosmetic changes, notably:
* ANSIfy
 * De-__P
 * u_intXX_t -> uintXX_t
 * Remove "extern" from function prototypes
2007-09-25 08:19:09 +00:00
junyoung
0e2bf8ef62 Remove trailing spaces. 2007-09-25 08:16:08 +00:00
lukem
e9aa053c09 Add raise_default_signal(3) -- raise the default signal handler.
Can be used by applications that have their own SIGINT (et al)
handlers and want to exit in a manner that correctly
signals to the parent that the process was terminated by a signal.
See http://www.cons.org/cracauer/sigint.html for more info.
Discussed on tech-userlevel@.
2007-09-25 01:13:54 +00:00
ad
af8ed8ad89 Kill PTHREAD_SPIN_DEBUG - it's not must use with 1:1. 2007-09-24 13:56:42 +00:00
skrll
d32ed98975 Resurrect the function pointers for lock operations and allow each
architecture to provide asm versions of the RAS operations.

We do this because relying on the compiler to get the RAS right is not
sensible. (It gets alpha wrong and hppa is suboptimal)

Provide asm RAS ops for hppa.

(A slightly different version) reviewed by Andrew Doran.
2007-09-24 12:19:39 +00:00
pooka
12e401bc1a Add refuse paper to SEE ALSO 2007-09-24 00:22:25 +00:00
ad
598943b712 Adjust previous for clarity. 2007-09-21 21:28:11 +00:00
ad
92f04f1f80 pthread__mutex_unlock_slow: always catch up with deferred wakeups, because
pthread_mutex_unlock clears the per-mutex indicator.
2007-09-21 21:09:25 +00:00
ad
cb10afa05c pthread_rwlock_unlock: return EPERM if the caller tries to release a
rwlock that is write held, but not by the caller.
2007-09-21 16:24:45 +00:00
ad
9212747aea pthread_rwlock_unlock
- Allow callers to try and release an unheld rwlock. Just return EPERM
  as mandated by IEEE Std 1003.1.
- Use pthread__atomic_swap_ptr() to set in the new lock value. At this
  point the lock word can't have changed.

pthread__rwlock_wrlock, pthread__rwlock_rdlock:

- Mask out the waiter bits in the lock word before checking to see if
  the current thread is about to lock against itself.
2007-09-21 16:21:54 +00:00
jdc
fe324c36e9 Set the column width when changing the background using wbkgd(), otherwise
we will see zero width characters in refresh.c:makech().
2007-09-19 22:13:14 +00:00
jdc
260ad27047 We don't need separate #ifdef's for __ALTCHARSET and WA_ALTCHARSET, as they
are defined to be the same in curses.h.
2007-09-19 22:00:43 +00:00
jdc
c172664803 Add debugging for the WCHAR cases. 2007-09-19 21:59:37 +00:00
mlelstv
6abb2a41f4 Implement OSS_SNDCTL_DSP_GETODELAY and provide a no-op function
for OSS_SNDCTL_DSP_PROFILE.
2007-09-18 22:57:31 +00:00
tnozaki
0941b12b16 lib/36938 mbtowc misbehaving after invalid char sequence
- make sure to initialize mbtowc's internal state.
 - add regression test.
2007-09-18 15:12:07 +00:00
skrll
f9577d3ada Mostly fix the restartable atomic sequences by reversing the sense of the
lock check and test for return value.

At least alpha looks broken me and some are sub-optimal.

"Looks good to me" from ad.
2007-09-17 13:25:59 +00:00
ragge
592fd7eafc __FUNCTION__ -> __func__. 2007-09-15 14:30:56 +00:00
tnn
28d03ee594 sem_post(): pthread__self() is no longer used here. 2007-09-14 09:15:41 +00:00
ad
20e3392edc Add a per-mutex deferred wakeup flag so that threads doing something like
the following do not wake other threads early:

	pthread_mutex_lock(&mutex);
	pthread_cond_broadcast(&cond);
	foo = malloc(100);		/* takes libc mutexes */
	pthread_mutex_unlock(&mutex);
2007-09-13 23:51:47 +00:00
ad
b0efccf4cd Make the new mutexes faster:
- Eliminate mutexattr_private and just set a bit in ptm_owner if the mutex
  is recursive. This forces the slow path to be taken for recursive mutexes.
  Overload an unused field in pthread_mutex_t to record whether or not it's
  an errorcheck mutex.
- Streamline pthread_mutex_lock / pthread_mutex_unlock a bit more. As a
  side effect makes it possible to have assembly stubs for them.
2007-09-11 18:11:29 +00:00
ad
4042b7d22a Put new threads on the tail of pthread__allqueue, for the debugger. 2007-09-11 18:08:10 +00:00
ad
7db40473e2 Fix a dodgy bit of assembly. 2007-09-11 16:07:15 +00:00
ad
ee3459ca7b Fix broken pthread_mutex_trylock(). 2007-09-11 11:30:15 +00:00
ad
baebee83d5 Fix inverted test after merge of nick-csl-alignment. 2007-09-11 10:27:44 +00:00
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