Changeset 1d539c0 in rtems


Ignore:
Timestamp:
Apr 12, 2010, 5:29:25 AM (10 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, master
Children:
2c0450cb
Parents:
a290e72a
Message:

2010-04-12 Chris Johns <chrisj@…>

libfs/src/rfs/rtems-rfs-buffer-bdbuf.c,
libfs/src/rfs/rtems-rfs-buffer.c, libfs/src/rfs/rtems-rfs-data.h,
libfs/src/rfs/rtems-rfs-dir.c,
libfs/src/rfs/rtems-rfs-file-system.c,
libfs/src/rfs/rtems-rfs-format.c, libfs/src/rfs/rtems-rfs-inode.h,
libfs/src/rfs/rtems-rfs-rtems.c, libfs/src/rfs/rtems-rfs-rtems.h,
libfs/src/rfs/rtems-rfs-shell.c: Fix for PR1502. Clean up problems
on 16bit targets.

Location:
cpukit
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    ra290e72a r1d539c0  
     12010-04-12      Chris Johns <chrisj@rtems.org>
     2
     3        libfs/src/rfs/rtems-rfs-buffer-bdbuf.c,
     4        libfs/src/rfs/rtems-rfs-buffer.c, libfs/src/rfs/rtems-rfs-data.h,
     5        libfs/src/rfs/rtems-rfs-dir.c,
     6        libfs/src/rfs/rtems-rfs-file-system.c,
     7        libfs/src/rfs/rtems-rfs-format.c, libfs/src/rfs/rtems-rfs-inode.h,
     8        libfs/src/rfs/rtems-rfs-rtems.c, libfs/src/rfs/rtems-rfs-rtems.h,
     9        libfs/src/rfs/rtems-rfs-shell.c: Fix for PR1502. Clean up problems
     10        on 16bit targets.
     11
    1122010-04-10      Ralf Corsépius <ralf.corsepius@rtems.org>
    213
  • cpukit/libfs/src/rfs/rtems-rfs-buffer-bdbuf.c

    ra290e72a r1d539c0  
    6868  if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_RELEASE))
    6969    printf ("rtems-rfs: bdbuf-release: block=%lu bdbuf=%lu %s\n",
    70             (rtems_rfs_buffer_block) buffer->user,
     70            (rtems_rfs_buffer_block) ((intptr_t) buffer->user),
    7171            buffer->block, modified ? "(modified)" : "");
    7272
  • cpukit/libfs/src/rfs/rtems-rfs-buffer.c

    ra290e72a r1d539c0  
    5252
    5353    if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
    54       printf ("%lu ", (rtems_rfs_buffer_block) buffer->user);
    55 
    56     if (((rtems_rfs_buffer_block) buffer->user) == block)
     54      printf ("%lu ", (rtems_rfs_buffer_block) ((intptr_t)(buffer->user)));
     55
     56    if (((rtems_rfs_buffer_block) ((intptr_t)(buffer->user))) == block)
    5757    {
    5858      if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
    59         printf (": found block=%lu\n", (rtems_rfs_buffer_block) buffer->user);
     59        printf (": found block=%lu\n",
     60                (rtems_rfs_buffer_block) ((intptr_t)(buffer->user)));
    6061
    6162      (*count)--;
     
    183184  fs->buffers_count++;
    184185 
    185   handle->buffer->user = (void*) block;
     186  handle->buffer->user = (void*) ((intptr_t) block);
    186187  handle->bnum = block;
    187188 
  • cpukit/libfs/src/rfs/rtems-rfs-data.h

    ra290e72a r1d539c0  
    3232
    3333/**
     34 * Helper function to get the data shifted in the correctly sized type.
     35 */
     36#define rtems_rfs_data_get(_d, _t, _o, _s) \
     37  (((_t)(rtems_rfs_data_ptr (_d)[_o])) << (_s))
     38
     39/**
    3440 * RFS Read Unsigned 8bit Integer
    3541 */
     
    4147 */
    4248#define rtems_rfs_read_u16(_d) \
    43   ((rtems_rfs_data_ptr (_d)[0] << 8) | (rtems_rfs_data_ptr (_d)[1]))
     49  (rtems_rfs_data_get (_d, uint16_t, 0, 8) | \
     50   rtems_rfs_data_get (_d, uint16_t, 1, 0))
    4451
    4552/**
     
    4754 */
    4855#define rtems_rfs_read_u32(_d) \
    49   ((rtems_rfs_data_ptr (_d)[0] << 24) | (rtems_rfs_data_ptr (_d)[1] << 16) | \
    50    (rtems_rfs_data_ptr (_d)[2] << 8) | (rtems_rfs_data_ptr (_d)[3]))
     56  (rtems_rfs_data_get (_d, uint32_t, 0, 24) | \
     57   rtems_rfs_data_get (_d, uint32_t, 1, 16) | \
     58   rtems_rfs_data_get (_d, uint32_t, 2, 8) | \
     59   rtems_rfs_data_get (_d, uint32_t, 3, 0))
    5160
    5261/**
     
    6170#define rtems_rfs_write_u16(_d, _v) \
    6271  do { \
    63     rtems_rfs_data_ptr (_d)[0] = (uint8_t)((_v) >> 8); \
     72    rtems_rfs_data_ptr (_d)[0] = (uint8_t)(((uint16_t)(_v)) >> 8); \
    6473    rtems_rfs_data_ptr (_d)[1] = (uint8_t)((_v)); \
    6574  } while (0)
     
    7079#define rtems_rfs_write_u32(_d, _v) \
    7180  do { \
    72     rtems_rfs_data_ptr (_d)[0] = (uint8_t)((_v) >> 24); \
    73     rtems_rfs_data_ptr (_d)[1] = (uint8_t)((_v) >> 16); \
    74     rtems_rfs_data_ptr (_d)[2] = (uint8_t)((_v) >> 8); \
    75     rtems_rfs_data_ptr (_d)[3] = (uint8_t)((_v)); \
     81    rtems_rfs_data_ptr (_d)[0] = (uint8_t)(((uint32_t)(_v)) >> 24); \
     82    rtems_rfs_data_ptr (_d)[1] = (uint8_t)(((uint32_t)(_v)) >> 16); \
     83    rtems_rfs_data_ptr (_d)[2] = (uint8_t)(((uint32_t)(_v)) >> 8); \
     84    rtems_rfs_data_ptr (_d)[3] = (uint8_t)((uint32_t)(_v)); \
    7685  } while (0)
    7786
  • cpukit/libfs/src/rfs/rtems-rfs-dir.c

    ra290e72a r1d539c0  
    162162          if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK))
    163163            printf ("rtems-rfs: dir-lookup-ino: " \
    164                     "checking entry for ino %ld: off=%04lx length:%d ino:%d\n",
     164                    "checking entry for ino %ld: off=%04lx length:%d ino:%ld\n",
    165165                    rtems_rfs_inode_ino (inode), map.bpos.boff,
    166166                    elength, rtems_rfs_dir_entry_ino (entry));
     
    610610      if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
    611611        printf ("rtems-rfs: dir-read: found off:%Ld ino:%ld name=%s\n",
    612                 dirent->d_off, dirent->d_ino, dirent->d_name);
     612                (uint64_t) dirent->d_off, dirent->d_ino, dirent->d_name);
    613613      break;
    614614    }
  • cpukit/libfs/src/rfs/rtems-rfs-file-system.c

    ra290e72a r1d539c0  
    8080  {
    8181    if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
    82       printf ("rtems-rfs: read-superblock: incompatible version: %08x (%08x)\n",
     82      printf ("rtems-rfs: read-superblock: incompatible version: %08lx (%08x)\n",
    8383              read_sb (RTEMS_RFS_SB_OFFSET_VERSION), RTEMS_RFS_VERSION_MASK);
    8484    rtems_rfs_buffer_handle_close (fs, &handle);
     
    8989  {
    9090    if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
    91       printf ("rtems-rfs: read-superblock: inode size mismatch: fs:%d target:%d\n",
     91      printf ("rtems-rfs: read-superblock: inode size mismatch: fs:%ld target:%d\n",
    9292              read_sb (RTEMS_RFS_SB_OFFSET_VERSION), RTEMS_RFS_VERSION_MASK);
    9393    rtems_rfs_buffer_handle_close (fs, &handle);
  • cpukit/libfs/src/rfs/rtems-rfs-format.c

    ra290e72a r1d539c0  
    3434 * Return the number of gigabytes.
    3535 */
    36 #define GIGS(_g) ((_g) * 1024 * 1024)
     36#define GIGS(_g) (((uint64_t)(_g)) * 1024 * 1024)
    3737
    3838/**
  • cpukit/libfs/src/rfs/rtems-rfs-inode.h

    ra290e72a r1d539c0  
    340340                             uint16_t uid, uint16_t gid)
    341341{
    342   rtems_rfs_write_u32 (&handle->node->owner, (gid << 16) | uid);
     342  rtems_rfs_write_u32 (&handle->node->owner, (((uint32_t) gid) << 16) | uid);
    343343  rtems_rfs_buffer_mark_dirty (&handle->buffer);
    344344}
  • cpukit/libfs/src/rfs/rtems-rfs-rtems.c

    ra290e72a r1d539c0  
    814814  if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FCHMOD))
    815815    printf ("rtems-rfs-rtems: fchmod: in: ino:%ld mode:%06o\n",
    816             ino, mode);
     816            ino, (unsigned int) mode);
    817817 
    818818  rtems_rfs_rtems_lock (fs);
  • cpukit/libfs/src/rfs/rtems-rfs-rtems.h

    ra290e72a r1d539c0  
    159159 */
    160160#define rtems_rfs_rtems_set_pathloc_ino(_loc, _ino) \
    161   (_loc)->node_access = (void*)(_ino)
     161  (_loc)->node_access = (void*)((intptr_t)(_ino))
    162162
    163163/**
     
    177177 */
    178178#define rtems_rfs_rtems_set_pathloc_doff(_loc, _doff) \
    179   (_loc)->node_access_2 = (void*)(_doff)
     179  (_loc)->node_access_2 = (void*)((intptr_t)(_doff))
    180180
    181181/**
  • cpukit/libfs/src/rfs/rtems-rfs-shell.c

    ra290e72a r1d539c0  
    500500    length = elength - RTEMS_RFS_DIR_ENTRY_SIZE;
    501501   
    502     printf (" %5d: %04x inode=%-6u hash=%08x name[%03u]=",
     502    printf (" %5d: %04x inode=%-6lu hash=%08lx name[%03u]=",
    503503            entry, b,
    504504            rtems_rfs_dir_entry_ino (data),
Note: See TracChangeset for help on using the changeset viewer.