亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? isr_dpc.c

?? PCI硬件的驅動程序范例
?? C
?? 第 1 頁 / 共 2 頁
字號:
///////////////////////////////////////////////////////////////////////////////
//
//    (C) Copyright 1995 - 1997 OSR Open Systems Resources, Inc.
//    All Rights Reserved
//
//    This sofware is supplied for instructional purposes only.
//
//    OSR Open Systems Resources, Inc. (OSR) expressly disclaims any warranty
//    for this software.  THIS SOFTWARE IS PROVIDED  "AS IS" WITHOUT WARRANTY
//    OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
//    THE IMPLIED WARRANTIES OF MECHANTABILITY OR FITNESS FOR A PARTICULAR
//    PURPOSE.  THE ENTIRE RISK ARISING FROM THE USE OF THIS SOFTWARE REMAINS
//    WITH YOU.  OSR's entire liability and your exclusive remedy shall not
//    exceed the price paid for this material.  In no event shall OSR or its
//    suppliers be liable for any damages whatsoever (including, without
//    limitation, damages for loss of business profit, business interruption,
//    loss of business information, or any other pecuniary loss) arising out
//    of the use or inability to use this software, even if OSR has been
//    advised of the possibility of such damages.  Because some states/
//    jurisdictions do not allow the exclusion or limitation of liability for
//    consequential or incidental damages, the above limitation may not apply
//    to you.
//
//    OSR Open Systems Resources, Inc.
//    105 Route 101A Suite 19
//    Amherst, NH 03031  (603) 595-6500 FAX: (603) 595-6503
//    email bugs to: bugs@osr.com
//
//
//    MODULE:
//
//        ISR_DPC.C
//
//    ABSTRACT:
//
//      This file contains the ISR and DPC for the OSR Sample
//      PCI Busmaster DMA device driver for the AMCC 5933 chip.
//
//    AUTHOR(S):
//
//        OSR Open Systems Resources, Inc.
// 
//    REVISION:   
//
//
///////////////////////////////////////////////////////////////////////////////

#include "osr-pci.h"

///////////////////////////////////////////////////////////////////////////////
//
//  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);
}
    


//
// Synchronize Functions
//

///////////////////////////////////////////////////////////////////////////////
//
//  ReadIsDone
//
//    This is a synchronize function, called with the ISR spinlock held, that 
//    checks and potentially updates the READ COMPLETE bit in the IntCsr copy
//    that we keep in our device extension.  These bits must be updated under
//    lock.
//
//  INPUTS:
//
//    ServiceContext - Address of our device extension.
//
//  OUTPUTS:
//
//      None.
//
//  RETURNS:
//
//      TRUE, if a read is complete, FALSE otherwise.
//
//  IRQL:
//
//      This routine is called at IRQL == DIRQL, specifically the Synchronize
//      IRQL for the device.
//
//  NOTES:
//
//      Remember: A read operation to us is actually called a WRITE operation
//                on the AMCC device.  Ugh.  HARDWARE people!
//
///////////////////////////////////////////////////////////////////////////////
BOOLEAN
ReadIsDone(IN PVOID SynchronizeContext)
{
    POSR_DEVICE_EXT devExt = (POSR_DEVICE_EXT)SynchronizeContext;

    //
    // Is a READ operation complete on the device?
    // (Yes, the correct bit to check is _WRITE_COMP!)
    //
    if(devExt->IntCsr & AMCC_INT_WRITE_COMP)  {

        devExt->IntCsr &=  ~AMCC_INT_WRITE_COMP;

        return(TRUE);
    }
        
   return(FALSE);
}    


///////////////////////////////////////////////////////////////////////////////
//
//  WriteIsDone
//
//    This is a synchronize function, called with the ISR spinlock held, that 
//    checks and potentially updates the WRITE COMPLETE bit in the IntCsr copy
//    that we keep in our device extension.  These bits must be updated under
//    lock.
//
//  INPUTS:
//
//    ServiceContext - Address of our device extension.
//
//  OUTPUTS:
//
//      None.
//
//  RETURNS:
//
//      TRUE, if a write is complete, FALSE otherwise.
//
//  IRQL:
//
//      This routine is called at IRQL == DIRQL, specifically the Synchronize
//      IRQL for the device.
//
//  NOTES:
//
//      Remember: A write operation to us is actually called a READ operation
//                on the AMCC device.  Go figure...
//
///////////////////////////////////////////////////////////////////////////////
BOOLEAN
WriteIsDone(IN PVOID SynchronizeContext)
{
    POSR_DEVICE_EXT devExt = (POSR_DEVICE_EXT)SynchronizeContext;

    //
    // Is a WRITE operation complete on the device?
    // (Yes, the correct bit to check is _READ_COMP!)
    //
    if(devExt->IntCsr & AMCC_INT_READ_COMP)  {

        devExt->IntCsr &=  ~AMCC_INT_READ_COMP;

        return(TRUE);
    }
        
   return(FALSE);
}    

///////////////////////////////////////////////////////////////////////////////
//
//  OsrDpcForIsr
//
//      This is the DPC for ISR function.  It is called as a result of a
//      call to IoRequestDpc() in the interrupt service routine.  It handles
//      request completion, and propagation of the driver (i.e. checking the
//      queue and starting the next queued request if one is pending).
//
//  INPUTS:
//
//    Dpc - Address of our DPC Object.
//
//    Unused - Unused.
//
//    Context - Address of our device extension.
//
//  OUTPUTS:
//
//      None.
//
//  RETURNS:
//
//    None.
//
//  IRQL:
//
//    This routine is called at IRQL == IRQL_DISPATCH_LEVEL
//
//  NOTES:
//
///////////////////////////////////////////////////////////////////////////////
VOID
OsrDpcForIsr(PKDPC Dpc, PDEVICE_OBJECT DeviceObject, PIRP Unused, PVOID Context)
{
    POSR_DEVICE_EXT devExt = (POSR_DEVICE_EXT) DeviceObject->DeviceExtension;
    PLIST_ENTRY entry;
    PIRP irp;
    PVOID baseVa;
    ULONG mapRegsNeeded;
       
#if DBG
    DbgPrint("----------OSRPCI DPC\n");
#endif

    //
    // Check to see if a read or Write operation has completed.  Recall that
    // this device can have both a single read and a single write in progress
    // simultaneously.
    // 
    // For each read or write complete, we need to:
    //
    //      o See if the entire buffer has been DMA'ed.  It is possible that
    //          due to physical buffer fragmentation (since this driver does
    //          not support scatter/gather), or due to map register limitations,
    //          we have had to break the user's request up into multiple DMA
    //          transfers.
    //
    //      o If the entire buffer has not been DMA'ed, and the current request
    //          has not been cancelled, we set up another DMA transfer, starting
    //          from where the previous DMA left off. 
    //
    //      o If the entire buffer HAS been DMA'ed, or the current request has
    //          been cancelled, we complete the request with the appropriate
    //          status. We then try to remove an entry from the relevant queue
    //          and start it on the device.  If we happen to remove an IRP with
    //          the cancel flag set, we cancel it, and try to get another IRP
    //          from the queue.  Note this cancel check is required to catch
    //          the case of the IRP being cancelled while we are in the DpcForIsr.
    //  
    // Note that in our simple model of the world, transfer complete means
    // transfer SUCCESSFULLY complete.  This sample driver does not attempt
    // error detection, reporting, or recovery.
    //

    //
    // Write complete??
    //
    if( KeSynchronizeExecution(devExt->InterruptObject,
                                WriteIsDone,
                                devExt) )  {
#if DBG
        DbgPrint("---Write Done\n");
#endif

        //
        // Get the write queue lock
        //
        KeAcquireSpinLockAtDpcLevel(&devExt->WriteQueueLock);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美自拍偷拍一区| 在线观看日韩精品| 天天综合色天天| 亚洲欧美偷拍另类a∨色屁股| 日韩亚洲欧美综合| 欧美日韩亚州综合| av男人天堂一区| 国产在线不卡一区| 美女网站视频久久| 日本亚洲电影天堂| 亚洲成av人在线观看| 亚洲素人一区二区| 国产精品欧美久久久久无广告| 精品人在线二区三区| 日韩欧美国产午夜精品| 日韩一区二区三区在线观看| 欧美男男青年gay1069videost| 成人精品在线视频观看| 高清免费成人av| 99re热这里只有精品视频| 成人av电影免费在线播放| 成人av在线看| 色偷偷久久人人79超碰人人澡| av中文字幕亚洲| 91福利国产精品| 日韩天堂在线观看| 久久亚洲精精品中文字幕早川悠里| 日韩免费高清av| 日本一区二区三区四区| 亚洲欧美日韩在线| 日韩激情av在线| 国产露脸91国语对白| 99re66热这里只有精品3直播 | 亚洲综合网站在线观看| 奇米在线7777在线精品| 成人av在线观| 日韩精品一区二区三区蜜臀| 国产欧美一区二区精品婷婷| 亚洲精品中文字幕乱码三区| 黑人巨大精品欧美黑白配亚洲| 岛国精品在线观看| 欧美日韩国产综合一区二区 | 日韩一区二区中文字幕| 中文字幕巨乱亚洲| 蜜臀久久久99精品久久久久久| 成人av免费观看| 精品久久久久一区二区国产| 亚洲一区二区三区中文字幕| 成人妖精视频yjsp地址| 欧美一区二区精品| 亚洲第一狼人社区| 成人av电影在线播放| 久久尤物电影视频在线观看| 日韩av二区在线播放| 91国在线观看| 亚洲欧美日韩在线| 91在线看国产| 国产精品成人午夜| 成人美女在线视频| 国产欧美一区二区在线| 国产精品一区二区视频| 欧美精品一区二区三区在线| 秋霞成人午夜伦在线观看| 欧美欧美欧美欧美首页| 亚洲国产精品一区二区www在线| 91丨九色丨蝌蚪富婆spa| 亚洲精品乱码久久久久久久久 | 久久精品一区二区三区av| 美女尤物国产一区| 欧美精品一区二区三区高清aⅴ | 久久不见久久见免费视频7 | 91福利国产精品| 偷拍一区二区三区| 欧美电视剧在线看免费| 国产精一品亚洲二区在线视频| 精品88久久久久88久久久| 国产99久久久精品| 亚洲日本一区二区三区| 欧美系列日韩一区| 久久精品国产精品亚洲红杏| 久久久不卡网国产精品一区| 成人久久久精品乱码一区二区三区| 亚洲视频在线一区观看| 欧美精品1区2区3区| 国产一区视频导航| 一区二区三区不卡视频| 欧美日韩亚洲国产综合| 国产成人午夜精品影院观看视频| 欧美激情一区三区| 欧美日产在线观看| 成人的网站免费观看| 久久精品99国产精品| 亚洲乱码中文字幕| 精品精品国产高清a毛片牛牛| av一区二区三区| 久久精品国产**网站演员| 亚洲啪啪综合av一区二区三区| 日韩一级精品视频在线观看| 91国在线观看| 99久久精品国产观看| 麻豆精品视频在线观看免费| 亚洲午夜精品一区二区三区他趣| 久久久噜噜噜久久中文字幕色伊伊 | 国产一区不卡视频| 日日噜噜夜夜狠狠视频欧美人| 国产精品激情偷乱一区二区∴| 日韩免费视频一区| 欧美性大战xxxxx久久久| 成人18精品视频| 99re6这里只有精品视频在线观看| 国产一区二区三区香蕉| 激情六月婷婷久久| 国产资源精品在线观看| 国内欧美视频一区二区| 精品一区二区三区视频| 青青草精品视频| 日本欧美在线看| 精品综合久久久久久8888| 美国一区二区三区在线播放| 免费看欧美美女黄的网站| 日韩二区在线观看| 久久精品国产澳门| 国产成人综合自拍| 99天天综合性| 欧美性受xxxx黑人xyx| 欧美性生活久久| 欧美丰满嫩嫩电影| 欧美大胆人体bbbb| 国产人成亚洲第一网站在线播放| 国产精品久久久久桃色tv| 亚洲精品老司机| 日本不卡在线视频| 国产成人午夜电影网| 欧美四级电影在线观看| 日韩视频国产视频| 亚洲欧洲av另类| 奇米影视一区二区三区小说| 国产suv精品一区二区6| 91福利视频在线| 亚洲精品一区二区三区在线观看| 亚洲国产激情av| 日韩va欧美va亚洲va久久| 国产suv精品一区二区三区| 欧美色综合影院| 国产精品理伦片| 无码av免费一区二区三区试看| 国内精品久久久久影院色| 91九色02白丝porn| 国产精品少妇自拍| 国产一区日韩二区欧美三区| 欧美理论在线播放| 亚洲国产精品久久久久婷婷884| 国产综合色精品一区二区三区| 欧美色涩在线第一页| 中文字幕一区二区三区不卡| 久久电影网电视剧免费观看| 91麻豆蜜桃一区二区三区| 久久综合九色综合97婷婷| 日韩综合在线视频| 欧美性受xxxx| 亚洲一级二级三级| 在线欧美日韩国产| 一区二区不卡在线播放| 在线中文字幕一区| 亚洲视频小说图片| 91久久精品国产91性色tv| 日韩伦理免费电影| 欧美在线视频你懂得| 亚洲一区二区四区蜜桃| 欧美中文一区二区三区| 亚洲国产精品久久不卡毛片| 91久久人澡人人添人人爽欧美| 亚洲免费伊人电影| 欧美三级乱人伦电影| 爽好多水快深点欧美视频| 69堂国产成人免费视频| 日本不卡一二三| 久久久影视传媒| www.视频一区| 一区二区三区中文字幕精品精品 | 国产剧情av麻豆香蕉精品| 国产午夜精品久久| 不卡的av中国片| 午夜天堂影视香蕉久久| 日韩亚洲欧美高清| 99精品一区二区三区| 五月婷婷综合激情| 久久男人中文字幕资源站| 色94色欧美sute亚洲线路一久| 午夜精品福利一区二区蜜股av| 日韩欧美自拍偷拍| 99久免费精品视频在线观看| 奇米影视一区二区三区| 中文一区二区完整视频在线观看 | 亚洲一区在线播放| 国产欧美日韩中文久久| 欧美午夜宅男影院| 成人不卡免费av| 国产主播一区二区三区| 亚洲午夜电影网|