Hi mohit,

On Sun, Sep 26, 2010 at 7:38 AM, mohit verma <mohit89m...@gmail.com> wrote:
> guysssss,
>
> will u please highlight some corner points of copy_to/from_user program (the
> motive of this thread )?

What I recall from copy_to/from_user when I looked at how it was
implemented on the ARM several years ago (and this might have been
with the 2.4 version of the kernel - I don't recall), is that it
registers with the linux exception framework (which is non-trivial
IIRC) so that if it tries to access a region of memory which isn't
mapped then it causes a special type of exception rather than a normal
pagefault.

It also deals with the different address spaces. On the ARM, it turns
out that nothing really special is required. You can use memcpy and
get the same results as copy_to/from_user when the pointers and sizes
are valid. However, if an invalid pointer gets passed to memcpy, it
will cause a fault, whereas copy_to/from_user intercepts the fault
with the exception handler

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecar...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to