IOInterruptEventSource



Member Functions

checkForWork

Abstract: Pure Virtual member function used by IOWorkLoop for issueing a client calls.
protected:

virtual bool checkForWork();

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

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

disable

Abstract: Disable event source.
public:

virtual void disable();

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


disableInterruptOccurred

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

virtual void disableInterruptOccurred(void *, IOService *nub, int ind);

Parameters

NameDescription
nubWhere did the interrupt originate from
indWhat is this interrupts index within 'nub'.

enable

Abstract: Enable event source.
public:

virtual void enable();

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.


free

Abstract: Sub-class implementation of free method, disconnects from the interrupt source.
protected:

virtual void free();


getAutoDisable

Abstract: Get'ter for $link autoDisable variable.
public:

virtual bool getAutoDisable() const;

Result: value of autoDisable.

getIntIndex

Abstract: Get'ter for $link intIndex interrupt index variable.
public:

virtual int getIntIndex() const;

Result: value of intIndex.

getProvider

Abstract: Get'ter for $link provider variable.
public:

virtual const IOService *getProvider() const;

Result: value of provider.

init

Abstract: Primary initialiser for the IOInterruptEventSource class.
public:

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

Parameters

NameDescription
ownerOwning client of the new event source.
action'C' Function to call when something happens.
providerIOService 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.
intIndexThe index of the interrupt within the provider's interrupt sources. Defaults to 0, i.e. the first interrupt in the provider.
Result: true if the inherited classes and this instance initialise successfully.

interruptEventSource

Abstract: Factory function for IOInterruptEventSources creation and initialisation.
public:

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

Parameters

NameDescription
ownerOwning client of the new event source.
action'C' Function to call when something happens.
providerIOService 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.
intIndexThe index of the interrupt within the provider's interrupt sources. Defaults to 0, i.e. the first interrupt in the provider.
Result: A new interrupt event source if successfully created and initialised, 0 otherwise.

interruptOccurred

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

virtual void interruptOccurred(void *, IOService *nub, int ind);

Parameters

NameDescription
nubWhere did the interrupt originate from
indWhat is this interrupts index within 'nub'.

normalInterruptOccurred

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

virtual void normalInterruptOccurred(void *, IOService *nub, int ind);

Parameters

NameDescription
nubWhere did the interrupt originate from
indWhat is this interrupts index within 'nub'.

Member Data

Action

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

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

Parameters

NameDescription
ownerPointer to client instance.
senderPointer to generation interrupt event source.
countNumber of interrupts seen before delivery.

autoDisable

protected:
 bool autoDisable;

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


consumerCount

protected:
 unsigned int consumerCount;

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


explicitDisable

protected:
 bool explicitDisable;

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


intIndex

protected:
 int intIndex;


producerCount

protected:
 volatile unsigned int producerCount;

Current count of produced interrupts that have been received.


provider

protected:
 IOService *provider;

IOService that provides interrupts for delivery.


#defines

IOInterruptEventAction

#define IOInterruptEventAction IOInterruptEventSource::Action

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


© 2000 Apple Computer, Inc. — (Last Updated 2/23/2000)