Adjust how we handle allocating an SA Event structure used to inform
the application that we are blocking.

Since we only generate BLOCKED upcalls when the thread "on" the
vp blocks and further since the first thing we do after this is
run the upcall delivery code (we switch to the lwp lying around for
this very purpose), we will never generate more BLOCKED upcalls than
we have vps. We have an invariant, let's use it.

So we add a pointer to the vp structure, and store an upcall event
data structure in it. When we block in sa_switch(), we use that
structure. When we deliver an upcall into userland, if our vp is
lacking an upcall event structure, we don't free the upcall
event structure for the event we just delivered, we instead hang it
off of the vp.

We thus no longer need to allocate memory when blocking.

This version of the code contains a panic() in the case that we do
not have an upcall event structure available in sa_switch(). Keep this in
mind before putting this version into a production environment.

It has been suggested that it would be easier to embed an upcall event
structure in the virtual processor structure, given the invariant above.
The problem is that while we only can generate one BLOCKED per vp, we
do not necessarily deliver that upcall immediately to userland. If there
were pending upcalls, we deliver them first. As such, we can have code
running on the vp before the BLOCKED event is delivered. If _that_ code
blocks, we have no where to store that information. Thus we limit ourselves
to holding a pointer to separately-allocated memory.
Add sa_critpath_{enter,exit}(). These routines are intended to
permit code outside of kern_sa.c to indicate that it is entering
a code path in which any blocking (tsleep()) should NOT trigger
a BLOCKED upcall to userland. These should be used in areas where
we can't really start another thread, such as in context switching.

All these routines do is clear L_SA if it's set & put it back if
it had been set. Their main purpose is stylistic. Any routine could
just fiddle with L_SA, but these routines offer a way to separate
the abstract "Don't interrupt what I'm doing" from the exact implementation
of fiddling with L_SA.

Existing code not in kern_sa.c that twiddles L_SA should be converted
to use these routines.
Check in a work-in-progress sys_sa_preempt().

The idea is to fire off a user upcall on the given lwp. Then when it
gets delivered, libpthread will be able to do something with the
thread.

Needs a way to fire off an IPI if the thread is running on another
CPU.
Add a lot of comments to explain what routines are doing, and to
start documenting what locks are expected on entry, what locks are
held/released on exit, and what locks are taken internally. Hopefully
I understood things correctly.

I only got as far as sa_switch(), but I don't want to have these changes
linger just in my tree.
Fix a couple of tyops.
Add support for SA pthreads to gdb6.

Code from Nathan Williams, PR/35540 and me.

This could with more testing.
Fix up sys_sa_preempt so that this file compiles.
Add more comments.
Catch up with now-somewhat-dated netbsd-4. These changes took longer
than expected for me to actually get around to merging.
Update to today's netbsd-4.
Add files missed in last merge.
Ticket 1349.
Pull up the following revisions (requested by joerg in ticket #1346):
	external/bsd/pkg_install/dist/info/perform.c     1.1.1.10
	external/bsd/pkg_install/dist/lib/license.c      1.1.1.4
	external/bsd/pkg_install/dist/lib/pkg_install.conf.5.in  1.1.1.5
	external/bsd/pkg_install/dist/lib/version.h      1.1.1.17
Import pkg_install-20090724:
- license handling: accept upper case letters. Keep license checks
  case-sensitive as done in the older pkgsrc logic. Document this.
  OK dillo@, schmonz@, wiz@
- pkg_info:
- fix handling of non-packages, that are valid archives
- invert order of pkg_info -r to better match the expectations of
  make update.' external/bsd/pkg_install
ticket #1346
Pull up following revision(s) (requested by dsl in ticket #1352):
	sys/kern/kern_exec.c: patch
Fix ktrace of data from iovec based system calls.
Fixes PR/41819
ticket #1352
Pull up following revision(s) (requested by spz in ticket #1355):
	etc/ssh/ssh_known_hosts: revision 1.5
add morden, mollari, pkgbuild and build
adjust function names' keys
add the proper names of hosts too in preparation of their function moving
Pull up following revision(s) (requested by dholland in ticket #1356):
	usr.bin/netstat/netstat.1: revision 1.52
Fix typo
Pull up following revision(s) (requested by dholland in ticket #1357):
	usr.bin/chflags/chflags.1: revision 1.18
Add some markup to improve clarity.
Pull up following revision(s) (requested by mlelstv in ticket #1358):
	sys/netinet/tcp_usrreq.c: revision 1.148 via patch
Make the sysctl routines take raise to splnet() before dealing with
any data structures.