op_intrpt_clear_self()
Abstract
Cancels all self interrupts pending for the invoking process.
Syntax
op_intrpt_clear_self ()
| Argument | Type | Description |
|---|---|---|
| no arguments |
Return Type
void
no return value
Example
Excerpt from: example model (models/std/hssb); process model (hssb_link_mac); state (READY); exit execs.
else if (((op_intrpt_type() == OPC_INTRPT_STAT) &&
(op_intrpt_stat() == SWIRE_FROM_LINK_PKTQ_SZ)) ||
((op_intrpt_type() == OPC_INTRPT_SELF) &&
(op_intrpt_code() == PACKET_READY)))
{
/* A packet is ready to be */
/* xmitted. Try to win arbitration. */
arb_status = UNSET;
go_to_arb = TRUE;
/* Clear the self intrpts. */
op_intrpt_clear_self ();
}
Details
This KP will remove all self interrupts that have been previously scheduled by the invoking process for itself. Invoking this KP is equivalent to invoking op_ev_cancel() once for every pending self interrupt. However, since no event handles are required to identify the interrupts to be cancelled, this KP can also be used as a convenient replacement for a single invocation of op_ev_cancel() when only one self interrupt is pending (note however, that this is significantly less efficient than invoking op_ev_cancel() for the particular event handle of interest).
Self interrupts that are pending for other processes within the current module are unaffected.
Purpose
Provides a mechanism for “pulling back” all self interrupts. In its role as a convenient alternative to op_ev_cancel(), this KP can be used for the same purposes (such applications depend on the fact that only one self interrupt is pending). A unique use for this KP arises when an interrupt causes a process to decide that its current course of actions must be stopped, and several sequencing self interrupts that were scheduled in the context of the prior course of actions are no longer necessary. In such a situation, all pending self interrupts can be swept clean by invoking this KP.
Errors
- Program Abort: KP requires process context.
Reference
- Use the KP op_ev_cancel() to cancel a single self interrupt
- Use the KP op_intrpt_disable() to disable interrupts from causing process invocations
- Use the KP op_intrpt_schedule_self() to schedule a self interrupt
- Use the KP op_intrpt_schedule_remote() to schedule a remote interrupt
- Use the KP op_intrpt_schedule_call() to schedule a procedure interrupt
- Use the KP op_intrpt_schedule_process() to schedule a process interrupt