Subject: Re: egcs 1.1.1 assembler output for 2.2. kernel compilation.

From: Nicholas Clark <[email-masked]>
Date: Fri, 12 Mar 1999 18:26:02 +0000 (GMT)

In the last mail [email-masked] said:

> Yes.  The LDRT is generated by an inline asm.  Those asms need to be given
> constraints to tell the compiler that the input and output regs mustn't
> overlap.  GCC itself never open codes an LDRT.

How does one do this? I've no idea how inline assembler black magic works.
I've just tried compiling rmk5 + philb at -O2 and get quite a few warnings
about input and output registers being the same.

Nick
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Paul Koning <[email-masked]>
Date: Fri, 12 Mar 1999 13:56:15 -0500

The gcc info file explains how.  Look for "asm" in the index  (i then
asm).  About halfway down it mentions the "&" modifier with a
cross-reference to "Constraint Modifier Characters".  That has the
gory details.

	paul

---

From: Nicholas Clark <[email-masked]>
Date: Sat, 13 Mar 1999 12:08:35 +0000 (GMT)

> cross-reference to "Constraint Modifier Characters".  That has the

So is this the correct patch I've attached?
(Still can't boot 2.2.2 :-( )

Nick

--- include/asm-arm/proc-armv/uaccess.h~        Fri Mar 12 17:10:47 1999
+++ include/asm-arm/proc-armv/uaccess.h Sat Mar 13 00:36:56 1999
@@ -133,7 +133,7 @@
        "       .align  3\n"                                    \
        "       .long   1b, 3b\n"                               \
        "       .previous"                                      \
-       : "=r" (err), "=r" (x)                                  \
+       : "=r" (err), "=&r" (x)                                 \
        : "r" (addr), "i" (EFAULT), "0" (err))
 
 #define __get_user_asm_half(x,addr,err)                                \
@@ -155,7 +155,7 @@
        "       .long   1b, 4b\n"                               \
        "       .long   2b, 4b\n"                               \
        "       .previous"                                      \
-       : "=r" (err), "=r" (x), "=&r" (__temp)                  \
+       : "=r" (err), "=&r" (x), "=&r" (__temp)                 \
        : "r" (addr), "r" ((int)(addr) + 1),                    \
           "i" (EFAULT), "0" (err));                            \
 })
@@ -175,7 +175,7 @@
        "       .align  3\n"                                    \
        "       .long   1b, 3b\n"                               \
        "       .previous"                                      \
-       : "=r" (err), "=r" (x)                                  \
+       : "=r" (err), "=&r" (x)                                 \
        : "r" (addr), "i" (EFAULT), "0" (err))
 
 #define __get_user3_asm_word(x,addr,lab)                       \
@@ -191,7 +191,7 @@
        "       .align  3\n"                                    \
        "       .long   1b, 3b\n"                               \
        "       .previous"                                      \
-       : "=r" (x)                                              \
+       : "=&r" (x)                                             \
        : "r" (addr), "m" (lab))
 
 extern unsigned long __arch_copy_from_user(void *to, const void *from, unsigned long n);
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]