summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/arm/rtems/score/cpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/cpu/arm/rtems/score/cpu.h')
-rw-r--r--cpukit/score/cpu/arm/rtems/score/cpu.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/cpukit/score/cpu/arm/rtems/score/cpu.h b/cpukit/score/cpu/arm/rtems/score/cpu.h
index d2f19e469d..1c4d3e82a6 100644
--- a/cpukit/score/cpu/arm/rtems/score/cpu.h
+++ b/cpukit/score/cpu/arm/rtems/score/cpu.h
@@ -897,27 +897,27 @@ static inline unsigned int CPU_swap_u32(
unsigned int value
)
{
- unsigned32 tmp;
- asm volatile ("EOR %1, %0, %0, ROR #16\n" \
- "BIC %1, %1, #0xff0000\n" \
- "MOV %0, %0, ROR #8\n" \
- "EOR %0, %0, %1, LSR #8\n" \
- : "=&r" (value), "=&r" (tmp) \
- : "0" (value));
+ unsigned32 tmp = value; /* make compiler warnings go away */
+ asm volatile ("EOR %1, %0, %0, ROR #16\n"
+ "BIC %1, %1, #0xff0000\n"
+ "MOV %0, %0, ROR #8\n"
+ "EOR %0, %0, %1, LSR #8\n"
+ : "=r" (value), "=r" (tmp)
+ : "0" (value), "1" (tmp));
return value;
}
static inline unsigned16 CPU_swap_u16(unsigned16 value)
{
- unsigned32 tmp = value; /* make compiler warnings go away */
- asm volatile ("MOV %1, %0, LSR #8\n" \
- "BIC %0, %0, #0xff00\n" \
- "MOV %0, %0, LSL #8\n" \
- "ORR %0, %0, %1\n" \
- : "=&r" (value), "=&r" (tmp) \
- : "0" (value));
- return value;
+ unsigned16 lower;
+ unsigned16 upper;
+
+ value = value & (unsigned16) 0xffff;
+ lower = (value >> 8) ;
+ upper = (value << 8) ;
+
+ return (lower | upper);
}
#ifdef __cplusplus