From: David Howells <dhowells@redhat.com>
To: torvalds@transmeta.com
Cc: akpm@zip.com.au, linux-kernel@vger.kernel.org
Subject: rwsem update
Date: Thu, 23 May 2002 08:41:28 +0100 [thread overview]
Message-ID: <14817.1022139688@warthog.cambridge.redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 169 bytes --]
Hi Linus,
The attached patch fixes the compilation problems Andrew Morton has been
seeing with the rw-semaphores in the kernel when using gcc 2.95.3 with -O1.
David
[-- Attachment #2: rwsem-asmcon2.diff --]
[-- Type: application/octet-stream, Size: 1891 bytes --]
diff -uNr linux-2.5.17/include/asm-i386/rwsem.h linux-asmcons/include/asm-i386/rwsem.h
--- linux-2.5.17/include/asm-i386/rwsem.h Wed May 15 11:20:57 2002
+++ linux-asmcons/include/asm-i386/rwsem.h Wed May 22 08:41:23 2002
@@ -111,8 +111,8 @@
" jmp 1b\n"
LOCK_SECTION_END
"# ending down_read\n\t"
- : "+m"(sem->count)
- : "a"(sem)
+ : "=m"(sem->count)
+ : "a"(sem), "m"(sem->count)
: "memory", "cc");
}
@@ -126,8 +126,8 @@
tmp = RWSEM_ACTIVE_WRITE_BIAS;
__asm__ __volatile__(
"# beginning down_write\n\t"
-LOCK_PREFIX " xadd %0,(%%eax)\n\t" /* subtract 0x0000ffff, returns the old value */
- " testl %0,%0\n\t" /* was the count 0 before? */
+LOCK_PREFIX " xadd %%edx,(%%eax)\n\t" /* subtract 0x0000ffff, returns the old value */
+ " testl %%edx,%%edx\n\t" /* was the count 0 before? */
" jnz 2f\n\t" /* jump if we weren't granted the lock */
"1:\n\t"
LOCK_SECTION_START("")
@@ -138,8 +138,8 @@
" jmp 1b\n"
LOCK_SECTION_END
"# ending down_write"
- : "+d"(tmp), "+m"(sem->count)
- : "a"(sem)
+ : "=m"(sem->count), "=d"(tmp)
+ : "a"(sem), "1"(tmp), "m"(sem->count)
: "memory", "cc");
}
@@ -164,8 +164,8 @@
" jmp 1b\n"
LOCK_SECTION_END
"# ending __up_read\n"
- : /*"+m"(sem->count),*/ "+d"(tmp)
- : "a"(sem)
+ : "=m"(sem->count), "=d"(tmp)
+ : "a"(sem), "1"(tmp), "m"(sem->count)
: "memory", "cc");
}
@@ -190,8 +190,8 @@
" jmp 1b\n"
LOCK_SECTION_END
"# ending __up_write\n"
- : "+m"(sem->count)
- : "a"(sem), "i"(-RWSEM_ACTIVE_WRITE_BIAS)
+ : "=m"(sem->count)
+ : "a"(sem), "i"(-RWSEM_ACTIVE_WRITE_BIAS), "m"(sem->count)
: "memory", "cc", "edx");
}
@@ -202,8 +202,8 @@
{
__asm__ __volatile__(
LOCK_PREFIX "addl %1,%0"
- :"=m"(sem->count)
- :"ir"(delta), "m"(sem->count));
+ : "=m"(sem->count)
+ : "ir"(delta), "m"(sem->count));
}
/*
reply other threads:[~2002-05-23 7:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=14817.1022139688@warthog.cambridge.redhat.com \
--to=dhowells@redhat.com \
--cc=akpm@zip.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®