linux-mips
[Top] [All Lists]

Question about copy_from_user()

To: linux@cthulhu.engr.sgi.com
Subject: Question about copy_from_user()
From: Hiroyuki Machida <machida@sm.sony.co.jp>
Date: Wed, 16 Feb 2000 18:34:29 +0900
Sender: owner-linuxmips@oss.sgi.com
Hi.

I think I found a redundant code in copy_from_user() and
__copy_from_user() at current CVS asm-mips/uaccess.h.

I think '*'-marked part in the definiton is obsolete and
redundant. It had to used in the exception fixup routine as
commented at arch/mips/lib/memcpy.S. (Of course the comment is also
obsolete, I think.)

#define __copy_from_user(to,from,n) ({ \
        void *__cu_to; \
        const void *__cu_from; \
        long __cu_len; \
        \
        __cu_to = (to); \
        __cu_from = (from); \
        __cu_len = (n); \
        __asm__ __volatile__( \
                "move\t$4, %1\n\t" \
                "move\t$5, %2\n\t" \
                "move\t$6, %3\n\t" \
*               ".set\tnoat\n\t" \
*               "addu\t$1, %2, %3\n\t" \
*               ".set\tat\n\t" \
                __MODULE_JAL(__copy_user) \
                "move\t%0, $6" \
                : "=r" (__cu_len) \
                : "r" (__cu_to), "r" (__cu_from), "r" (__cu_len) \
                : "$4", "$5", "$6", "$8", "$9", "$10", "$11", "$12", "$15", \
                  "$24", "$31","memory"); \
        __cu_len; \
})

(Even if $1 is still used at the exception fixup routine, when
MODULE is defined, __MODULE_JAL will overwrite $1 at the next line.)

Is my concern correct? Please let me know.

Thanks.
---
Hiroyuki Machida
Creative Station                SCE Inc./Sony Corp.



<Prev in Thread] Current Thread [Next in Thread>