summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/m68k/syscall.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-03-23 03:16:41 +0000
committerMike Frysinger <vapier@gentoo.org>2006-03-23 03:16:41 +0000
commit9535cbf18c6b4415dc35c220ca4cca15eba5dc1b (patch)
tree4429a2f527eb9ab5ccffcf23257a4e2bd54e56cb /libc/sysdeps/linux/m68k/syscall.c
parentd126b4a3fbf7e423206712145b4a4efdc0c5b1c1 (diff)
Richard Sandiford writes:
This patch fixes a miscompilation of mmap() for Coldfire with gcc 4.x. The problem was that the syscall was being invoked before any part of the argument structure (buffer[]) had been initialised. The outcome of gcc PR 19341 is that volatile asms don't implicitly use or clobber memory, and that "memory" must be explicitly listed in the clobber list: http://gcc.gnu.org/PR19341 All syscalls can potentially use or clobber memory, so this patch adds a "memory" clobber to all the m68k syscall wrappers that I could find.
Diffstat (limited to 'libc/sysdeps/linux/m68k/syscall.c')
-rw-r--r--libc/sysdeps/linux/m68k/syscall.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/m68k/syscall.c b/libc/sysdeps/linux/m68k/syscall.c
index f35702a48..5b13ea695 100644
--- a/libc/sysdeps/linux/m68k/syscall.c
+++ b/libc/sysdeps/linux/m68k/syscall.c
@@ -41,6 +41,7 @@ long syscall(long sysnum, long a, long b, long c, long d, long e, long f)
: "g" (sysnum),
"g" ((long)a), "g" ((long)b), "g" ((long)c),
"g" ((long)d), "g" ((long)e), "g" ((long)f)
- : "cc", "%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%a0");
+ : "memory", "cc", "%d0", "%d1", "%d2", "%d3",
+ "%d4", "%d5", "%a0");
__syscall_return(long,__res);
}