Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Adding a second PCI interrupt handler



Title: Adding a second PCI interrupt handler
I am modifying a PCI driver by adding another secondary interrupt to handle DMA interrupts. I found a perfect (I thought) sample in Developer Connection that does just this, so I followed it to the letter. But whenever I create the second IOFilterInterruptEventSource, with an index of 1 (the first used an index of 0), it fails. I switched the two around so index 0 became index 1, to test if my new code was the problem, but always the second index fails.

Here’s the code. Any ideas?

Ron Duritsch
Trilobyte Software

// create and register my interrupt event source
fBoardInterrupt = IOFilterInterruptEventSource::filterInterruptEventSource(this,
                    (IOInterruptEventAction) &com_diaginc_iokit_SpotPCI::interruptOccured,
                    (IOFilterInterruptAction) &com_diaginc_iokit_SpotPCI::checkForInterrupt,
                    provider,
                    (int)0);
                        
if (fBoardInterrupt)
{
    if (fWorkLoop->addEventSource(fBoardInterrupt) != kIOReturnSuccess)
    {
        result = false;
        IOLog("%s: Failed to add interrupt event source to work loop!\n", getName());
    }
}
else
{
    result = false;
    IOLog("%s: Failed to create interrupt event source!\n", getName());
}

// R.D. 20040319 DMA interrupt – THIS FAILS
if (result == true)
{
    fDMAInterrupt = IOFilterInterruptEventSource::filterInterruptEventSource(this,
                        (IOInterruptEventAction) &com_diaginc_iokit_SpotPCI::DMAinterruptOccured,
                        (IOFilterInterruptAction) &com_diaginc_iokit_SpotPCI::checkForDMAInterrupt,
                        provider,
                        (int)1);
}

if (fDMAInterrupt)
{
    if (fWorkLoop->addEventSource(fDMAInterrupt) != kIOReturnSuccess)
    {
        result = false;
        IOLog("%s: Failed to add DMA interrupt event source to work loop!\n", getName());
    }
}
else
{
    result = false;
    IOLog("%s: Failed to create DMA interrupt event source!\n", getName());
}
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-drivers mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-drivers/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.