source: rtems/cpukit/libcsupport/include/rtems/libio.h @ 29e92b0

4.104.115
Last change on this file since 29e92b0 was 29e92b0, checked in by Chris Johns <chrisj@…>, on 05/31/10 at 13:56:37

2010-05-31 Chris Johns <chrisj@…>

  • libcsupport/Makefile.am: Add mount-mgr.c.
  • libcsupport/src/mount-mgr.c: New.
  • include/rtems/fs.h: Added rtems_filesystem_location_mount.
  • libcsupport/include/rtems/libio.h, libcsupport/src/mount.c: New mount interface. It is similar to Linux.
  • libcsupport/include/rtems/libio_.h: Remove the init_fs_mount_table call.
  • libcsupport/src/base_fs.c: Remove init_fs_mount_table_call. Use the new mount call. Remove setting the root node in the global pathloc. Mount does this now.
  • libcsupport/src/privateenv.c: Remove the hack to set the root mount table entry in the environment.
  • libcsupport/src/unmount.cL Free the target string.
  • libblock/src/bdpart-mount.c: New mount API.
  • libfs/src/devfs/devfs.h, libfs/src/devfs/devfs_init.c, libfs/src/dosfs/dosfs.h, libfs/src/dosfs/msdos.h, libfs/src/dosfs/msdos_init.c, libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_eval.c, libfs/src/imfs/imfs_init.c, libfs/src/imfs/miniimfs_init.c, libfs/src/nfsclient/src/librtemsNfs.h, libfs/src/rfs/rtems-rfs-rtems.c, libfs/src/rfs/rtems-rfs.h, libnetworking/lib/ftpfs.c, libnetworking/rtems/ftpfs.h, libnetworking/rtems/tftp.h: New mount_h API.
  • libfs/src/devfs/devfs_eval.c: Local include of extern ops.
  • libfs/src/nfsclient/src/nfs.c: New mount API. Removed the mount me call and fixed the initialisation to happen when mounting.
  • libmisc/Makefile.am, libmisc/shell/shellconfig.h: Remove mount filesystem files.
  • libmisc/fsmount/fsmount.c, libmisc/fsmount/fsmount.h: Updated to the new mount table values.
  • libmisc/shell/main_mount_ftp.c, libmisc/shell/main_mount_msdos.c, libmisc/shell/main_mount_rfs.c, libmisc/shell/main_mount_tftp.c: Removed.
  • libmisc/shell/main_mount.c: Use the new mount API. Also access the file system table for the file system types.
  • libnetworking/lib/tftpDriver.c: Updated to the new mount API. Fixed to allow mounting from any mount point. Also can now have more than file system mounted.
  • sapi/include/confdefs.h: Add file system configuration support.
  • Property mode set to 100644
File size: 19.9 KB
Line 
1/**
2 * @file rtems/libio.h
3 */
4
5/*
6 *  System call and file system interface definition
7 *
8 *  General purpose communication channel for RTEMS to allow UNIX/POSIX
9 *  system call behavior under RTEMS.  Initially this supported only
10 *  IO to devices but has since been enhanced to support networking
11 *  and support for mounted file systems.
12 *
13 *  COPYRIGHT (c) 1989-2008.
14 *  On-Line Applications Research Corporation (OAR).
15 *
16 *  The license and distribution terms for this file may be
17 *  found in the file LICENSE in this distribution or at
18 *  http://www.rtems.com/license/LICENSE.
19 *
20 *  $Id$
21 */
22
23#ifndef _RTEMS_RTEMS_LIBIO_H
24#define _RTEMS_RTEMS_LIBIO_H
25
26#include <rtems.h>
27#include <rtems/chain.h>
28#include <sys/types.h>
29#include <sys/stat.h>
30#include <sys/ioctl.h>
31#include <sys/statvfs.h>
32
33/*
34 *  Define data types which must be constructed using forward references.
35 */
36
37#include <rtems/fs.h>
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43/*
44 * A 64bit file offset for internal use by RTEMS. Based on the newlib type.
45 */
46typedef _off64_t rtems_off64_t;
47
48/*
49 * Valid RTEMS file types.
50 */
51
52#define RTEMS_FILESYSTEM_DIRECTORY   1
53#define RTEMS_FILESYSTEM_DEVICE      2
54#define RTEMS_FILESYSTEM_HARD_LINK   3
55#define RTEMS_FILESYSTEM_SYM_LINK    4
56#define RTEMS_FILESYSTEM_MEMORY_FILE 5
57typedef int rtems_filesystem_node_types_t;
58
59/*
60 *  File Handler Operations Table
61 */
62
63typedef int (*rtems_filesystem_open_t)(
64  rtems_libio_t *iop,
65  const char    *pathname,
66  uint32_t       flag,
67  uint32_t       mode
68);
69
70typedef int (*rtems_filesystem_close_t)(
71  rtems_libio_t *iop
72);
73
74typedef ssize_t (*rtems_filesystem_read_t)(
75  rtems_libio_t *iop,
76  void          *buffer,
77  size_t         count
78);
79
80typedef ssize_t (*rtems_filesystem_write_t)(
81  rtems_libio_t *iop,
82  const void    *buffer,
83  size_t         count
84);
85
86typedef int (*rtems_filesystem_ioctl_t)(
87  rtems_libio_t *iop,
88  uint32_t       command,
89  void          *buffer
90);
91
92typedef rtems_off64_t (*rtems_filesystem_lseek_t)(
93  rtems_libio_t *iop,
94  rtems_off64_t  length,
95  int            whence
96);
97
98typedef int (*rtems_filesystem_fstat_t)(
99  rtems_filesystem_location_info_t *loc,
100  struct stat                      *buf
101);
102
103typedef int (*rtems_filesystem_fchmod_t)(
104  rtems_filesystem_location_info_t *loc,
105  mode_t                            mode
106);
107
108typedef int (*rtems_filesystem_ftruncate_t)(
109  rtems_libio_t *iop,
110  rtems_off64_t  length
111);
112
113typedef int (*rtems_filesystem_fpathconf_t)(
114  rtems_libio_t *iop,
115  int name
116);
117
118typedef int (*rtems_filesystem_fsync_t)(
119  rtems_libio_t *iop
120);
121
122typedef int (*rtems_filesystem_fdatasync_t)(
123  rtems_libio_t *iop
124);
125
126typedef int (*rtems_filesystem_fcntl_t)(
127  int            cmd,
128  rtems_libio_t *iop
129);
130
131typedef int (*rtems_filesystem_rmnod_t)(
132 rtems_filesystem_location_info_t      *parent_loc,   /* IN */
133 rtems_filesystem_location_info_t      *pathloc       /* IN */
134);
135
136struct _rtems_filesystem_file_handlers_r {
137    rtems_filesystem_open_t         open_h;
138    rtems_filesystem_close_t        close_h;
139    rtems_filesystem_read_t         read_h;
140    rtems_filesystem_write_t        write_h;
141    rtems_filesystem_ioctl_t        ioctl_h;
142    rtems_filesystem_lseek_t        lseek_h;
143    rtems_filesystem_fstat_t        fstat_h;
144    rtems_filesystem_fchmod_t       fchmod_h;
145    rtems_filesystem_ftruncate_t    ftruncate_h;
146    rtems_filesystem_fpathconf_t    fpathconf_h;
147    rtems_filesystem_fsync_t        fsync_h;
148    rtems_filesystem_fdatasync_t    fdatasync_h;
149    rtems_filesystem_fcntl_t        fcntl_h;
150    rtems_filesystem_rmnod_t        rmnod_h;
151};
152
153/*
154 *  File System Operations Table
155 */
156
157/*
158 *  XXX
159 *  This routine does not allocate any space and rtems_filesystem_freenode_t
160 *  is not called by the generic after calling this routine.
161 *  ie. node_access does not have to contain valid data when the
162 *      routine returns.
163 */
164
165typedef int (*rtems_filesystem_mknod_t)(
166   const char                        *path,       /* IN */
167   mode_t                             mode,       /* IN */
168   dev_t                              dev,        /* IN */
169   rtems_filesystem_location_info_t  *pathloc     /* IN/OUT */
170);
171
172/*
173 *  rtems_filesystem_freenode_t must be called by the generic after
174 *  calling this routine
175 */
176
177typedef int (*rtems_filesystem_evalpath_t)(
178  const char                        *pathname,      /* IN     */
179  size_t                             pathnamelen,   /* IN     */
180  int                                flags,         /* IN     */
181  rtems_filesystem_location_info_t  *pathloc        /* IN/OUT */
182);
183
184typedef int (*rtems_filesystem_evalmake_t)(
185   const char                       *path,       /* IN */
186   rtems_filesystem_location_info_t *pathloc,    /* IN/OUT */
187   const char                      **name        /* OUT    */
188);
189
190typedef int (*rtems_filesystem_link_t)(
191 rtems_filesystem_location_info_t  *to_loc,      /* IN */
192 rtems_filesystem_location_info_t  *parent_loc,  /* IN */
193 const char                        *name         /* IN */
194);
195
196typedef int (*rtems_filesystem_unlink_t)(
197 rtems_filesystem_location_info_t  *parent_pathloc, /* IN */
198 rtems_filesystem_location_info_t  *pathloc         /* IN */
199);
200
201typedef int (*rtems_filesystem_chown_t)(
202 rtems_filesystem_location_info_t  *pathloc,       /* IN */
203 uid_t                              owner,         /* IN */
204 gid_t                              group          /* IN */
205);
206
207typedef int (*rtems_filesystem_freenode_t)(
208 rtems_filesystem_location_info_t      *pathloc       /* IN */
209);
210
211typedef int (* rtems_filesystem_mount_t ) (
212   rtems_filesystem_mount_table_entry_t *mt_entry     /* IN */
213);
214
215typedef int (* rtems_filesystem_fsmount_me_t )(
216  rtems_filesystem_mount_table_entry_t *mt_entry,     /* IN */
217  const void                           *data          /* IN */
218);
219
220typedef int (* rtems_filesystem_unmount_t ) (
221  rtems_filesystem_mount_table_entry_t *mt_entry     /* IN */
222);
223
224typedef int (* rtems_filesystem_fsunmount_me_t ) (
225   rtems_filesystem_mount_table_entry_t *mt_entry    /* IN */
226);
227
228typedef rtems_filesystem_node_types_t (* rtems_filesystem_node_type_t) (
229  rtems_filesystem_location_info_t    *pathloc      /* IN */
230);
231
232typedef int (* rtems_filesystem_utime_t)(
233  rtems_filesystem_location_info_t  *pathloc,       /* IN */
234  time_t                             actime,        /* IN */
235  time_t                             modtime        /* IN */
236);
237
238typedef int (*rtems_filesystem_evaluate_link_t)(
239  rtems_filesystem_location_info_t *pathloc,     /* IN/OUT */
240  int                               flags        /* IN     */
241);
242
243typedef int (*rtems_filesystem_symlink_t)(
244 rtems_filesystem_location_info_t  *loc,         /* IN */
245 const char                        *link_name,   /* IN */
246 const char                        *node_name
247);
248
249typedef int (*rtems_filesystem_readlink_t)(
250 rtems_filesystem_location_info_t  *loc,     /* IN  */
251 char                              *buf,     /* OUT */
252 size_t                            bufsize
253);
254
255typedef int (*rtems_filesystem_rename_t)(
256 rtems_filesystem_location_info_t  *old_parent_loc,  /* IN */
257 rtems_filesystem_location_info_t  *old_loc,         /* IN */
258 rtems_filesystem_location_info_t  *new_parent_loc,  /* IN */
259 const char                        *name             /* IN */
260);
261
262typedef int (*rtems_filesystem_statvfs_t)(
263 rtems_filesystem_location_info_t  *loc,     /* IN  */
264 struct statvfs                    *buf      /* OUT */
265);
266
267/*
268 * operations table that must be defined for every file system.
269 */
270
271/*
272 * File system types
273 */
274struct _rtems_filesystem_operations_table {
275    rtems_filesystem_evalpath_t      evalpath_h;
276    rtems_filesystem_evalmake_t      evalformake_h;
277    rtems_filesystem_link_t          link_h;
278    rtems_filesystem_unlink_t        unlink_h;
279    rtems_filesystem_node_type_t     node_type_h;
280    rtems_filesystem_mknod_t         mknod_h;
281    rtems_filesystem_chown_t         chown_h;
282    rtems_filesystem_freenode_t      freenod_h;
283    rtems_filesystem_mount_t         mount_h;
284    rtems_filesystem_fsmount_me_t    fsmount_me_h;
285    rtems_filesystem_unmount_t       unmount_h;
286    rtems_filesystem_fsunmount_me_t  fsunmount_me_h;
287    rtems_filesystem_utime_t         utime_h;
288    rtems_filesystem_evaluate_link_t eval_link_h;
289    rtems_filesystem_symlink_t       symlink_h;
290    rtems_filesystem_readlink_t      readlink_h;
291    rtems_filesystem_rename_t        rename_h;
292    rtems_filesystem_statvfs_t       statvfs_h;
293};
294
295/*
296 * File system table used by mount to manage file systems.
297 */
298typedef struct _rtems_filesystem_table {
299  const char                    *type;
300  rtems_filesystem_fsmount_me_t  mount_h;
301} rtems_filesystem_table_t;
302
303/*
304 * File system table runtime loaded nodes.
305 */
306typedef struct _rtems_filesystem_table_node {
307  rtems_chain_node         node;
308  rtems_filesystem_table_t entry;
309} rtems_filesystem_table_node_t;
310
311/*
312 * Get the first entry in the filesystem table.
313 */
314const rtems_filesystem_table_t* rtems_filesystem_table_first( void );
315
316/*
317 * Get the next entry in the file system table.
318 */
319const rtems_filesystem_table_t*
320rtems_filesystem_table_next( rtems_filesystem_table_t *entry );
321
322/*
323 * Get the first entry in the mount table.
324 */
325rtems_filesystem_mount_table_entry_t*
326rtems_filesystem_mounts_first( void );
327
328/*
329 * Get the next entry in the mount table.
330 */
331rtems_filesystem_mount_table_entry_t*
332rtems_filesystem_mounts_next( rtems_filesystem_mount_table_entry_t *entry );
333
334/*
335 * Register a file system.
336 */
337int
338rtems_filesystem_register(
339  const char                    *type,
340  rtems_filesystem_fsmount_me_t  mount_h
341);
342
343/*
344 * Unregister a file system.
345 */
346int
347rtems_filesystem_unregister(
348  const char *type
349);
350
351#if 0
352/* Now in exec/include/rtems/fs.h */
353
354/*
355 * Structure used to determine a location/filesystem in the tree.
356 */
357
358struct rtems_filesystem_location_info_tt
359{
360  void                                   *node_access;
361  rtems_filesystem_file_handlers_r       *handlers;
362  rtems_filesystem_operations_table      *ops;
363  rtems_filesystem_mount_table_entry_t   *mt_entry;
364};
365#endif
366
367/*
368 *  Structure used to contain file system specific information which
369 *  is required to support fpathconf().
370 */
371
372typedef struct {
373  int    link_max;                 /* count */
374  int    max_canon;                /* max formatted input line size */
375  int    max_input;                /* max input line size */
376  int    name_max;                 /* max name length */
377  int    path_max;                 /* max path */
378  int    pipe_buf;                 /* pipe buffer size */
379  int    posix_async_io;           /* async IO supported on fs, 0=no, 1=yes */
380  int    posix_chown_restrictions; /* can chown: 0=no, 1=yes */
381  int    posix_no_trunc;           /* error on names > max name, 0=no, 1=yes */
382  int    posix_prio_io;            /* priority IO, 0=no, 1=yes */
383  int    posix_sync_io;            /* file can be sync'ed, 0=no, 1=yes */
384  int    posix_vdisable;           /* special char processing, 0=no, 1=yes */
385} rtems_filesystem_limits_and_options_t;
386
387/*
388 * Default pathconf settings. Override in a filesystem.
389 */
390extern const rtems_filesystem_limits_and_options_t rtems_filesystem_default_pathconf;
391
392/*
393 * Structure for a mount table entry.
394 */
395
396struct rtems_filesystem_mount_table_entry_tt {
397  rtems_chain_node                       Node;
398  rtems_filesystem_location_info_t       mt_point_node;
399  rtems_filesystem_location_info_t       mt_fs_root;
400  int                                    options;
401  void                                  *fs_info;
402
403  rtems_filesystem_limits_and_options_t  pathconf_limits_and_options;
404
405  /*
406   * The target or mount point of the file system.
407   */
408  const char                            *target;
409
410  /*
411   * The type of filesystem or the name of the filesystem.
412   */
413  const char                            *type;
414
415  /*
416   *  When someone adds a mounted filesystem on a real device,
417   *  this will need to be used.
418   *
419   *  The lower layers can manage how this is managed. Leave as a
420   *  string.
421   */
422  char                                  *dev;
423};
424
425/**
426 * The pathconf setting for a file system.
427 */
428#define rtems_filesystem_pathconf(_mte) ((_mte)->pathconf_limits_and_options)
429
430/**
431 * The type of file system. Its name.
432 */
433#define rtems_filesystem_type(_mte) ((_mte)->type)
434
435/**
436 * The mount point of a file system.
437 */
438#define rtems_filesystem_mount_point(_mte) ((_mte)->target)
439
440/**
441 * The device entry of a file system.
442 */
443#define rtems_filesystem_mount_device(_mte) ((_mte)->dev)
444
445/*
446 *  Valid RTEMS file systems options
447 */
448
449typedef enum
450{
451  RTEMS_FILESYSTEM_READ_ONLY,
452  RTEMS_FILESYSTEM_READ_WRITE,
453  RTEMS_FILESYSTEM_BAD_OPTIONS
454} rtems_filesystem_options_t;
455
456
457/*
458 *  An open file data structure, indexed by 'fd'
459 *  TODO:
460 *     should really have a separate per/file data structure that this
461 *     points to (eg: size, offset, driver, pathname should be in that)
462 */
463
464struct rtems_libio_tt {
465    rtems_driver_name_t                    *driver;
466    rtems_off64_t                           size;      /* size of file */
467    rtems_off64_t                           offset;    /* current offset into file */
468    uint32_t                                flags;
469    rtems_filesystem_location_info_t        pathinfo;
470    rtems_id                                sem;
471    uint32_t                                data0;     /* private to "driver" */
472    void                                   *data1;     /* ... */
473    void                                   *file_info; /* used by file handlers */
474    const rtems_filesystem_file_handlers_r *handlers;  /* type specific handlers */
475};
476
477/*
478 *  param block for read/write
479 *  Note: it must include 'offset' instead of using iop's offset since
480 *        we can have multiple outstanding i/o's on a device.
481 */
482
483typedef struct {
484    rtems_libio_t          *iop;
485    rtems_off64_t           offset;
486    char                   *buffer;
487    uint32_t                count;
488    uint32_t                flags;
489    uint32_t                bytes_moved;
490} rtems_libio_rw_args_t;
491
492/*
493 *  param block for open/close
494 */
495
496typedef struct {
497    rtems_libio_t          *iop;
498    uint32_t                flags;
499    uint32_t                mode;
500} rtems_libio_open_close_args_t;
501
502/*
503 *  param block for ioctl
504 */
505
506typedef struct {
507    rtems_libio_t          *iop;
508    uint32_t                command;
509    void                   *buffer;
510    uint32_t                ioctl_return;
511} rtems_libio_ioctl_args_t;
512
513/*
514 *  Values for 'flag'
515 */
516
517#define LIBIO_FLAGS_NO_DELAY      0x0001  /* return immediately if no data */
518#define LIBIO_FLAGS_READ          0x0002  /* reading */
519#define LIBIO_FLAGS_WRITE         0x0004  /* writing */
520#define LIBIO_FLAGS_OPEN          0x0100  /* device is open */
521#define LIBIO_FLAGS_APPEND        0x0200  /* all writes append */
522#define LIBIO_FLAGS_CREATE        0x0400  /* create file */
523#define LIBIO_FLAGS_CLOSE_ON_EXEC 0x0800  /* close on process exec() */
524#define LIBIO_FLAGS_READ_WRITE    (LIBIO_FLAGS_READ | LIBIO_FLAGS_WRITE)
525
526void rtems_libio_init(void);
527
528/*
529 *  External I/O handlers
530 */
531
532typedef int (*rtems_libio_open_t)(
533  const char  *pathname,
534  uint32_t    flag,
535  uint32_t    mode
536);
537
538typedef int (*rtems_libio_close_t)(
539  int  fd
540);
541
542typedef int (*rtems_libio_read_t)(
543  int         fd,
544  void       *buffer,
545  uint32_t    count
546);
547
548typedef int (*rtems_libio_write_t)(
549  int         fd,
550  const void *buffer,
551  uint32_t    count
552);
553
554typedef int (*rtems_libio_ioctl_t)(
555  int         fd,
556  uint32_t    command,
557  void       *buffer
558);
559
560typedef rtems_off64_t (*rtems_libio_lseek_t)(
561  int           fd,
562  rtems_off64_t offset,
563  int           whence
564);
565
566/*
567 *  The following macros are used to build up the permissions sets
568 *  used to check permissions.  These are similar in style to the
569 *  mode_t bits and should stay compatible with them.
570 */
571
572#define RTEMS_LIBIO_PERMS_READ   S_IROTH
573#define RTEMS_LIBIO_PERMS_WRITE  S_IWOTH
574#define RTEMS_LIBIO_PERMS_RDWR   (S_IROTH|S_IWOTH)
575#define RTEMS_LIBIO_PERMS_EXEC   S_IXOTH
576#define RTEMS_LIBIO_PERMS_SEARCH RTEMS_LIBIO_PERMS_EXEC
577#define RTEMS_LIBIO_PERMS_RWX    S_IRWXO
578
579/*
580 *  Macros
581 */
582
583#if 0
584#define rtems_filesystem_make_dev_t( _major, _minor ) \
585  ((((dev_t)(_major)) << 32) | (dev_t)(_minor))
586
587#define rtems_filesystem_dev_major_t( _dev ) \
588  (rtems_device_major_number) ((_dev) >> 32)
589
590#define rtems_filesystem_dev_minor_t( _dev ) \
591  (rtems_device_minor_number) ((_dev) & 0xFFFFFFFF)
592#else
593
594#include <unistd.h>
595
596union __rtems_dev_t {
597  dev_t device;
598  struct {
599     rtems_device_major_number major;
600     rtems_device_minor_number minor;
601  } __overlay;
602};
603
604static inline dev_t rtems_filesystem_make_dev_t(
605  rtems_device_major_number _major,
606  rtems_device_minor_number _minor
607)
608{
609  union __rtems_dev_t temp;
610
611  temp.__overlay.major = _major;
612  temp.__overlay.minor = _minor;
613  return temp.device;
614}
615
616static inline rtems_device_major_number rtems_filesystem_dev_major_t(
617  dev_t device
618)
619{
620  union __rtems_dev_t temp;
621
622  temp.device = device;
623  return temp.__overlay.major;
624}
625
626
627static inline rtems_device_minor_number rtems_filesystem_dev_minor_t(
628  dev_t device
629)
630{
631  union __rtems_dev_t temp;
632
633  temp.device = device;
634  return temp.__overlay.minor;
635}
636
637#endif
638
639#define rtems_filesystem_split_dev_t( _dev, _major, _minor ) \
640  do { \
641    (_major) = rtems_filesystem_dev_major_t ( _dev ); \
642    (_minor) = rtems_filesystem_dev_minor_t( _dev ); \
643  } while(0)
644
645/*
646 * Verifies that the permission flag is valid.
647 */
648#define rtems_libio_is_valid_perms( _perm )     \
649 (~ ((~RTEMS_LIBIO_PERMS_RWX) & _perm ))
650
651
652/*
653 *  Prototypes for filesystem
654 */
655
656void rtems_filesystem_initialize( void );
657
658
659/*
660 * Callbacks from TERMIOS routines to device-dependent code
661 */
662
663#include <termios.h>
664
665typedef struct rtems_termios_callbacks {
666  int    (*firstOpen)(int major, int minor, void *arg);
667  int    (*lastClose)(int major, int minor, void *arg);
668  int    (*pollRead)(int minor);
669  ssize_t (*write)(int minor, const char *buf, size_t len);
670  int    (*setAttributes)(int minor, const struct termios *t);
671  int    (*stopRemoteTx)(int minor);
672  int    (*startRemoteTx)(int minor);
673  int    outputUsesInterrupts;
674} rtems_termios_callbacks;
675
676/*
677 *  Device-independent TERMIOS routines
678 */
679
680void rtems_termios_initialize (void);
681
682/*
683 * CCJ: Change before opening a tty. Newer code from Eric is coming
684 * so extra work to handle an open tty is not worth it. If the tty
685 * is open, close then open it again.
686 */
687rtems_status_code rtems_termios_bufsize (
688  int cbufsize,     /* cooked buffer size */
689  int raw_input,    /* raw input buffer size */
690  int raw_output    /* raw output buffer size */
691);
692
693rtems_status_code rtems_termios_open (
694  rtems_device_major_number      major,
695  rtems_device_minor_number      minor,
696  void                          *arg,
697  const rtems_termios_callbacks *callbacks
698);
699
700rtems_status_code rtems_termios_close(
701  void *arg
702);
703
704rtems_status_code rtems_termios_read(
705  void *arg
706);
707
708rtems_status_code rtems_termios_write(
709  void *arg
710);
711
712rtems_status_code rtems_termios_ioctl(
713  void *arg
714);
715
716int rtems_termios_enqueue_raw_characters(
717  void *ttyp,
718  char *buf,
719  int   len
720);
721
722int rtems_termios_dequeue_characters(
723  void *ttyp,
724  int   len
725);
726
727int unmount(
728  const char *mount_path
729);
730
731int mount(
732  const char                 *source,
733  const char                 *target,
734  const char                 *filesystemtype,
735  rtems_filesystem_options_t options,
736  const void                 *data
737);
738
739/*
740 *  Boot Time Mount Table Structure
741 */
742
743typedef struct {
744  const char                              *type;
745  rtems_filesystem_options_t               fsoptions;
746  const char                              *device;
747  const char                              *mount_point;
748} rtems_filesystem_mount_table_t;
749
750extern const rtems_filesystem_mount_table_t *rtems_filesystem_mount_table;
751extern const int                             rtems_filesystem_mount_table_size;
752
753
754typedef void (*rtems_libio_init_functions_t)(void);
755extern  rtems_libio_init_functions_t rtems_libio_init_helper;
756
757void    open_dev_console(void);
758
759typedef void (*rtems_libio_supp_functions_t)(void);
760extern  rtems_libio_supp_functions_t rtems_libio_supp_helper;
761
762typedef void (*rtems_fs_init_functions_t)(void);
763extern  rtems_fs_init_functions_t    rtems_fs_init_helper;
764
765#ifdef __cplusplus
766}
767#endif
768
769#endif /* _RTEMS_LIBIO_H */
Note: See TracBrowser for help on using the repository browser.