File indexing completed on 2025-05-11 08:24:17
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 #ifdef HAVE_CONFIG_H
0038 #include "config.h"
0039 #endif
0040
0041 #include <rtems/imfs.h>
0042
0043 #include <rtems/deviceio.h>
0044
0045 int device_open(
0046 rtems_libio_t *iop,
0047 const char *pathname,
0048 int oflag,
0049 mode_t mode
0050 )
0051 {
0052 const IMFS_device_t *device = IMFS_iop_to_device( iop );
0053
0054 return rtems_deviceio_open(
0055 iop,
0056 pathname,
0057 oflag,
0058 mode,
0059 device->major,
0060 device->minor
0061 );
0062 }
0063
0064 int device_close(
0065 rtems_libio_t *iop
0066 )
0067 {
0068 const IMFS_device_t *device = IMFS_iop_to_device( iop );
0069
0070 return rtems_deviceio_close(
0071 iop,
0072 device->major,
0073 device->minor
0074 );
0075 }
0076
0077 ssize_t device_read(
0078 rtems_libio_t *iop,
0079 void *buffer,
0080 size_t count
0081 )
0082 {
0083 const IMFS_device_t *device = IMFS_iop_to_device( iop );
0084
0085 return rtems_deviceio_read(
0086 iop,
0087 buffer,
0088 count,
0089 device->major,
0090 device->minor
0091 );
0092 }
0093
0094 ssize_t device_write(
0095 rtems_libio_t *iop,
0096 const void *buffer,
0097 size_t count
0098 )
0099 {
0100 const IMFS_device_t *device = IMFS_iop_to_device( iop );
0101
0102 return rtems_deviceio_write(
0103 iop,
0104 buffer,
0105 count,
0106 device->major,
0107 device->minor
0108 );
0109 }
0110
0111 int device_ioctl(
0112 rtems_libio_t *iop,
0113 ioctl_command_t command,
0114 void *buffer
0115 )
0116 {
0117 const IMFS_device_t *device = IMFS_iop_to_device( iop );
0118
0119 return rtems_deviceio_control(
0120 iop,
0121 command,
0122 buffer,
0123 device->major,
0124 device->minor
0125 );
0126 }
0127
0128 int device_ftruncate(
0129 rtems_libio_t *iop,
0130 off_t length
0131 )
0132 {
0133 return 0;
0134 }