Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1735358

[PATCH v3 5/6] x86, asm/rwsem: Use named operands in __up_write()

From Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
Newsgroups linux.kernel
Subject [PATCH v3 5/6] x86, asm/rwsem: Use named operands in __up_write()
Date 2017-09-20 01:40 +0200
Message-ID <urAhs-3q4-9@gated-at.bofh.it> (permalink)
References <umB4t-5b7-3@gated-at.bofh.it> <urAhr-3q4-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Since GCC version 3.1, it is possible to specify input and output
operands using symbolic names which can be referenced within the
assembler code.

Convert to named operands makes easy to understand and maintain for
future changes.

Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
---
 arch/x86/include/asm/rwsem.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/rwsem.h b/arch/x86/include/asm/rwsem.h
index 2b3fb6d316f5..3245902e961f 100644
--- a/arch/x86/include/asm/rwsem.h
+++ b/arch/x86/include/asm/rwsem.h
@@ -189,14 +189,14 @@ static inline void __up_write(struct rw_semaphore *sem)
 	register void *__sp asm(_ASM_SP);
 
 	asm volatile("# beginning __up_write\n\t"
-		     LOCK_PREFIX "  xadd      %1,(%3)\n\t"
+		     LOCK_PREFIX "  xadd      %[tmp],(%[sem])\n\t"
 		     /* subtracts 0xffff0001, returns the old value */
 		     "  jns        1f\n\t"
 		     "  call call_rwsem_wake\n" /* expects old value in %edx */
 		     "1:\n\t"
 		     "# ending __up_write\n"
-		     : "+m" (sem->count), "=d" (tmp), "+r" (__sp)
-		     : "a" (sem), "1" (-RWSEM_ACTIVE_WRITE_BIAS)
+		     : "+m" (sem->count), [tmp] "=d" (tmp), "+r" (__sp)
+		     : [sem] "a" (sem), "[tmp]" (-RWSEM_ACTIVE_WRITE_BIAS)
 		     : "memory", "cc");
 }
 
-- 
2.14.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for some inline asm Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> - 2017-09-20 01:40 +0200
  [PATCH v3 5/6] x86, asm/rwsem: Use named operands in __up_write() Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> - 2017-09-20 01:40 +0200
  [PATCH v3 2/6] locking/rwsem/x86: Add stack frame dependency for __up_write() Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> - 2017-09-20 01:40 +0200
  [PATCH v3 6/6] x86, asm/rwsem: Use named operands in __downgrade_write() Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> - 2017-09-20 01:40 +0200
  [PATCH v3 1/6] locking/rwsem/x86: Add stack frame dependency for __up_read() Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> - 2017-09-20 01:40 +0200
  [PATCH v3 4/6] x86, asm/rwsem: Use named operands in __up_read() Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> - 2017-09-20 01:40 +0200
  Re: [PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for  some inline asm Josh Poimboeuf <jpoimboe@redhat.com> - 2017-09-20 23:30 +0200
    Re: [PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for  some inline asm Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> - 2017-09-21 19:10 +0200
    Re: [PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for  some inline asm Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> - 2017-09-25 19:40 +0200
      Re: [PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for  some inline asm Josh Poimboeuf <jpoimboe@redhat.com> - 2017-09-25 21:10 +0200
        Re: [PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for  some inline asm Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> - 2017-09-25 23:40 +0200
      Re: [PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for  some inline asm Josh Poimboeuf <jpoimboe@redhat.com> - 2017-09-25 21:10 +0200

csiph-web