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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? isr_dpc.c

?? PCI硬件的驅(qū)動程序范例
?? 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);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品国久久99热| 美女在线一区二区| 日韩在线一区二区三区| 91丝袜呻吟高潮美腿白嫩在线观看| 欧美精品一区二区三| 午夜av一区二区三区| 精品视频全国免费看| 亚洲乱码中文字幕综合| 精品国产乱码久久久久久牛牛| 在线免费一区三区| 亚洲一区在线观看免费观看电影高清 | 国产亚洲欧美一级| 国产真实精品久久二三区| 精品少妇一区二区三区日产乱码| 理论电影国产精品| 久久久电影一区二区三区| jlzzjlzz亚洲女人18| 日本一区二区成人在线| 色中色一区二区| 亚洲国产综合91精品麻豆| 欧美变态tickling挠脚心| 欧美日韩国产精品成人| 免费成人美女在线观看.| 国产日韩亚洲欧美综合| 91最新地址在线播放| 亚洲va中文字幕| 久久综合久久鬼色中文字| www.亚洲人| 盗摄精品av一区二区三区| 亚洲裸体xxx| 91精品国产一区二区三区蜜臀| 黄色日韩三级电影| 日本人妖一区二区| 国产精品水嫩水嫩| 欧美精品三级日韩久久| 高清国产午夜精品久久久久久| 亚洲国产综合人成综合网站| 一区二区在线观看免费视频播放 | 久久久综合精品| 欧美成人一区二区| 欧美mv日韩mv国产网站app| 制服丝袜激情欧洲亚洲| 国产九色精品成人porny| 亚洲女子a中天字幕| 亚洲视频一区二区在线| 日韩午夜在线影院| 色88888久久久久久影院按摩| 精油按摩中文字幕久久| 亚洲图片欧美色图| 爽好久久久欧美精品| 日韩av网站在线观看| 日本不卡一二三| 精品一区二区影视| 国产精品一卡二卡在线观看| 粉嫩av亚洲一区二区图片| thepron国产精品| 在线观看视频一区二区欧美日韩| 在线观看日产精品| 欧美一三区三区四区免费在线看| 69av一区二区三区| 欧美精品一区二区不卡| 国产欧美日韩综合精品一区二区| 国产精品午夜电影| 一区二区免费看| 国产精品美女久久久久久| 亚洲人被黑人高潮完整版| 亚洲地区一二三色| 久久成人麻豆午夜电影| 国产成人av电影在线观看| 日本韩国欧美三级| 日韩欧美色综合网站| 91精品国产综合久久久久久漫画| 欧美成人性战久久| 亚洲三级在线免费观看| 丝袜美腿亚洲色图| 国产成人精品一区二区三区网站观看 | 欧美国产欧美综合| 亚洲国产美女搞黄色| 国产又黄又大久久| 久久精品国产一区二区| 白白色亚洲国产精品| 欧美精品在欧美一区二区少妇| 久久中文娱乐网| 亚洲一区在线观看视频| 国产一区二区电影| 欧美在线制服丝袜| 久久精品一区二区三区四区| 亚洲激情欧美激情| 国精产品一区一区三区mba视频| 不卡视频在线观看| 99久久99久久精品国产片果冻| 欧美肥大bbwbbw高潮| 国产精品久久久久久久久久久免费看 | 国产精品一区2区| 欧美视频一区二区三区在线观看 | 日韩一区二区高清| 亚洲欧美另类久久久精品2019| 麻豆91在线播放| 欧美在线不卡一区| 欧美激情一区二区三区全黄| 蜜乳av一区二区| 欧美日韩一二三区| 亚洲欧洲精品一区二区三区不卡 | 亚洲另类春色校园小说| 黑人精品欧美一区二区蜜桃| 欧美午夜精品理论片a级按摩| 国产亚洲欧洲一区高清在线观看| 日韩精品电影一区亚洲| 一本大道久久精品懂色aⅴ| 久久久久国产精品人| 日韩电影一区二区三区| 欧美私人免费视频| 亚洲视频一区在线观看| 成人国产在线观看| 久久久久久久性| 黑人巨大精品欧美一区| 日韩美女视频一区二区在线观看| 亚洲va韩国va欧美va| 色综合天天综合网国产成人综合天| 97成人超碰视| 国产精品私人影院| 成人免费高清在线| 欧美激情在线一区二区| 国产乱妇无码大片在线观看| 日韩精品影音先锋| 免费在线观看一区二区三区| 欧美二区三区的天堂| 日韩精品色哟哟| 6080yy午夜一二三区久久| 亚洲成a人片在线不卡一二三区| 色菇凉天天综合网| 亚洲一线二线三线视频| 欧美午夜精品电影| 亚洲国产美国国产综合一区二区| 在线精品视频小说1| 亚洲国产日日夜夜| 在线成人免费视频| 男女激情视频一区| 久久噜噜亚洲综合| 国产成人鲁色资源国产91色综| 国产精品视频第一区| eeuss鲁片一区二区三区在线看| 国产精品高清亚洲| 91捆绑美女网站| 亚洲一区免费观看| 欧美精品第1页| 蜜臀久久99精品久久久久久9| 日韩免费看的电影| 国产a区久久久| 亚洲欧美aⅴ...| 5858s免费视频成人| 精品中文字幕一区二区| 国产欧美日韩不卡免费| 99视频精品在线| 亚洲h动漫在线| 日韩欧美国产系列| 丁香桃色午夜亚洲一区二区三区| 中文字幕在线不卡视频| 91九色02白丝porn| 青青草成人在线观看| 国产亚洲欧美日韩在线一区| 99久久亚洲一区二区三区青草| 一区二区三区在线视频免费| 在线成人高清不卡| 国产精品自拍毛片| 亚洲三级理论片| 91精品国产aⅴ一区二区| 国产黑丝在线一区二区三区| 亚洲免费伊人电影| 日韩午夜在线影院| av电影一区二区| 全国精品久久少妇| 国产精品污www在线观看| 欧美日韩在线播放三区四区| 裸体歌舞表演一区二区| 中文字幕一区在线观看视频| 欧美日韩国产精选| 成人黄色免费短视频| 天天操天天综合网| 中文字幕av免费专区久久| 欧美日韩一卡二卡| 国产成人啪免费观看软件| 亚洲图片有声小说| 国产精品视频一区二区三区不卡| 欧美电影一区二区| 不卡一卡二卡三乱码免费网站| 丝袜脚交一区二区| 亚洲欧美一区二区三区久本道91 | 国产综合色精品一区二区三区| 综合久久久久综合| 精品国产免费视频| 在线观看亚洲专区| 成人丝袜18视频在线观看| 日日摸夜夜添夜夜添亚洲女人| 国产精品传媒在线| 久久综合五月天婷婷伊人| 欧美吞精做爰啪啪高潮| 99国产麻豆精品| 国产老妇另类xxxxx| 日韩黄色片在线观看|