Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc/include convert __ldstub() from a ({}) macro ...



details:   https://anonhg.NetBSD.org/src/rev/c94879dac902
branches:  trunk
changeset: 556726:c94879dac902
user:      mrg <mrg%NetBSD.org@localhost>
date:      Fri Dec 26 06:00:58 2003 +0000

description:
convert __ldstub() from a ({}) macro into a properly static inline function.
the latter is not valid for C++ so says GCC3.

diffstat:

 sys/arch/sparc/include/lock.h |  25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diffs (39 lines):

diff -r 2f0f414c95f8 -r c94879dac902 sys/arch/sparc/include/lock.h
--- a/sys/arch/sparc/include/lock.h     Fri Dec 26 05:23:15 2003 +0000
+++ b/sys/arch/sparc/include/lock.h     Fri Dec 26 06:00:58 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lock.h,v 1.13 2003/11/16 11:22:30 pk Exp $ */
+/*     $NetBSD: lock.h,v 1.14 2003/12/26 06:00:58 mrg Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -47,17 +47,18 @@
 #ifdef __lint__
 #define __ldstub(__addr)       (__addr)
 #else /* !__lint__ */
-#define        __ldstub(__addr)                                                \
-({                                                                     \
-       int __v;                                                        \
-                                                                       \
-       __asm __volatile("ldstub [%1],%0"                               \
-           : "=r" (__v)                                                \
-           : "r" (__addr)                                              \
-           : "memory");                                                \
-                                                                       \
-       __v;                                                            \
-})
+static __inline__ int __ldstub(__cpu_simple_lock_t *addr);
+static __inline__ int __ldstub(__cpu_simple_lock_t *addr)
+{
+       int v;
+
+       __asm __volatile("ldstub [%1],%0"
+           : "=r" (v)
+           : "r" (addr)
+           : "memory");
+
+       return v;
+}
 #endif /* __lint__ */
 
 static __inline void __cpu_simple_lock_init __P((__cpu_simple_lock_t *))



Home | Main Index | Thread Index | Old Index