Re: Preventing IOKit kext unload
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Hey Bogdan, http://lists.apple.com/archives/darwin-kernel/2010/Jan/msg00028.html Dan Le 2010-08-13 à 04:55, Bogdan Harjoc a écrit :
Hello,
I have recently had to move from a generic kext to an IOKit one, in order to get the lifecycle functionality that IOKit offers. Since my kext exposes a control device, I used to return an error in the kext stop function if unregistering the control device failed (i.e. a daemon was connected to it).
But none of the IOService callbacks that kexts usually override (stop, detach, free, ...) allow returning an error. And calling provider->retain() in device->start() doesn't prevent device->stop() from being called. Neither does device->adjustBusy(+1).
What I am currently doing is I override device->terminate() and I return false if the kext is busy. But since no IOKit documentation recommends this, I assume it's not the proper way do prevent unload.
My question is, how does one prevent cleanup when the kext is still busy ? (particularly when there are non-IOKit resources in use)
Thank you. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/markarian%40apple.com
This email sent to markarian@apple.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Daniel Markarian