RTEMS  5.0.0
devfs.h
Go to the documentation of this file.
1 
10 #ifndef _RTEMS_DEVFS_H
11 #define _RTEMS_DEVFS_H
12 
13 #include <rtems/libio_.h>
14 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
33 typedef struct {
35  const char *name;
37  size_t namelen;
39  rtems_device_major_number major;
41  rtems_device_minor_number minor;
43  mode_t mode;
44 } devFS_node;
45 
46 typedef struct {
47  devFS_node *nodes;
48  size_t count;
49 } devFS_data;
50 
56 
62 
69 static inline const devFS_data *devFS_get_data(
71 )
72 {
73  return (const devFS_data *) loc->mt_entry->immutable_fs_info;
74 }
75 
79 extern void devFS_eval_path(
81 );
82 
95 extern int devFS_open(
96  rtems_libio_t *iop,
97  const char *pathname,
98  int oflag,
99  mode_t mode
100 );
101 
102 
112 extern int devFS_close(
113  rtems_libio_t *iop
114 );
115 
128 extern ssize_t devFS_read(
129  rtems_libio_t *iop,
130  void *buffer,
131  size_t count
132 );
133 
146 extern ssize_t devFS_write(
147  rtems_libio_t *iop,
148  const void *buffer,
149  size_t count
150 );
151 
164 extern int devFS_ioctl(
165  rtems_libio_t *iop,
166  ioctl_command_t command,
167  void *buffer
168 );
169 
187 extern int devFS_stat(
189  struct stat *buf
190 );
191 
203 extern int devFS_mknod(
204  const rtems_filesystem_location_info_t *parentloc,
205  const char *name,
206  size_t namelen,
207  mode_t mode,
208  dev_t dev
209 );
210 
226 extern int devFS_initialize(
228  const void *data
229 );
230 
248 extern void devFS_Show(void);
249 
250 #ifdef __cplusplus
251 }
252 #endif
253 
254 #endif
255 
mode_t mode
Definition: devfs.h:43
ssize_t devFS_write(rtems_libio_t *iop, const void *buffer, size_t count)
Writes Operation to rtems_io_write.
Definition: devwrite.c:22
void devFS_Show(void)
Retrieves and Prints all the Device Registered in System.
Definition: devfs_show.c:22
int devFS_stat(const rtems_filesystem_location_info_t *loc, struct stat *buf)
Gets the Device File Information.
Definition: devstat.c:20
File system node operations table.
Definition: libio.h:1005
int devFS_mknod(const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, mode_t mode, dev_t dev)
Creates an item in the main device table.
Definition: devfs_mknod.c:24
const rtems_filesystem_file_handlers_r devFS_file_handlers
Definition: devfs_init.c:42
void devFS_eval_path(rtems_filesystem_eval_path_context_t *ctx)
Evaluate Path.
Definition: devfs_eval.c:55
const char * name
Definition: devfs.h:35
ssize_t devFS_read(rtems_libio_t *iop, void *buffer, size_t count)
Maps Read Operation to rtems_io_read.
Definition: devread.c:22
Per Device Node Control Structure.
Definition: devfs.h:33
Mount table entry.
Definition: libio.h:1606
size_t namelen
Definition: devfs.h:37
File system operations table.
Definition: libio.h:472
LibIO Internal Interface.
rtems_device_major_number major
Definition: devfs.h:39
Path evaluation context.
Definition: libio.h:84
int devFS_close(rtems_libio_t *iop)
Maps Close Operation to rtems_io_close.
Definition: devclose.c:22
Definition: devfs.h:46
An open file data structure.
Definition: libio.h:1320
int devFS_ioctl(rtems_libio_t *iop, ioctl_command_t command, void *buffer)
Maps ioctl Operation to rtems_io_ioctl.
Definition: devioctl.c:22
const rtems_filesystem_operations_table devFS_ops
Definition: devfs_init.c:20
int devFS_initialize(rtems_filesystem_mount_table_entry_t *mt_entry, const void *data)
Creates the Main Device Table.
Definition: devfs_init.c:61
rtems_device_minor_number minor
Definition: devfs.h:41
File system location.
Definition: fs.h:53
int devFS_open(rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode)
Maps Open Operation to rtems_io_open.
Definition: devopen.c:22