Add updated locking primatives.
Make the kernel_lock a mutex.
Use mutexes to protect workqueues.
From the newlock branch: add some KASSERT() verifying correct alignment.
- Convert some locks to mutexes and RW locks.
- Use the proclist_lock to protect pgrps and sessions in some places.
Fix a thinko.
Don't do the simplelock check if panicstr is set.
Add updated locking primatives.
- Convert some lockmgr() locks to mutexes and RW locks.
- Acquire proclist_lock and p_crmutex in some obvious places.
- Allocate and free turnstiles where needed.
- Split proclist_mutex and alllwp_mutex out of the proclist_lock,
  and use in interrupt context.
- Fix an MP race in enterpgrp()/setsid().
- Acquire proclist_lock and p_crmutex in some obvious places.
Grab proclist_mutex in a few more places.
Add mtsleep(). Currently only useful if the wakeup comes from process
context. A fix for this is pending.
Put a mutex around the SYSV message system. Provides a useful test of
sleep/wakeup when run unlocked.
Update for donice/enterpgrp change.
Tweak slightly, no functional change.
Add kern_mutex.c, kern_rwlock.c, kern_turnstile.c
- If the callout is running on another CPU, spin before stopping or
  rescheduling it.
- Use mutexes.
Alter the protocol impemented by prop_kern to allow for bi-directional
plist-based messages and to eliminate looping previously required to
receive a plist from the kernel:

- prop_dictionary_copyin_ioctl() and prop_dictionary_copyout_ioctl()
  now take the cmd argument rather than the file open flag.  The
  read-ness or write-ness of an ioctl command is checked by these
  routines to ensure that information is being passed to/from the
  userland component properly.

- prop_dictionary_copyout_ioctl() now allocates the memory for the
  XML plist on behalf of the userland component by way of uvm_mmap().
  The XML plist is copied out to the newly-mapped anonymous region,
  and the pointer returned via the plistref.

- prop_dictionary_recv_ioctl() is responsible for munmap()'ing the
  region after parsing the XML plist into internal represenatation.

- A new prop_dictionary_sendrecv_ioctl() is added, allowing user space
  code to send a dictionary to the kernel and receive one back as a
  reply.


Update users of prop_kern for the API changes (Bluetooth).

This constitutes an ABI / protocol change -- but this will also be put
into NetBSD 4.0 so that the first proplib release will implement the new
scheme.
typos: prop_stringy_* -> prop_string_*
- Add a reader-writer lock to array and dictionary objects that ensures that
  the data structure is internally consistent in the face of multiple threads
  accessing it concurrently.  This is not designed to provide application-
  level semantic consistency; applications are responsible for that locking
  protocol should it be necessary.
- Rename _PROP_MUTEX_DECL() to _PROP_MUTEX_DECL_STATIC().