Changeset 9f9871f in rtems


Ignore:
Timestamp:
Mar 6, 2002, 2:37:38 PM (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
8264d23
Parents:
b04ee63
Message:

2002-03-06 Victor V. Vengerov <vvv@…>

  • rtems/score/m68k.h [M68K_COLDFIRE_ARCH] (CPU_swap_u16, CPU_swap_u32): Generic implementation of endian swap primitives added for Coldfire family.
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/score/cpu/m68k/ChangeLog

    rb04ee63 r9f9871f  
     12002-03-06      Victor V. Vengerov <vvv@oktet.ru>
     2
     3        * rtems/score/m68k.h [M68K_COLDFIRE_ARCH] (CPU_swap_u16, CPU_swap_u32):
     4        Generic implementation of endian swap primitives added for Coldfire
     5        family.
     6
    172002-01-29      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    28
  • c/src/exec/score/cpu/m68k/rtems/score/m68k.h

    rb04ee63 r9f9871f  
    228228#error "Unsupported CPU model -- are you sure you're running a 68k compiler?"
    229229
     230#endif
     231
     232#ifndef ASM
     233#include <rtems/score/m68ktypes.h>
    230234#endif
    231235
     
    327331 *  It must be static because it is referenced indirectly.
    328332 */
     333#if ( M68K_COLDFIRE_ARCH == 1 )
     334
     335/* There are no rotate commands in Coldfire architecture. We will use
     336 * generic implementation of endian swapping for Coldfire.
     337 */
     338static inline unsigned int CPU_swap_u32(
     339  unsigned int value
     340  )
     341{
     342  unsigned32 byte1, byte2, byte3, byte4, swapped;
     343   
     344  byte4 = (value >> 24) & 0xff;
     345  byte3 = (value >> 16) & 0xff;
     346  byte2 = (value >> 8)  & 0xff;
     347  byte1 =  value        & 0xff;
     348           
     349  swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4;
     350  return( swapped );
     351}
     352 
     353static inline unsigned int m68k_swap_u16(
     354  unsigned int value
     355)
     356{
     357  return (((value & 0xff) << 8) | ((value >> 8) & 0xff));
     358}
     359                 
     360#else
    329361
    330362static inline unsigned int m68k_swap_u32(
     
    351383  return( swapped );
    352384}
     385#endif
    353386
    354387#define CPU_swap_u32( value )  m68k_swap_u32( value )
  • cpukit/score/cpu/m68k/ChangeLog

    rb04ee63 r9f9871f  
     12002-03-06      Victor V. Vengerov <vvv@oktet.ru>
     2
     3        * rtems/score/m68k.h [M68K_COLDFIRE_ARCH] (CPU_swap_u16, CPU_swap_u32):
     4        Generic implementation of endian swap primitives added for Coldfire
     5        family.
     6
    172002-01-29      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    28
  • cpukit/score/cpu/m68k/rtems/score/m68k.h

    rb04ee63 r9f9871f  
    228228#error "Unsupported CPU model -- are you sure you're running a 68k compiler?"
    229229
     230#endif
     231
     232#ifndef ASM
     233#include <rtems/score/m68ktypes.h>
    230234#endif
    231235
     
    327331 *  It must be static because it is referenced indirectly.
    328332 */
     333#if ( M68K_COLDFIRE_ARCH == 1 )
     334
     335/* There are no rotate commands in Coldfire architecture. We will use
     336 * generic implementation of endian swapping for Coldfire.
     337 */
     338static inline unsigned int CPU_swap_u32(
     339  unsigned int value
     340  )
     341{
     342  unsigned32 byte1, byte2, byte3, byte4, swapped;
     343   
     344  byte4 = (value >> 24) & 0xff;
     345  byte3 = (value >> 16) & 0xff;
     346  byte2 = (value >> 8)  & 0xff;
     347  byte1 =  value        & 0xff;
     348           
     349  swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4;
     350  return( swapped );
     351}
     352 
     353static inline unsigned int m68k_swap_u16(
     354  unsigned int value
     355)
     356{
     357  return (((value & 0xff) << 8) | ((value >> 8) & 0xff));
     358}
     359                 
     360#else
    329361
    330362static inline unsigned int m68k_swap_u32(
     
    351383  return( swapped );
    352384}
     385#endif
    353386
    354387#define CPU_swap_u32( value )  m68k_swap_u32( value )
Note: See TracChangeset for help on using the changeset viewer.