Mailing Lists: Apple Mailing Lists

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

Re: Adding a second PCI interrupt handler



Title: Re: Adding a second PCI interrupt handler
Ron,
        PCI Devices are only allowed to use one interrupt per function.  IOPCIDevice's will always only have one interrupt at index zero.  Some of the devices built in to Apple's core logic are designed to to have multiple interrupts, device, dma, Tx, Rx, etc.
                                                                Josh

At 10:32 AM -0400 9/24/04, Ron Duritsch wrote:
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/decesare%40apple.com

This email sent to email@hidden

 _______________________________________________
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

References: 
 >Adding a second PCI interrupt handler (From: Ron Duritsch <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.