Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/include Shut up clang but returning the result ...



details:   https://anonhg.NetBSD.org/src/rev/a872f81bc1f8
branches:  trunk
changeset: 784294:a872f81bc1f8
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Jan 24 10:15:30 2013 +0000

description:
Shut up clang but returning the result to a uint32_t variable.

diffstat:

 sys/arch/arm/include/lock.h |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (32 lines):

diff -r 32a946d8d78a -r a872f81bc1f8 sys/arch/arm/include/lock.h
--- a/sys/arch/arm/include/lock.h       Thu Jan 24 10:14:55 2013 +0000
+++ b/sys/arch/arm/include/lock.h       Thu Jan 24 10:15:30 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lock.h,v 1.22 2012/11/25 20:40:30 pgoyette Exp $       */
+/*     $NetBSD: lock.h,v 1.23 2013/01/24 10:15:30 matt Exp $   */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,8 @@
 __swp(__cpu_simple_lock_t __val, volatile __cpu_simple_lock_t *__ptr)
 {
 #ifdef _ARM_ARCH_6
-       __cpu_simple_lock_t __rv, __tmp;
+       uint32_t __rv;
+       __cpu_simple_lock_t __tmp;
        if (sizeof(*__ptr) == 1) {
                __asm volatile(
                        "1:\t"
@@ -112,9 +113,10 @@
        }
        return __rv;
 #else
+       uint32_t __val32;
        __asm volatile("swpb %0, %1, [%2]"
-           : "=&r" (__val) : "r" (__val), "r" (__ptr) : "memory");
-       return __val;
+           : "=&r" (__val32) : "r" (__val), "r" (__ptr) : "memory");
+       return __val32;
 #endif
 }
 #else



Home | Main Index | Thread Index | Old Index