登录 免费注册 首页 | 行业黑名单 | 帮助
维库电子市场网
技术交流 | 电路欣赏 | 工控天地 | 数字广电 | 通信技术 | 电源技术 | 测控之家 | EMC技术 | ARM技术 | EDA技术 | PCB技术 | 嵌入式系统
驱动编程 | 集成电路 | 器件替换 | 模拟技术 | 新手园地 | 单 片 机 | DSP技术 | MCU技术 | IC 设计 | IC 产业 | CAN-bus/DeviceNe

ucos下中断是不是一定要有OSIntEnter和OSIntExit??

作者:毛克 栏目:嵌入式系统
ucos下中断是不是一定要有OSIntEnter和OSIntExit??
ucos+lwip下的8019驱动就是c啊

ucos+lwip下的8019驱动就是c啊,但是是不是一定要有OSIntEnter和OSIntExit啊??原来skyeye的代码没有啊

调试lwip时,在中断服务里面调用的程序发送了个消息给tcpip_thread认务,却没有发生认务切换,是不是这个原因啊?不过加上这两个好像也不行。

OSTCBCur->OSTCBStkPtr=pc;如何实现?


void __irq  ne2k_isr(void)
{
    u8_t  isr,curr,bnry;
    struct netif *netif;

    /////////maokor 7.1 for debug
    OSIntEnter();
    if (OSIntNesting==1){
    //    OSTCBCur->OSTCBStkPtr=pc;

        }
    //////////
    rI_ISPC =BIT_EINT1;
    //CLOSE nic
    //******************** add by maokor for debug ,2005.6.17*******
    outb(CMD_PAGE2 | CMD_NODMA | CMD_STOP,NE_CR);
    isr = inb(NE_IMR);
    //*****************************************************888888
    //in PAGE0
    outb(CMD_PAGE0 | CMD_NODMA | CMD_STOP,NE_CR);
    isr = inb(NE_ISR);

    // ram overflow interrupt
    if (isr & ISR_OVW) {
        outb(ISR_OVW,NE_ISR);        // clear interrupt
    //    ne2k_overflowProcess();              //yangye :no overflow now
    }
    
    // error transfer interrupt ,NIC abort tx due to excessive collisions    
    if (isr & ISR_TXE) {
        outb(ISR_TXE,NE_ISR);        // clear interrupt
         //temporarily do nothing
    }

    // Rx error , reset BNRY pointer to CURR (use SEND PACKET mode)
    if (isr & ISR_RXE) {
        outb(ISR_RXE,NE_ISR);        // clear interrupt
        
        outb(CMD_PAGE1 | CMD_NODMA | CMD_STOP,NE_CR);
        curr = inb(NE_CURR);
        outb(CMD_PAGE0 | CMD_NODMA | CMD_STOP,NE_CR);
        outb(curr, NE_BNRY);
    }
    
    //got packet with no errors
    if (isr & ISR_PRX) {
        outb(ISR_PRX, NE_ISR);        // clear interrupt

        outb(CMD_PAGE1 | CMD_NODMA | CMD_STOP, NE_CR);
        curr  =  inb(NE_CURR);
        outb(CMD_PAGE0 | CMD_NODMA | CMD_STOP, NE_CR);
        bnry = inb(NE_BNRY);
        //yangye 2003-1-21
        //get more than one packet until receive buffer is empty
        while(curr != bnry){
            ne2k_recv_packet(rtl8019if_netif);
            outb(CMD_PAGE1 | CMD_NODMA | CMD_STOP, NE_CR);
            curr =  inb(NE_CURR);
            outb(CMD_PAGE0 | CMD_NODMA | CMD_STOP, NE_CR);
            bnry =     inb(NE_BNRY);            
            }
    }
        
    //Transfer complelte, do nothing here
    if( isr & ISR_PTX){
        PRINT("ne2k_isr: is ISR_PTX\n");
        outb(ISR_PTX, NE_ISR);          // clear interrupt
    }
        
    outb(CMD_PAGE0 | CMD_NODMA | CMD_STOP, NE_CR);
    outb(0xff, NE_ISR);            // clear ISR    
    //open nic for next packet
    outb(CMD_PAGE0 | CMD_NODMA | CMD_RUN, NE_CR);
////////////7.1 maokor for debug
    OSIntExit();
//////////////
}



2楼: >>参与讨论
hh_wsl
根据需要确定



      OSIntEnter和OSIntExit,主要是中断潜逃管理如果你不是用这个功能自然也可以。但是不能在中断处理工程中开中断。


          一家之言,多多交流!


参与讨论
昵称:
讨论内容:
 
 
相关帖子
请教各位uclinux下EEPROM的读写
有没有哪位大侠可以进行下POWER PC系列芯片的比较啊?
大虾帮我找一个芯片
DVK-19264评估包资料
编译带MMU的ARM芯片所需要的Linux内核遇到问题,请教高手和版主
免费注册为维库电子开发网会员,参与电子工程师社区讨论,点此进入


Copyright © 1998-2006 www.dzsc.com 浙ICP证030469号