summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-11-09 15:15:40 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-11-09 15:15:40 +0000
commitc937e8fc18edb877c7436d0bfb7c389404f81b52 (patch)
treed91bc8115c23f14f2b52fb5f24551f4d5c8e41ef /cpukit
parent2011-11-07 Ralf Corsepius <ralf.corsepius@rtems.org> (diff)
downloadrtems-c937e8fc18edb877c7436d0bfb7c389404f81b52.tar.bz2
2011-11-09 Werner Almesberger <werner@almesberger.net>
PR 1955/cpukit * rtems/score/cpu.h: Convert CPU_swap_u16 into a static inline.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/score/cpu/lm32/ChangeLog5
-rw-r--r--cpukit/score/cpu/lm32/rtems/score/cpu.h6
2 files changed, 9 insertions, 2 deletions
diff --git a/cpukit/score/cpu/lm32/ChangeLog b/cpukit/score/cpu/lm32/ChangeLog
index 43beca0f6c..873f24bbab 100644
--- a/cpukit/score/cpu/lm32/ChangeLog
+++ b/cpukit/score/cpu/lm32/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-09 Werner Almesberger <werner@almesberger.net>
+
+ PR 1955/cpukit
+ * rtems/score/cpu.h: Convert CPU_swap_u16 into a static inline.
+
2010-05-29 Ralf Corsépius <ralf.corsepius@rtems.org>
* irq.c: Change _exception_stack_frame into void*.
diff --git a/cpukit/score/cpu/lm32/rtems/score/cpu.h b/cpukit/score/cpu/lm32/rtems/score/cpu.h
index 973fad29b8..be3294fe40 100644
--- a/cpukit/score/cpu/lm32/rtems/score/cpu.h
+++ b/cpukit/score/cpu/lm32/rtems/score/cpu.h
@@ -1272,8 +1272,10 @@ static inline uint32_t CPU_swap_u32(
* @param[in] value is the value to be swapped
* @return the value after being endian swapped
*/
-#define CPU_swap_u16( value ) \
- (((value&0xff) << 8) | ((value >> 8)&0xff))
+static inline uint16_t CPU_swap_u16(uint16_t v)
+{
+ return v << 8 | v >> 8;
+}
#ifdef __cplusplus
}