Starting point, blabla.
We need to increase idepth since it gets cleared on return from int
Improve and fix a bunch of DPRINTFS
Wrong calculation of ipending
em(4) is our ratlab.
Always panic on splassertions, must be done prior to sysctl.
Match behaviour of INTRSTUB, still deadlock because we never do
INTRFASTEXIT.  INTRFASTEXIT doesn't process ipending, so if we always
set ipending and do Xdoreti, we end up in a deadlock where we set
ipending do splx, set ipending do splx and so on...

Idea to fix is to look at ci_ipdepth on the interrupt handler, and
decide what to do.
Start trying to move away from hz, I now know the correct comparison
is without the equality, if not we may run em1 handler above em0, or
something similar. Adjust some comments and add better debugging
messages.
Fallback and implement an interrupt stub that closely matches the one
we have, it reads better and fixes all the remaining known bugs. We'll
kill all this crap once we have critical sections anyway.

Sucessfully running mpi(4) and em(4) as a thread.
Improve ithread_handler by having our own way of waking up the thread,
this is one step closer to the lockless scheduler, right now we only
need it to protect the sleep queue.
Use threads on mpi(4) as well.
Lockless round-robin scheduler for ithreads, mi_switch still needs
locking.
Revert "Lockless round-robin scheduler for ithreads, mi_switch still needs"

This reverts commit 875797d39dabc85f56bfc78b31b3df89bcce37ab.

We're not ready for this, em(4) seems to die once in a while, let us
be more conservative for now and fix more primitive problems.
Good bye IPL_THREAD, all interrupts are threaded now.

Old PIC is still unhandled.
intr_disestablish() is broken and if used will corrupt intrsource.
Change the way we fork ithreads so that the cold case for
intr_disestablish() can be implemented. This allows us to cancel the
forking of an ithread if we got an intr_disestablish() call while
still on autoconf (cold case).
intr_disestablish() fix for the cold case.

Very simple, unlink the intrsource() from thread creation.  The !cold
case is much more complex and we will need a reliable synchronous
message implementation, so that the ithread can disestablish() itself
from the same process context, this avoids locks and further code
complexity.
Cleanup and copyright.
Move all softints to threads.

This is a temporary implementation and it sucks ballz since we're
using the SCHED_LOCK as an interlock to "keep state on a wakeup", in
the future this should all be rewritten anyway. I need this to hold
everything together in order to remove the IPL subsystem.

There are still 2 or 3 devices registering their own softints which I
did not touch.
Fix the case where we get an interrupt before ithreads are forked.

Found out by Patrick on arm and this is essentialy his fix, we agreed on
let is_scheduled set and return.

My x61s now boots and works, including X and so on.
Prepare a process context on secondary cpus earlier for critical sections.

Critical sections rely on incrementing/decrementing curproc->p_crit,
critical sections will be raised on every mutex_enter() and checked on
every interrupt, so that imposes us two restrictions:

* We need a "valid" curproc for mutexes (think of early printfs).
* We can't take interrupts before setting curproc.

Bootcpu is no problem, there is only one case and we can fix it later.
Secondary cpus are a problem since they do mtx_enter() and may take
interrupts before having a valid curproc (think of hardclock).
The solution for secondary cpus is having a fake process context on
cpu_hatch() and only enable interrupts on the first idle scheduling.