op_intrpt_priority_get()
Abstract
Obtains the priority setting of interrupts matching specified type and code.
Syntax
op_intrpt_priority_get (type, code)
| Argument | Type | Description |
|---|---|---|
type |
int |
type of interrupt [This is an integer numeric code that represents one of the possible interrupt types (see Table 59 “Interrupt Type Symbolic Constants“ on page 15)]. |
code |
int |
user-defined numeric code for association with the interrupt [This argument is the code value for self, remote, and multicast interrupts; the input stream index for stream interrupts; and the input statistic index for statistic interrupts.] |
Return Type
int
Value of priority assignment of interrupts that match specified type and code.
The constant OPC_INTRPT_PRIORITY_INVALID will be returned if a recoverable error occurs.
Example
/* Obtain the priority of self interrupts with code 0 */
prio_value = op_intrpt_priority_get (OPC_INTRPT_SELF, 0);
/* If the value was successfully obtained, set self interrupts */
/* with code 1 to the same. */
if (prio_value != OPC_INTRPT_PRIORITY_INVALID)
op_intrpt_priority_set (OPC_INTRPT_SELF, 1, prio_value);
Details
This KP returns the value of the priority of the interrupt type and code for the invoking module. Each module may prioritize the incoming interrupts as required for its processing, using the KP op_intrpt_priority_set(). The default priority value for all interrupts is 0.
Note: This KP is not supported by the parallel kernel. For details, see “Unsafe and Unsupported KPs“ on page 426.
Purpose
This KP is useful for retrieving the priority setting of the specified interrupt type and code. A module may need to verify that the priority is properly set.
Errors
- Program Abort: KP requires process context.
- Recoverable Error: Interrupt type (
<type>) is unrecognized.
Reference
- Use the KP op_intrpt_priority_set() to set the priority of an interrupt
- Use the KP op_intrpt_priority_set_next() to set the priority of an interrupt for only its next occurrence