From 2481581938caf0b3139eb0f024522182a31c66b0 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 10 May 2002 01:46:15 +0000 Subject: [PATCH] Build an explicit argument structure for mmap instead of relying on the stack layout. --- memory/virtual.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/memory/virtual.c b/memory/virtual.c index 1ecbfb603ef..d41c24ad42f 100644 --- a/memory/virtual.c +++ b/memory/virtual.c @@ -753,13 +753,31 @@ static void *unaligned_mmap( void *addr, size_t length, unsigned int prot, if (!offset_high && (offset_low & page_mask)) { int ret; + + struct + { + void *addr; + unsigned int length; + unsigned int prot; + unsigned int flags; + unsigned int fd; + unsigned int offset; + } args; + + args.addr = addr; + args.length = length; + args.prot = prot; + args.flags = flags; + args.fd = fd; + args.offset = offset_low; + __asm__ __volatile__("push %%ebx\n\t" "movl %2,%%ebx\n\t" "int $0x80\n\t" "popl %%ebx" : "=a" (ret) : "0" (90), /* SYS_mmap */ - "g" (&addr) ); + "g" (&args) ); if (ret < 0 && ret > -4096) { errno = -ret; -- 2.11.4.GIT