|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnachos.machine.Interrupt
public class Interrupt
This class provides methods by which the OS can control the interrupt-handling features of the CPU. A method (setLevel) is provided to enable and disable interrupts. Other methods are provided to halt the simulation and to idle the CPU if there is nothing in the ready queue to run. Internally, this class keeps track of all the interrupts the hardware devices would cause, together with when they are supposed to occur. It is responsible for generating calls to the device interrupt handlers at the proper times. Much of this functionality is hidden, and you need not be concerned with it.
Field Summary | |
---|---|
static int |
IntOff
Interrupts can be disabled (IntOff) or enabled (IntOn) |
static int |
IntOn
Interrupts can be disabled (IntOff) or enabled (IntOn) |
Constructor Summary | |
---|---|
Interrupt()
|
Method Summary | |
---|---|
static int |
getLevel()
Determine the current interrupt level. |
static void |
halt()
Shut down Nachos cleanly, printing out performance statistics. |
static void |
idle()
Routine called when there is nothing in the ready queue. |
static int |
setLevel(int now)
Change interrupts to be enabled or disabled, and if interrupts are being enabled, advance simulated time by calling OneTick(). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int IntOff
public static final int IntOn
Constructor Detail |
---|
public Interrupt()
Method Detail |
---|
public static int getLevel()
public static int setLevel(int now)
now
- The new interrupt status.
public static void idle()
public static void halt()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |