rendez_wakeup() has a return value

A bool, telling the caller if anything was woken up.  The original plan9
wakeup() returned a proc*, for instance.  The uses I've seen of it (2)
are okay with a bool.
Moves genbuf into kthreads

So we can have independent syscalls from the same process in the
kernel...

We should consider finding a better way to do the genbuf.  Though I
guess it's not as bad as the waserror()/poperror() stuff on performance.
More defensive atoi()

Needed this to catch a bug in the old plan9 code, where atoi was used
instead of strtol.

Here's the old notes from that bug:

	We were setting the netfile's type to 0, which means we would never
	detect/match any incoming packets.  This includes broadcast packets
	that we sent ourselves (such as an arp, telling us that we are
	10.0.2.15).

	The root issue is atoi vs strtol.  atoi is supposed to be for base
	10, though NxM uses atoi for netifwrite.  Perhaps their strtol
	allows a base prefix to override the base parameter.
Fixes set_alarm() for alarm handlers

set_alarm() grabs the tchain lock.  In alarm handlers, currently the
lock is already held while executing the handlers.

Instead, use __set_alarm() when the tchain lock is already held.
Some tweaks to print_func_entry()

We need the tab resetting, since for every kproc that doesn't return, we
tab in at least once.

Turning it off easily is also useful, without spatching over and over.

The Core printf helps a little with concurrency slightly, though
kthreads end up running on core 0, so you'll still need to manually edit
the trace.
PCI cleanup and better BAR handling

Not perfect, but it gets some of the muck out of the drivers.
Helper for registering device IRQs

This puts all the dirty hacks into one place, without drivers needing to
know about the particulars of IRQ routing, which interrupt handler table
to use, etc.
NIC drivers use register_dev_irq()

In plan9, this would go in devether.
Fix spurious IRQ check
x86: sends the EOI later in the IRQ path

I've gone back and forth on this.  Check out 1b50da7e for reference.

Right now, we're taking more spurious IRQs, probably due to sending EOI
early.  It's not necessary for ipi_is_pending() to send early either,
and I don't see other OSs doing it.
x86: locking when messing with the PIC

This is ultra-paranoia.  In general, we only mess with the PIC from
core 0.  That's the only core we route PIC IRQs to.  But there's a
chance we have an MCP that triggers something like a mask or unmask of
the PIC, which could happen concurrently with an IRQ.  I don't know if
we have anything that can do that yet, but better safe than sorry.

As far as the extra perf overheads go, ideally we wouldn't even be using
the PIC, but we'd have the same set of issues with the IOAPIC, and will
need locking in those cases too.
x86: helper for PCI bus mastering

Probably every PCI device that needs to DMA will need to set this.
PCI cleanup

Includes helper functions for reading/writing 16/8 bit registers in the config
space and the ensuing cleanup.

Also includes better detection of multifunction devices; we only scan
for them if we know we have a multifunction, instead of scanning all the
time.  We also were missing out on the header type frequently, since we
didn't mask 0x7c.
Dynamic virtual memory mapping helpers

We'll see, but most users probably just want the mapping to happen, and
don't care about splitting up the getting the segment and doing the
mapping.
PADDR helpers for lower and upper 32 bits

We usually need to tell devices 64 bit PADDRs in two separate 32 bit
chunks.  Also, I added some catches for the RTL driver.  Without this
check, we could have the NIC writing on the wrong pages (when the true
PADDR > 4 GB).
Allow multiple handlers per IRQ

We don't allow unregistering yet - requires RCU-like sync with the read
side.
Properly close files when destroying procs

I'm not 100% happy with this, but we're locking anyways, so we might as
well use it to prevent concurrent additions/modifications when we're
destroying the process.

This prevents us from sharing fgrps, which I'm okay with.

There are lots of races involved, check the comments for details.

I left in the notes about where to deal with plan9/inferno chans.
VFS helpers for getting/putting FDs

So that 9ns can use FD numbers from VFS space, and we don't need to
convert between the two.

This may have some issues, since the 9ns hacked fd lookup isn't
implemented yet.
Half-assed file truncation

Need to do something with the page cache, but hopefully we won't mess
with it at all.
Adds some busybox editors

ed seems to work, not that I know it very well.  sed works too (at least
a basic sed 's/foo/bar/g' does).

vi doesn't work (screen control is all messed up).  Haven't tried awk.

You'll need to copy this config file to your busybox directory as
.config, then remake.  And of course copy the binary to KFS.

To save you all the hassle, I put symlinks in KFS for all the busybox
commands I use.

Here's some reading:
	http://linux.about.com/library/cmd/blcmdl1_ed.htm
	http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ed.html
	http://cm.bell-labs.com/cm/cs/who/dmr/qed.html