Re: Kext unload issues with kext with multiple classes
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Hey Maxim, You cannot defeat termination. You can only delay parts of termination, for the length of time B is kept open by a client. Dan Le 2010-01-27 à 05:31, Maxim Zhuravlev a écrit :
Hello,
I've got a kext, that contains several classes, say class A and class B. Instances of class B are clients of those of class A. They are loading just fine. B should be able to restrict kext unload. For this purpose I override B::terminate() which returns false if the kext shouldn't be unloaded. I expect that the whole chain A<-B<-B::userClient keeps on working in this case and kextunload returns an error. The problem is that when I unload the kext and a instance of A is being tried to be unloaded, I get the stack:
#0 B::terminate (this=0xffffff800be73100, options=1048583) #1 0xffffff800051d6be in IOService::terminateClient (this=<value temporarily unavailable, due to optimizations>, client=0xffffff800be73100, options=1048583) at /SourceCache/xnu/xnu-1486.2.11/iokit/Kernel/IOService.cpp:2235 #2 0xffffff800051d648 in IOService::requestTerminate (this=0xffffff800be73100, provider=0x100007, options=1048583) at /SourceCache/xnu/xnu-1486.2.11/iokit/Kernel/IOService.cpp:1660 #3 0xffffff800052235e in IOService::terminatePhase1 (this=0xffffff800c037800, options=7) at /SourceCache/xnu/xnu-1486.2.11/iokit/Kernel/IOService.cpp:1727 #4 0xffffff80005224c4 in IOService::terminate (this=<value temporarily unavailable, due to optimizations>, options=<value temporarily unavailable, due to optimizations>) at /SourceCache/xnu/xnu-1486.2.11/iokit/Kernel/IOService.cpp:2246 #5 0xffffff800052ee3b in _terminateDrivers (matching=0xffffff800c106880) at /SourceCache/xnu/xnu-1486.2.11/iokit/Kernel/IOCatalogue.cpp:609 ...
Here frame 4 relates to A instance termination.
B::terminate() returns false, but IOService::requestTerminate does't check the result and proceeds B's instance termination. What is the right way to handle my requirements?
Thanks in advance. _______________________________________________ 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