X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/3e170ce000f1506b7b5d2c5c7faec85ceabb573d..e8c3f78193f1895ea514044358b93b1add9322f3:/iokit/Kernel/IOEventSource.cpp?ds=inline diff --git a/iokit/Kernel/IOEventSource.cpp b/iokit/Kernel/IOEventSource.cpp index 3393993e0..76c2d5032 100644 --- a/iokit/Kernel/IOEventSource.cpp +++ b/iokit/Kernel/IOEventSource.cpp @@ -36,6 +36,7 @@ HISTORY #include #include +#include #define super OSObject @@ -162,6 +163,8 @@ bool IOEventSource::init(OSObject *inOwner, void IOEventSource::free( void ) { IOStatisticsUnregisterCounter(); + + if ((kActionBlock & flags) && actionBlock) Block_release(actionBlock); if (reserved) IODelete(reserved, ExpansionData, 1); @@ -169,13 +172,41 @@ void IOEventSource::free( void ) super::free(); } -IOEventSource::Action IOEventSource::getAction () const { return action; }; +void IOEventSource::setRefcon(void *newrefcon) +{ + refcon = newrefcon; +} + +void * IOEventSource::getRefcon() const +{ + return refcon; +} + +IOEventSource::Action IOEventSource::getAction() const +{ + if (kActionBlock & flags) return NULL; + return (action); +} + +IOEventSource::ActionBlock IOEventSource::getActionBlock(ActionBlock) const +{ + if (kActionBlock & flags) return actionBlock; + return (NULL); +} void IOEventSource::setAction(Action inAction) { + if ((kActionBlock & flags) && actionBlock) Block_release(actionBlock); action = inAction; } +void IOEventSource::setActionBlock(ActionBlock block) +{ + if ((kActionBlock & flags) && actionBlock) Block_release(actionBlock); + actionBlock = Block_copy(block); + flags |= kActionBlock; +} + IOEventSource *IOEventSource::getNext() const { return eventChainNext; }; void IOEventSource::setNext(IOEventSource *inNext)