Module Name: src
Committed By: apb
Date: Thu Oct 11 11:12:22 UTC 2012
Modified Files:
src/sys/arch/x86/include: lock.h
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/x86/include/lock.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/x86/include/lock.h
diff -u src/sys/arch/x86/include/lock.h:1.25 src/sys/arch/x86/include/lock.h:1.26
--- src/sys/arch/x86/include/lock.h:1.25 Thu Jan 15 01:20:31 2009
+++ src/sys/arch/x86/include/lock.h Thu Oct 11 11:12:21 2012
@@ -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 @@ __cpu_simple_lock_try(__cpu_simple_lock_
val = __SIMPLELOCK_LOCKED;
__asm volatile ("xchgb %0,(%2)" :
- "=r" (val)
+ "=qQ" (val)
:"0" (val), "r" (lockp));
__insn_barrier();
return val == __SIMPLELOCK_UNLOCKED;