我们平时使用intConnect调用挂接中断向量实际是将中断处理函数连接到vxworks内部的一个中断向量表,以MIPS为例,这个表为excBsrTbl,前几项与MIPS处理器的定义相同,但在后面保留了许多向量作为扩展使用。 intConnect为用户提供的回调函数与指针分配一小块内存(通过intHandlerCreate),并调用intVecSet将它设置到excBsrTbl中去。 intHandlerCreate用4条指令包装了用户函数,为原本不支持参数的中断处理函数提供了参数传递的功能。 FUNCPTR intHandlerCreate    (    FUNCPTR routine, /* routine to be called              */    int     parameter /* parameter to be passed to routine */    )    {    FAST UINT * pCode; /* pointer to newly synthesized code */    pCode = (UINT *) malloc (sizeof (intConnectCode));    if (pCode != NULL) { /* copy intConnectCode into new code area */ bcopy ((char *)intConnectCode, (char *)pCode, sizeof (intConnectCode)); /* set the addresses & instructions */ pCode [0]  |= HI_WORD (routine); pCode [1]  |= HI_WORD (parameter); pCode [2]  |= LO_WORD (routine); pCode [4]  |= LO_WORD (parameter); }    /*     * Flush the cache so we don't get instruction     * cache hits to wrong vector     */    CACHE_TEXT_UPDATE ((void *) pCode, sizeof (intCo...
Sail on this course and take it when it comes.