Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/include Change "=r" to "=qQ" in a register cons...



details:   https://anonhg.NetBSD.org/src/rev/4777a8e4d051
branches:  trunk
changeset: 781986:4777a8e4d051
user:      apb <apb%NetBSD.org@localhost>
date:      Thu Oct 11 11:12:21 2012 +0000

description:
Change "=r" to "=qQ" in a register constraint in an asm statement
for a register that is used with the "xchgb" instruction in the
definition of __cpu_simple_lock_try().  This fixes PR 45673, or at
least works around the gcc bug that might be behind PR 45673.

The output from "objdump -d" before and after this change is
identical, for the amd64 GENERIC kernel, the i386 GENERIC kernel,
and the i386 MONOLITHIC kernel.

diffstat:

 sys/arch/x86/include/lock.h |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 117844852be1 -r 4777a8e4d051 sys/arch/x86/include/lock.h
--- a/sys/arch/x86/include/lock.h       Thu Oct 11 10:50:45 2012 +0000
+++ b/sys/arch/x86/include/lock.h       Thu Oct 11 11:12:21 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lock.h,v 1.25 2009/01/15 01:20:31 pooka Exp $  */
+/*     $NetBSD: lock.h,v 1.26 2012/10/11 11:12:21 apb Exp $    */
 
 /*-
  * Copyright (c) 2000, 2006 The NetBSD Foundation, Inc.
@@ -106,7 +106,7 @@
 
        val = __SIMPLELOCK_LOCKED;
        __asm volatile ("xchgb %0,(%2)" : 
-           "=r" (val)
+           "=qQ" (val)
            :"0" (val), "r" (lockp));
        __insn_barrier();
        return val == __SIMPLELOCK_UNLOCKED;



Home | Main Index | Thread Index | Old Index