Kext unload issues with kext with multiple classes
Kext unload issues with kext with multiple classes
- Subject: Kext unload issues with kext with multiple classes
- From: Maxim Zhuravlev <email@hidden>
- Date: Wed, 27 Jan 2010 16:31:14 +0300
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden