site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Jul 18, 2008, at 12:04 PM, darwin-dev-request@lists.apple.com wrote: Something like this: class foo .... IONotifier *notify; bar *partner; bool match_routine(void *ref, IOService *newService); ... }; bool foo::start(IOService *provider) { bool match_routine(void *ref, IOService *newService) { partner = OSDynamicCast(bar, newService); ... } = Mike _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... What is the most efficient way of moving data between two kexts?Are the IOService message/messageClient calls the recommended way to do this? Do they involve memcpy? The most efficient technique is to use IOService matching to locate the partner kext and then make direct method calls between the two. Since your kext isn't really discoverable until after your start routine has returned, you are best off using a notification to find the other kext. ... notify = addNotification(gIOPublishNotification, serviceMatching("bar"), match_routine, this, 0); registerService(); return(true); } Once foo has found bar, it can introduce itself with a registration call and you can make direct inter-class calls. Note that it can be risky doing this if the two have separate workloops, since the potential for deadlock exists. Depending on what you're actually doing, you may find it convenient to have one class defer most of its setup until it finds the other, and then call getWorkLoop() in order to share workloops. This email sent to site_archiver@lists.apple.com