|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object avrora.sim.InterruptTable
The InterruptTable
class encapsulates the functionality relating to handling
the state of the interrupts in the simulation. It allows probes to be inserted on each
interrupt (and globally, for each interrupt) that allow the user's code to be called back
when the state of interrupts changes.
Nested Class Summary | |
static interface |
InterruptTable.Notification
The Notification interface serves a very specific role in simulation;
for device implementations to be notified when an interrupt that a device may have
posted is executed, or when the user forces an interrupt to be notified. |
Field Summary | |
protected long |
enabled
|
protected MulticastInterruptProbe |
globalProbe
|
protected BaseInterpreter |
interpreter
|
protected InterruptTable.Notification[] |
notify
|
protected int |
numInterrupts
|
protected long |
pending
|
protected long |
posted
|
protected MulticastInterruptProbe[] |
probes
|
Method Summary | |
long |
getEnabledInterrupts()
The getEnabledInterrupts() method returns a long integer that represents a bit map
of which interrupts are currently enabled, meaning not masked out. |
int |
getNumberOfInterrupts()
The getNumberOfInterrupts() method returns the number of interrupts in this interrupt table. |
long |
getPendingInterrupts()
The getPendingInterrupts() method returns a long integer that represents a bit map
of which interrupts are currently pending, meaning they are both posted and enabled. |
long |
getPostedInterrupts()
The getPostedInterrupts() method returns a long integer that represents a bit map
of which interrupts are currently posted. |
void |
insertProbe(Simulator.InterruptProbe p)
The insertProbe() method inserts a global probe on all of the interrupts. |
void |
insertProbe(Simulator.InterruptProbe p,
int inum)
The insertProbe() method inserts an interrupt probe on the specified interrupt. |
boolean |
isEnabled(int inum)
The isEnabled() method checks whether the specified interrupt is currently enabled. |
boolean |
isPending(int inum)
The isPending() method checks whether the specified interrupt is currently pending. |
boolean |
isPosted(int inum)
The isPosted() method checks whether the specified interrupt is currently posted. |
void |
post(int inum)
The post() method is called by the interpreter when an interrupt is posted.
|
void |
registerInternalNotification(InterruptTable.Notification n,
int inum)
The registerInternalNotification() method is used by devices that
require notifications when their interrupt numbers are either forced or invoked. |
void |
removeProbe(Simulator.InterruptProbe p)
The removeProbe() method removes a global probe from all of the interrupts. |
void |
removeProbe(Simulator.InterruptProbe p,
int inum)
The removeProbe() method removes a probe from an interrupt. |
void |
unpost(int inum)
The unpost() method is called by the interpreter when an interrupt is unposted.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final int numInterrupts
protected long posted
protected long pending
protected long enabled
protected MulticastInterruptProbe globalProbe
protected final MulticastInterruptProbe[] probes
protected final InterruptTable.Notification[] notify
protected final BaseInterpreter interpreter
Method Detail |
public void post(int inum)
post()
method is called by the interpreter when an interrupt is posted.
The interrupt table will adjust the posted and pending masks appropriately and notify
any probes for the interrupt.
inum
- the interrupt number to postpublic void unpost(int inum)
unpost()
method is called by the interpreter when an interrupt is unposted.
The interrupt table will adjust the posted and pending masks appropriately and notify
any probes for the interrupt.
inum
- the interrupt number to unpostpublic void registerInternalNotification(InterruptTable.Notification n, int inum)
registerInternalNotification()
method is used by devices that
require notifications when their interrupt numbers are either forced or invoked.
n
- the notification to register for this interruptinum
- the interrupt number for which to register the notificationpublic long getPostedInterrupts()
getPostedInterrupts()
method returns a long integer that represents a bit map
of which interrupts are currently posted. For example, bit 1 of this long corresponds to whether
interrupt 1 is currently posted.
public long getPendingInterrupts()
getPendingInterrupts()
method returns a long integer that represents a bit map
of which interrupts are currently pending, meaning they are both posted and enabled. For example, bit 1
of this long corresponds to whether
interrupt 1 is currently pending.
public long getEnabledInterrupts()
getEnabledInterrupts()
method returns a long integer that represents a bit map
of which interrupts are currently enabled, meaning not masked out. For example, bit 1 of this long
corresponds to whether
interrupt 1 is currently enabled.
public boolean isPosted(int inum)
isPosted()
method checks whether the specified interrupt is currently posted.
inum
- the interrupt number to check
public boolean isPending(int inum)
isPending()
method checks whether the specified interrupt is currently pending.
inum
- the interrupt number to check
public boolean isEnabled(int inum)
isEnabled()
method checks whether the specified interrupt is currently enabled.
inum
- the interrupt number to check
public void insertProbe(Simulator.InterruptProbe p, int inum)
insertProbe()
method inserts an interrupt probe on the specified interrupt. When
the specified interrupt changes state, i.e. it is either posted, unposted, or invoked, the probe
will be notified.
p
- the probe to insert on the specified interruptinum
- the interrupt on which to insert the probepublic void removeProbe(Simulator.InterruptProbe p, int inum)
removeProbe()
method removes a probe from an interrupt.
p
- the probe to remove from this interruptinum
- the interrupt number from which to remove this probepublic void insertProbe(Simulator.InterruptProbe p)
insertProbe()
method inserts a global probe on all of the interrupts. This probe
will be notified when any of the interrupts changes state, and also when the global interrupt flag
is enabled or disabled. When the global interrupt flag (master bit) is changed, the special interrupt
number 0
will be passed to the fireWhenEnabled()
method of the probe.
p
- the probe to insert on all the interruptspublic void removeProbe(Simulator.InterruptProbe p)
removeProbe()
method removes a global probe from all of the interrupts.
p
- the probe to remove from all of the interruptspublic int getNumberOfInterrupts()
getNumberOfInterrupts()
method returns the number of interrupts in this interrupt table.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |