2002-10-16 09:04:15

by Melkor Ainur

[permalink] [raw]
Subject: user space virtual address to a vm_area_struct

Hi,

Is there a recommended way for a driver to take an
application provided virtual address while executing
in the syscall context of that same application and
find the corresponding vm_area_struct (if exists for
that address) that spans that virtual address?

Melkor

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com


2002-10-16 11:07:28

by Brian Gerst

[permalink] [raw]
Subject: Re: user space virtual address to a vm_area_struct

Melkor Ainur wrote:
> Hi,
>
> Is there a recommended way for a driver to take an
> application provided virtual address while executing
> in the syscall context of that same application and
> find the corresponding vm_area_struct (if exists for
> that address) that spans that virtual address?
>
> Melkor

down_read(current->mm->mmap_sem);
vma = find_vma(current->mm, address);
...
up_read(current->mm->mmap_sem);

--
Brian Gerst