From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 23 May 2002 03:41:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 23 May 2002 03:41:29 -0400 Received: from dell-paw-3.cambridge.redhat.com ([195.224.55.237]:46581 "EHLO executor.cambridge.redhat.com") by vger.kernel.org with ESMTP id ; Thu, 23 May 2002 03:41:28 -0400 To: torvalds@transmeta.com Cc: akpm@zip.com.au, linux-kernel@vger.kernel.org Subject: rwsem update User-Agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (=?ISO-8859-4?Q?Unebigory=F2mae?=) APEL/10.3 Emacs/21.2 (i386-redhat-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: multipart/mixed; boundary="Multipart_Thu_May_23_08:41:28_2002-1" Date: Thu, 23 May 2002 08:41:28 +0100 Message-ID: <14817.1022139688@warthog.cambridge.redhat.com> From: David Howells Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org --Multipart_Thu_May_23_08:41:28_2002-1 Content-Type: text/plain; charset=US-ASCII 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 --Multipart_Thu_May_23_08:41:28_2002-1 Content-Type: application/octet-stream; type=patch Content-Disposition: attachment; filename="rwsem-asmcon2.diff" Content-Transfer-Encoding: 7bit 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)); } /* --Multipart_Thu_May_23_08:41:28_2002-1--