mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 23:23:13 +00:00
2005-01-24 Ralf Corsepius <ralf.corsepius@rtems.org>
* rtems/score/m68k.h: *_swap_u32( uint32_t ).
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
2005-01-24 Ralf Corsepius <ralf.corsepius@rtems.org>
|
||||||
|
|
||||||
|
* rtems/score/m68k.h: *_swap_u32( uint32_t ).
|
||||||
|
|
||||||
2005-01-24 Ralf Corsepius <ralf.corsepius@rtems.org>
|
2005-01-24 Ralf Corsepius <ralf.corsepius@rtems.org>
|
||||||
|
|
||||||
* rtems/score/m68k.h: *_swap_u16( uint16_t ).
|
* rtems/score/m68k.h: *_swap_u16( uint16_t ).
|
||||||
|
|||||||
@@ -339,8 +339,8 @@ extern "C" {
|
|||||||
/* There are no rotate commands in Coldfire architecture. We will use
|
/* There are no rotate commands in Coldfire architecture. We will use
|
||||||
* generic implementation of endian swapping for Coldfire.
|
* generic implementation of endian swapping for Coldfire.
|
||||||
*/
|
*/
|
||||||
static inline unsigned int m68k_swap_u32(
|
static inline uint32_t m68k_swap_u32(
|
||||||
unsigned int value
|
uint32_t value
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
uint32_t byte1, byte2, byte3, byte4, swapped;
|
uint32_t byte1, byte2, byte3, byte4, swapped;
|
||||||
@@ -363,11 +363,11 @@ static inline uint16_t m68k_swap_u16(
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
static inline unsigned int m68k_swap_u32(
|
static inline uint32_t m68k_swap_u32(
|
||||||
unsigned int value
|
uint32_t value
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
unsigned int swapped = value;
|
uint32_t swapped = value;
|
||||||
|
|
||||||
asm volatile( "rorw #8,%0" : "=d" (swapped) : "0" (swapped) );
|
asm volatile( "rorw #8,%0" : "=d" (swapped) : "0" (swapped) );
|
||||||
asm volatile( "swap %0" : "=d" (swapped) : "0" (swapped) );
|
asm volatile( "swap %0" : "=d" (swapped) : "0" (swapped) );
|
||||||
|
|||||||
Reference in New Issue
Block a user