|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnachos.kernel.devices.InterruptHandler
public abstract class InterruptHandler
This class controls entry to and exit from interrupt service routines. It is an abstract class which should be extended to create interrupt handlers for specific devices. Each subclass must provide an implemention for the serviceDevice() method. The main reason this class is here is to implement the yieldOnReturn() method, which provides an interrupt service routine (such as the one for the timer) the ability to request that rescheduling of the CPU take place at the completion of interrupt service.
Field Summary | |
---|---|
private static boolean |
inHandler
Are we currently running an interrupt handler? |
private static boolean |
yieldOnReturn
Should the CPU be rescheduled on return from the current handler? |
Constructor Summary | |
---|---|
InterruptHandler()
|
Method Summary | |
---|---|
void |
handleInterrupt()
Handler called by the machine when any interrupt occurs. |
abstract void |
serviceDevice()
Subclasses must implement this method to provide device-specific interrupt service. |
static void |
yieldOnReturn()
Called from within an interrupt handler, to cause a context switch (for example, on a time slice) in the interrupted thread, when the handler returns. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static boolean inHandler
private static boolean yieldOnReturn
Constructor Detail |
---|
public InterruptHandler()
Method Detail |
---|
public void handleInterrupt()
handleInterrupt
in interface nachos.machine.InterruptHandler
public abstract void serviceDevice()
public static void yieldOnReturn()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |