User mode thread interrupt system

The user mode interrupt system provides a mechanism to interrupt a
thread's execution and execute a user mode handler function. When the
handler returns the thread's state will be restored and it will resume
where it was previously executing. Interrupts can have an associated
data block which is copied onto the user stack, and the handler is
passed a pointer to it (as well as a pointer to the saved thread
state).

Interrupts have priorities, and threads have an interrupt priority
level (IPL) which can be used to block interrupts based on their
priority. If an interrupt is queued which is blocked by the IPL, it
will be executed once the IPL is lowered to unblock the interrupt.

There are 2 planned users of the interrupt system: thread exception
handling, and asynchronous object event notifications (it will be
possible to set up an asynchronous wait for an object event and have
a callback called when the event is triggered).