Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/sys Use any inlined functions provided by machine/byte_s...
details: https://anonhg.NetBSD.org/src/rev/d5f90ad7c716
branches: trunk
changeset: 587955:d5f90ad7c716
user: dsl <dsl%NetBSD.org@localhost>
date: Sat Feb 04 11:44:48 2006 +0000
description:
Use any inlined functions provided by machine/byte_swap.h even when
optimisation is disabled (mmm bloated code..).
Fixes hp700 kernel build.
diffstat:
sys/sys/bswap.h | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diffs (41 lines):
diff -r a9c80ca9d294 -r d5f90ad7c716 sys/sys/bswap.h
--- a/sys/sys/bswap.h Sat Feb 04 11:28:54 2006 +0000
+++ b/sys/sys/bswap.h Sat Feb 04 11:44:48 2006 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bswap.h,v 1.9 2006/02/04 10:34:43 skrll Exp $ */
+/* $NetBSD: bswap.h,v 1.10 2006/02/04 11:44:48 dsl Exp $ */
/* Written by Manuel Bouyer. Public domain */
@@ -23,8 +23,6 @@
uint64_t bswap64(uint64_t) __attribute__((__const__));
__END_DECLS
-#if defined(__GNUC__) && defined(__OPTIMIZE__)
-
/* machine/byte_swap.h might have defined inline versions */
#ifndef __BYTE_SWAP_U64_VARIABLE
#define __BYTE_SWAP_U64_VARIABLE bswap64
@@ -38,6 +36,8 @@
#define __BYTE_SWAP_U16_VARIABLE bswap16
#endif
+#if defined(__GNUC__) && defined(__OPTIMIZE__)
+
#define __byte_swap_u64_constant(x) \
((((x) & 0xff00000000000000ull) >> 56) | \
(((x) & 0x00ff000000000000ull) >> 40) | \
@@ -70,6 +70,13 @@
(__builtin_constant_p((x)) ? \
__byte_swap_u16_constant(x) : __BYTE_SWAP_U16_VARIABLE(x))
+#else
+
+/* Use any inlined functions even when not optimising */
+#define bswap64(x) __BYTE_SWAP_U64_VARIABLE(x)
+#define bswap32(x) __BYTE_SWAP_U32_VARIABLE(x)
+#define bswap16(x) __BYTE_SWAP_U16_VARIABLE(x)
+
#endif /* __GNUC__ && __OPTIMIZE__ */
#endif /* !_LOCORE */
Home |
Main Index |
Thread Index |
Old Index