nikko
驱动小牛
驱动小牛
  • 注册日期2002-08-08
  • 最后登录2004-09-09
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1352回复:6

求中断处理程序的例子!

楼主#
更多 发布于:2002-11-13 09:12

  要求有些实际寄存器操作的东西在里面比如判断中断是否为自己的,WDN for 2000下的。

  符合要求就给分!!!!! :cool:
http://202.106.185.224/music_1024/battleraper_02_04_27.mp3
minsoft
驱动小牛
驱动小牛
  • 注册日期2001-07-30
  • 最后登录2007-03-06
  • 粉丝0
  • 关注0
  • 积分8分
  • 威望2点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2002-11-13 09:49
绝对符合要求,这是个AMCC5933的驱程中的ISR程序,来自OSR,我的DRIVER也就在上面修改一下就成的。有问题可再问。

///////////////////////////////////////////////////////////////////////////////
//
//  OsrHandleInterrupt
//
//      When the AMCC device generates an interrupt, this function is called.
//      Note that in our simple model of the world here, every transfer is
//      completed successfully.  We just don\'t bother with error detection
//      and handling.  If you wanted this to be a REAL driver, you\'d have to
//      do the appropriate error detection and handling.
//
//  INPUTS:
//
//      Interupt - Address of the KINTERRUPT Object for our device.
//  
//      ServiceContext - Address of our device extension.
//
//  OUTPUTS:
//
//      None.
//
//  RETURNS:
//
//      TRUE if our device is interrupting, FALSE otherwise.
//
//  IRQL:
//
//      This routine is called at IRQL == DIRQL.
//
//  NOTES:
//
//      As is true for all ISR\'s in NT, this routine is called with the
//      interrupt spin lock held.
//
///////////////////////////////////////////////////////////////////////////////
BOOLEAN OsrHandleInterrupt(PKINTERRUPT Interupt, PVOID ServiceContext)
{
    BOOLEAN ourDeviceInterrupting = FALSE;
    POSR_DEVICE_EXT devExt = (POSR_DEVICE_EXT)ServiceContext;
    ULONG intRegister;
    ULONG csrRegister;

#if DBG
    DbgPrint(\"OSRPCI: ISR entered\\n\");
#endif    
    
    //
    // Get the current interrupt CSR from our device
    //
    intRegister = READ_PORT_ULONG(devExt->AmccBaseRegisterAddress+ICSR_OFF);

#if DBG
    DbgPrint(\"*****************AMCC INTCSR = 0x%0x\\n\",intRegister);
    OsrPrintIntcsr(intRegister);
#endif


    //
    // Is our device presently interrupting?
    //
    if (intRegister & AMCC_INT_INTERRUPTED) {
    
        //
        // Yes, it is!
        //
        ourDeviceInterrupting = TRUE;

#if DBG
        DbgPrint(\"\\tInterrupt is ours.\\n\");
#endif

        //
        // Store away some context so when we get to our DpcForIsr we\'ll know
        // what caused the interrupt.  Specifically, we accumulate bits in the
        // \"IntCsr\" field of our device extenstion indicating what interrupts
        // we\'ve seen from the device.  Note that since we support simultaneous
        // read and write DMA operations, we could get both a read complete
        // interrupt and a write complete interrupt before the DpcForIsr has
        // had a chance to execute.  Thus, we must carefully ACCUMULATE the
        // bits.
        //
        // N.B.  We guard these bits with the Interrupt Spin Lock.  The bits
        //       cannot be set or cleared unless holding that lock.
        //
        devExt->IntCsr |= (intRegister & AMCC_INT_ACK_BITS);
                        
        //
        // Acknowledge the interrupt on the device
        //
        WRITE_PORT_ULONG(devExt->AmccBaseRegisterAddress+ICSR_OFF, intRegister);

        //
        // IF the interrupt was as a result of a READ or WRITE operation
        // completing (either with success or error) request our DpcForIsr.
        //
        if(intRegister & (AMCC_INT_READ_COMP | AMCC_INT_WRITE_COMP))  {

#if DBG
            DbgPrint(\"Requesting DPC\\n\");
#endif
            IoRequestDpc(devExt->DeviceObject, 0, NULL);
        }
        
    }

    return(ourDeviceInterrupting);
}
    
少了e,就少了全部
nikko
驱动小牛
驱动小牛
  • 注册日期2002-08-08
  • 最后登录2004-09-09
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2002-11-13 10:04
你的驱动使用什莫开发的DS?
http://202.106.185.224/music_1024/battleraper_02_04_27.mp3
Dragon2008
驱动中牛
驱动中牛
  • 注册日期2002-04-01
  • 最后登录2006-03-13
  • 粉丝0
  • 关注0
  • 积分31分
  • 威望5点
  • 贡献值0点
  • 好评度1点
  • 原创分0分
  • 专家分0分
地板#
发布于:2002-11-13 10:39
真是太巧了.
分给我,我给你原代码.用DS开发人S5933的中断处理程序.
your email?
我姓龙,我属龙,我叫龙。。。
nikko
驱动小牛
驱动小牛
  • 注册日期2002-08-08
  • 最后登录2004-09-09
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2002-11-13 11:28
全套驱动代码!  我给50分!

mail.fox@263.net
http://202.106.185.224/music_1024/battleraper_02_04_27.mp3
Dragon2008
驱动中牛
驱动中牛
  • 注册日期2002-04-01
  • 最后登录2006-03-13
  • 粉丝0
  • 关注0
  • 积分31分
  • 威望5点
  • 贡献值0点
  • 好评度1点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2002-11-13 11:32
成交!
cheers!
我姓龙,我属龙,我叫龙。。。
maccat
驱动小牛
驱动小牛
  • 注册日期2001-08-01
  • 最后登录2018-05-29
  • 粉丝0
  • 关注0
  • 积分10分
  • 威望15点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
  • 社区居民
6楼#
发布于:2005-08-11 11:18
接上面的帖子,中断服务程序做好后速度为1ms
跄~跄~跄~以德服人 答的正确 别忘给分 MY QQ:53738515 做驱动的朋友长联系
游客

返回顶部