--
addr = (uint8_t*) bigphysarea_alloc_pages(numberOfPages, 0, GFP_KERNEL);
this addr is 0x84773000
--
Later on this memory is maaped to user space.That's the code-
----
vma->vm_flags |= VM_RESERVED; // tell the system not to swap out the memory
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); // make the memory uncacheable
vma->vm_ops = &surface_vm_ops; // set the vm ops
vma->vm_private_data = surface; // point to our device variables
if( remap_pfn_range(vma, vma->vm_start,
(unsigned long)(surface->buffer) >> PAGE_SHIFT,
vma->vm_end - vma->vm_start,
vma->vm_page_prot) )
{
return -EAGAIN; // system busy, try again later
}
---
That's the mapping which i see in /proc/self/maps from user application.
---
298a4000-298f9000 rw-s 00000000 00:0b 58425601 /dev/nds/surface3
--
later on when user give that user application give address '298a4000' to another device ( this device doesn't know the physical address for this user space address).This second device need to convert that user address to kernel address so that it can write to the corresponding kernel space.
I wanna know the function for the converting user space ''298a4000''' mapped address to original kernel space address ''0x84773000''.
Thanks
-manisha
On 8/24/06, Arjan van de Ven <arjan@xxxxxxxxxxxxx> wrote:
On Wed, 2006-08-23 at 17:56 -0700, Manisha Maheshwari wrote:
>
> I have mapped a device '/dev/nds/surface3 ' into user address
> space.That's the mapping which i see in /proc/self/maps.
> ---
> 298a4000-298f9000 rw-s 00000000 00:0b 58425601 /dev/nds/surface3
> --
> later on when user give that user address '298a4000' to another
> device ( this device doesn't know the physical address for this user
> space address).This second device need to convert that user address to
> kernel address so that it can write to the corresponding kernel space.
>
> I don't wanna do copy_from_user or copy_to_user becoz it's a big chunk
> of memory.Moreover this is already allocated in kernel and i wanna
> work on the same chunk of memory.
I suspect that at this point showing us the sourcecode is going to be
the only way we can really understand what you are trying to do and/or
making useful suggestions...