|
RTEMS 6.1-rc1
|
Go to the documentation of this file.
44#if !defined (_RTEMS_RFS_DATA_H_)
45#define _RTEMS_RFS_DATA_H_
52#define rtems_rfs_data_ptr(_d) ((uint8_t*)(_d))
57#define rtems_rfs_data_get(_d, _t, _o, _s) \
58 (((_t)(rtems_rfs_data_ptr (_d)[_o])) << (_s))
63#define rtems_rfs_read_u8(_d) \
64 (*rtems_rfs_data_ptr (_d))
69#define rtems_rfs_read_u16(_d) \
70 (rtems_rfs_data_get (_d, uint16_t, 0, 8) | \
71 rtems_rfs_data_get (_d, uint16_t, 1, 0))
76#define rtems_rfs_read_u32(_d) \
77 (rtems_rfs_data_get (_d, uint32_t, 0, 24) | \
78 rtems_rfs_data_get (_d, uint32_t, 1, 16) | \
79 rtems_rfs_data_get (_d, uint32_t, 2, 8) | \
80 rtems_rfs_data_get (_d, uint32_t, 3, 0))
85#define rtems_rfs_write_u8(_d, _v) \
86 (*rtems_rfs_data_ptr (_d) = (uint8_t)(_v))
91#define rtems_rfs_write_u16(_d, _v) \
93 rtems_rfs_data_ptr (_d)[0] = (uint8_t)(((uint16_t)(_v)) >> 8); \
94 rtems_rfs_data_ptr (_d)[1] = (uint8_t)((_v)); \
100#define rtems_rfs_write_u32(_d, _v) \
102 rtems_rfs_data_ptr (_d)[0] = (uint8_t)(((uint32_t)(_v)) >> 24); \
103 rtems_rfs_data_ptr (_d)[1] = (uint8_t)(((uint32_t)(_v)) >> 16); \
104 rtems_rfs_data_ptr (_d)[2] = (uint8_t)(((uint32_t)(_v)) >> 8); \
105 rtems_rfs_data_ptr (_d)[3] = (uint8_t)((uint32_t)(_v)); \