Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool IODMAEventSource::init(
- OSObject *inOwner,
- IOService *inProvider,
- Action inCompletion,
- Action inNotification,
- UInt32 inDMAIndex
- ) {
- IOReturn result;
- if (!super::init(inOwner)) {
- return false;
- }
- if (inProvider == 0) {
- return false;
- }
- dmaProvider = inProvider;
- dmaIndex = 0xFFFFFFFF;
- dmaCompletionAction = inCompletion;
- dmaNotificationAction = inNotification;
- dmaController = IODMAController::getController(dmaProvider, inDMAIndex);
- if (dmaController == 0) {
- return false;
- }
- dmaController->retain();
- result = dmaController->initDMAChannel(dmaProvider, this, &dmaIndex, inDMAIndex);
- if (result != kIOReturnSuccess) {
- return false;
- }
- queue_init(&dmaCommandsCompleted);
- dmaCommandsCompletedLock = IOSimpleLockAlloc();
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment