op_intrpt_code()

摘要

获取与调用进程当前中断相关联的数字代码。

语法

op_intrpt_code ()
参数 类型 说明
无参数

返回类型

int

与当前中断相关联的数字代码。

[该值是一个具有用户定义解释的整数;该值在通过 op_intrpt_schedule_self()、op_intrpt_schedule_remote()、op_intrpt_force_remote() 等请求中断时提供。通常,该值标识中断的用途。]

示例

改编摘自:示例模型(models/std/x25);进程模型(x25_dce_chan);状态(p7);退出执行(exit execs)。

switch (op_intrpt_type())
	{
	case OPC_INTRPT_SELF:
		{
		/* Test if the timer that expired is ’T13’ */
		if (op_intrpt_code () == X25C_T13)
			{
			/* If this is the first expiration, retransmit the clear indication */
			/* to the DTE and increment the expiration counter. */
			if (retry_count [X25C_T13] == 0)
				{
				x25_pk_send_local (chan_vars->data_link, chan_vars->number,
					X25_GFI_BASE, X25C_PT_CLEAR_INDICATION,
					X25C_RC_LOC_PROC_ERROR, 50);
				retry_count [X25C_T13]++;
				x25_dce_trace_msg ("Timer T13 expired;
					resend clear indication to DTE");
				}
			}
		else
			{. . .}

详情

该内核过程仅在与某个具有关联代码的中断之后调用时才会产生有效结果。支持这些代码的中断类型有自中断、进程中断、远程中断和过程调用中断。

用途

提供了一种确定与中断相关联的用户定义数字代码以识别其用途的机制。当同一类型存在多个与不同用途相关联的挂起中断时,这是必需的。一个例子是由自中断界定的多个超时间隔。

错误

不会捕获任何错误。

参考

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · 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