Re: cross-bounday memory communication b/w user app and the Kernel.How?
Re: cross-bounday memory communication b/w user app and the Kernel.How?
- Subject: Re: cross-bounday memory communication b/w user app and the Kernel.How?
- From: Michael Smith <email@hidden>
- Date: Fri, 2 Jun 2006 09:27:31 -0700
On Jun 2, 2006, at 12:28 AM, rohit dhamija wrote:
Thanks for your suggestion, but i need to tell you two things :
1. I am sure that you did not get my question right.
That's entirely possible.
Regarding my query,
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.
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.
So in this case: (a)
will I give address of the structure OR (b) address of
IOMemoryDescriptor,, as the first parameter to memset ?
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...
= Mike
_______________________________________________
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