Changeset f22c154 in rtems for cpukit/libblock


Ignore:
Timestamp:
05/22/10 16:51:05 (14 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, 5, master
Children:
f16a1458
Parents:
2ad5753
Message:

2010-05-22 Ralf Corsépius <ralf.corsepius@…>

  • libblock/include/rtems/nvdisk.h, libblock/src/nvdisk-sram.c: Use pointer arithmetic instead of int32_t arithmetic for 16bit compatibility.
Location:
cpukit/libblock
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libblock/include/rtems/nvdisk.h

    r2ad5753 rf22c154  
    100100   * @retval EIO The read did not complete.
    101101   */
    102   int (*read) (uint32_t device, uint32_t flags, uint32_t base,
    103                uint32_t offset, void* buffer, uint32_t size);
     102  int (*read) (uint32_t device, uint32_t flags, void* base,
     103               uint32_t offset, void* buffer, size_t size);
    104104
    105105  /**
     
    116116   * @retval EIO The write did not complete or verify.
    117117   */
    118   int (*write) (uint32_t device, uint32_t flags, uint32_t base,
    119                 uint32_t offset, const void* buffer, uint32_t size);
     118  int (*write) (uint32_t device, uint32_t flags, void* base,
     119                uint32_t offset, const void* buffer, size_t size);
    120120
    121121  /**
     
    132132   * @retval EIO The data did not verify.
    133133   */
    134   int (*verify) (uint32_t device, uint32_t flags, uint32_t base,
    135                  uint32_t offset, const void* buffer, uint32_t size);
     134  int (*verify) (uint32_t device, uint32_t flags, void* base,
     135                 uint32_t offset, const void* buffer, size_t size);
    136136
    137137} rtems_nvdisk_driver_handlers;
     
    149149{
    150150  uint32_t                            flags;  /**< Private user flags. */
    151   uint32_t                            base;   /**< Base address of the device. */
     151  void*                               base;   /**< Base address of the device. */
    152152  uint32_t                            size;   /**< Size of the device. */
    153153  const rtems_nvdisk_driver_handlers* nv_ops; /**< Device handlers. */
  • cpukit/libblock/src/nvdisk-sram.c

    r2ad5753 rf22c154  
    2828rtems_nvdisk_sram_read (uint32_t device __attribute__((unused)),
    2929                        uint32_t flags __attribute__((unused)),
    30                         uint32_t base,
     30                        void*    base,
    3131                        uint32_t offset,
    3232                        void*    buffer,
    33                         uint32_t size)
     33                        size_t  size)
    3434{
    35   memcpy (buffer, (char*) (base + offset), size);
     35  memcpy (buffer, (base + offset), size);
    3636  return 0;
    3737}
     
    4040rtems_nvdisk_sram_write (uint32_t    device __attribute__((unused)),
    4141                         uint32_t    flags __attribute__((unused)),
    42                          uint32_t    base,
     42                         void*       base,
    4343                         uint32_t    offset,
    4444                         const void* buffer,
    45                          uint32_t    size)
     45                         size_t      size)
    4646{
    47   memcpy ((char*) (base + offset), buffer, size);
     47  memcpy ((base + offset), buffer, size);
    4848  return 0;
    4949}
     
    5252rtems_nvdisk_sram_verify (uint32_t    device __attribute__((unused)),
    5353                          uint32_t    flags __attribute__((unused)),
    54                           uint32_t    base,
     54                          void*       base,
    5555                          uint32_t    offset,
    5656                          const void* buffer,
    57                           uint32_t    size)
     57                          size_t      size)
    5858{
    59   return memcmp ((char*) (base + offset), buffer, size) == 0 ? 0 : EIO;
     59  return memcmp ((base + offset), buffer, size) == 0 ? 0 : EIO;
    6060}
    6161
Note: See TracChangeset for help on using the changeset viewer.