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

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com