Mac Developer Library

Developer

IOInterruptEventSource Class Reference

Options
Deployment Target:

On This Page
Language:

IOInterruptEventSource

Event source for interrupt delivery to work-loop based drivers. More...

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Not Applicable @import Kernel;

Availability


Available in OS X v10.0 and later.
  • Pure Virtual member function used by IOWorkLoop for issueing a client calls.

    Declaration

    C++

    virtual bool checkForWork();

    Return Value

    Return true if this function needs to be called again before all its outstanding events have been processed.

    Discussion

    This function called when the work-loop is ready to check for any work to do and then to call out the owner/action.

    Import Statement

  • Disable event source.

    Declaration

    C++

    virtual void disable();

    Discussion

    A subclass implementation is expected to respect the enabled state when checkForWork is called.

    Import Statement

  • Functions that get called by the interrupt controller.See $link IOService::registerInterrupt

    Declaration

    C++

    virtual void disableInterruptOccurred( void *, IOService *nub, intind);

    Parameters

    nub

    Where did the interrupt originate from

    ind

    What is this interrupts index within 'nub'.

    Import Statement

  • Enable event source.

    Declaration

    C++

    virtual void enable();

    Discussion

    A subclass implementation is expected to respect the enabled state when checkForWork is called. Calling this function will cause the work-loop to be signalled so that a checkForWork is performed.

    Import Statement

  • Sub-class implementation of free method, disconnects from the interrupt source.

    Declaration

    C++

    virtual void free();

    Import Statement

  • Get'ter for $link autoDisable variable.

    Declaration

    C++

    virtual bool getAutoDisable() const;

    Return Value

    value of autoDisable.

    Import Statement

  • Get'ter for $link intIndex interrupt index variable.

    Declaration

    C++

    virtual int getIntIndex() const;

    Return Value

    value of intIndex.

    Import Statement

  • Get'ter for $link provider variable.

    Declaration

    C++

    virtual const IOService *getProvider() const;

    Return Value

    value of provider.

    Import Statement

  • Primary initialiser for the IOInterruptEventSource class.

    Declaration

    C++

    virtual bool init( OSObject *owner, Action action, IOService *provider = 0, int intIndex = 0);

    Parameters

    owner

    Owning client of the new event source.

    action

    'C' Function to call when something happens.

    provider

    IOService that represents the interrupt source. Defaults to 0. When no provider is defined the event source assumes that the client will in some manner call the interruptOccured method explicitly. This will start the ball rolling for safe delivery of asynchronous event's into the driver.

    intIndex

    The index of the interrupt within the provider's interrupt sources. Defaults to 0, i.e. the first interrupt in the provider.

    Return Value

    true if the inherited classes and this instance initialise successfully.

    Import Statement

  • Factory function for IOInterruptEventSources creation and initialisation.

    Declaration

    C++

    static IOInterruptEventSource * interruptEventSource( OSObject *owner, Action action, IOService *provider = 0, int intIndex = 0);

    Parameters

    owner

    Owning client of the new event source.

    action

    'C' Function to call when something happens.

    provider

    IOService that represents the interrupt source. Defaults to 0. When no provider is defined the event source assumes that the client will in some manner call the interruptOccured method explicitly. This will start the ball rolling for safe delivery of asynchronous event's into the driver.

    intIndex

    The index of the interrupt within the provider's interrupt sources. Defaults to 0, i.e. the first interrupt in the provider.

    Return Value

    A new interrupt event source if successfully created and initialised, 0 otherwise.

    Import Statement

  • Functions that get called by the interrupt controller. See $link IOService::registerInterrupt

    Declaration

    C++

    virtual void interruptOccurred( void *, IOService *nub, intind);

    Parameters

    nub

    Where did the interrupt originate from

    ind

    What is this interrupts index within 'nub'.

    Import Statement

  • Functions that get called by the interrupt controller.See $link IOService::registerInterrupt

    Declaration

    C++

    virtual void normalInterruptOccurred( void *, IOService *nub, intind);

    Parameters

    nub

    Where did the interrupt originate from

    ind

    What is this interrupts index within 'nub'.

    Import Statement

  • Sub-class implementation of setWorkLoop method.

    Declaration

    C++

    virtual void setWorkLoop( IOWorkLoop *inWorkLoop);

    Import Statement

  • Tries to reduce latency for an interrupt which will be received near a specified time.

    Declaration

    C++

    IOReturn warmCPU( uint64_tabstime);

    Parameters

    abstime

    Time at which interrupt is expected.

    Discussion

    Warms up a CPU in advance of an interrupt so that the interrupt may be serviced with predictable latency. The warm-up is not periodic; callers should call warmCPU once in advance of each interrupt. It is recommended that requests be issues in serial (i.e. each after the target for the previous call has elapsed), as there is a systemwide cap on the number of outstanding requests. This routine may be disruptive to the system if used with very small intervals between requests; it should be used only in cases where interrupt latency is absolutely critical, and tens or hundreds of milliseconds between targets is the expected time scale. NOTE: it is not safe to call this method with interrupts disabled.

    Import Statement

Callbacks

  • Declaration

    C++

    typedef void ( * Action )( OSObject *, IOInterruptEventSource *, int count);

    Parameters

    owner

    Pointer to client instance.

    sender

    Pointer to generation interrupt event source.

    count

    Number of interrupts seen before delivery.

    Discussion

    'C' pointer prototype of functions that are called in a single threaded context when an interrupt occurs.

    Import Statement

    Availability

    Available in OS X v10.0 through OS X v10.5.

Constants

  • Declaration

    CPlusPlus

    #define IOInterruptEventAction IOInterruptEventSource::Action

    Constants

    • IOInterruptEventAction

      IOInterruptEventAction

      Backward compatibilty define for the old non-class scoped type definition. See $link IOInterruptEventSource::Action

      Available in OS X v10.0 and later.

    Import Statement

  • Data Types

    • Declaration

      C++

      struct ExpansionData { };

      Discussion

      This structure will be used to expand the capablilties of the IOWorkLoop in the future.

    Instance Variables

    • Reserved for future use. (Internal use only)

      Declaration

      C++

      ExpansionData *reserved;

    • IOService that provides interrupts for delivery.

      Declaration

      C++

      IOService *provider;

    • Current count of produced interrupts that have been received.

      Declaration

      C++

      volatile unsigned int producerCount;

    • Declaration

      C++

      int intIndex;

    • Has the user expicitly disabled this event source, if so then do not overide their request when returning from the callout

      Declaration

      C++

      bool explicitDisable;

    • Current count of produced interrupts that the owner has been informed of.

      Declaration

      C++

      unsigned int consumerCount;

    • Do we need to automatically disable the interrupt source when we take an interrupt, i.e. we are level triggered.

      Declaration

      C++

      bool autoDisable;