Preventing IOKit kext unload
Preventing IOKit kext unload
- Subject: Preventing IOKit kext unload
- From: Bogdan Harjoc <email@hidden>
- Date: Fri, 13 Aug 2010 14:55:47 +0300
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden