Re: cross-bounday memory communication b/w user app and the Kernel.How?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com On Jun 2, 2006, at 12:28 AM, rohit dhamija wrote: Thanks for your suggestion, but i need to tell you two things : That's entirely possible. You don't. The descriptor refers to the buffer that already exists in the user-space process' address space. You don't need to copy anything. I know that the descriptor refers to the buffer only. But say for example I wish to set this data to all zero's. So in this case: (a) will I give address of the structure OR (b) address of IOMemoryDescriptor,, as the first parameter to memset ? = Mike _______________________________________________ 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... 1. I am sure that you did not get my question right. Regarding my query, I'm not sure why you would want to do this. If you want a buffer full of zeroes, you would create an IOBufferMemoryDescriptor, since that will have private memory associated with it, already mapped into your address space. In your example, you want to send the command buffer that the user has supplied, so you need a descriptor that refers to it. Neither. The IOMemoryDescriptor is a class instance, and the structure pointer in your example just points to a couple of pointers. You can't use the pointers inside the structure, because they are not valid in your address space. Why do you want to change the contents of the command buffer? In the typical interface model, the caller is not going to expect you to do anything to it. Mapping it so that you can write into it will be expensive, too. Similarly what if I want to copy the data AGAIN in my driver side ? Do I need to send the address of structure to the memcpy ? Or do i need to pass address of IOMemoryDescriptor as the first parameter to memcpy. You don't want to copy the data at all, unless you are going to modify it before you send it out. I hope I am able to clarify my query. Please comment. Not really. I don't yet understand why you are obsessed with copying this data... This email sent to site_archiver@lists.apple.com
participants (1)
-
Michael Smith