Re: finding the vm_struct of a C pointer

From: Aydin Okutanoglu (aydin@lcsl.metu.edu.tr)
Date: Fri Feb 18 2000 - 04:48:40 EST


hello Jim,

before all, thank you for your help.
I am trying to do a different Shared Memory implementation in linux
so i want to allocate some special memory from the user space and
then change its pagefault handlers.
I want ask some more questions:

- when allocate memory from user space it is possible to force the kernel
  to create a new vm_struct for newly allocated memory
- and it is possible to set user functions to page fault handlers of user pages
                            ^^^^
regards

>From: Jim Garlick <garlick@llnl.gov>
>To: Aydin Okutanoglu <aydin@lcsl.metu.edu.tr>
>Subject: Re: finding the vm_struct of a C pointer
>
>Aydin,
>
>There is the 'find_vma' function in mm/mmap.c which will find a vm_area_struct
>for a given address.
>
>Just curious - would you mind telling me what you're trying to do?
>Perhaps we're trying to do similar things.
>
>I'm trying to map pages of SDRAM from a PCI card into user space, and I want
>to have the nopage handler allocate pages of SDRAM on demand. So far I am
>trying to do it without calling mmap because our device is accessed via a
>new system call instead of by opening a /dev in the usual way. This has been
>an uphill battle. What we have had to do is add a function to mm/mmap.c
>which creates a new vma just for our purposes. I am contemplating a redesign
>to try to better fit the standard model.
>
>Regards,
>
>Jim Garlick
>
>
>On Thu, 17 Feb 2000, Aydin Okutanoglu wrote:
>
>> Hi,
>> I want to allocate some memory and change its default page fault handler
>> the only way that i can think is allocate memory, then find its vm_area_struct
>> and change the vm_ops. But i dont know how i can find the vm_area_struct
>> of a pointer.
>>
>> Thank you for help
>>
>>
>> -
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.rutgers.edu
>> Please read the FAQ at http://www.tux.org/lkml/
>>
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:21 EST