From c937e8fc18edb877c7436d0bfb7c389404f81b52 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 9 Nov 2011 15:15:40 +0000 Subject: 2011-11-09 Werner Almesberger PR 1955/cpukit * rtems/score/cpu.h: Convert CPU_swap_u16 into a static inline. --- cpukit/score/cpu/lm32/ChangeLog | 5 +++++ cpukit/score/cpu/lm32/rtems/score/cpu.h | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'cpukit') 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 + + PR 1955/cpukit + * rtems/score/cpu.h: Convert CPU_swap_u16 into a static inline. + 2010-05-29 Ralf Corsépius * 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 } -- cgit v1.2.3