📄 intdisc.c
字号:
/* * File: intDisconnect.c * Date: September 1996 * * Description: * ----------- * This function un-installs an interrupt service routine on a Tornado/PPC board * */#include <vxWorks.h>#include <stdlib.h>#include <stdio.h>#include <symbol.h>#include <sysSymTbl.h>#include <iv.h>#include <intLib.h>/*#include <drv/intrCtl/i82378zb.h>*/typedef struct intHandlerDesc /* interrupt handler desciption */ { VOIDFUNCPTR vec; /* interrupt vector */ int arg; /* interrupt handler argument */ struct intHandlerDesc * next; /* next interrupt handler & argument */ } INT_HANDLER_DESC;extern sysIntTbl[];extern sysVmeIntTable[];STATUS intDisconnect();LOCAL int handlerDelete();/****************************************************************************** * * intDisconnect - un-install an ISR * * This routine un-installs an ISR from the interrupt vector table used by * the local and VMEbus interrupt dispatchers. * *****************************************************************************/STATUSintDisconnect(int vector){ INT_HANDLER_DESC *handler; if (vector < 16) { printf("ERROR: cannot disconnect a local bus ISR with intDisconnect\n"); return(ERROR); } if (vector > 255) { printf("ERROR: interrupt vector out of range\n"); return(ERROR); } handler = (INT_HANDLER_DESC *)sysIntTbl[(int)vector]; if (handler != NULL) { printf("disconnecting vector %d \n", vector); handlerDelete(handler); sysIntTbl[(int)vector] = NULL; } return(OK);}/****************************************************************************** * * handlerDelete() - recursively deletes ISRs from sysIntTbl vector * *****************************************************************************/LOCAL inthandlerDelete(INT_HANDLER_DESC *handler){ if (handler->next != NULL) { handlerDelete(handler->next); } free(handler); handler = NULL; return(OK);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -