forked from Imagelibrary/rtems
* Makefile.am, preinstall.am, libcsupport/Makefile.am, libcsupport/include/rtems/libcsupport.h, libcsupport/include/rtems/libio.h, libcsupport/src/base_fs.c, libcsupport/src/libio_init.c, libcsupport/src/newlibc_exit.c, libcsupport/src/newlibc_init.c, libcsupport/src/sync.c, libfs/Makefile.am, libfs/src/imfs/deviceio.c, sapi/include/confdefs.h: Merge GSOC project code to add simple device only filesystem (devfs), optionally completely drop out filesystem, and to clean up disabling newlib reentrancy support. This dropped 17K from the minimum.exe for sparc/sis and arm/rtl22xx_t now has a 15K code space. * libcsupport/src/__usrenv.c, libcsupport/src/newlibc_reent.c, libfs/src/devfs/devclose.c, libfs/src/devfs/devfs.h, libfs/src/devfs/devfs_eval.c, libfs/src/devfs/devfs_init.c, libfs/src/devfs/devfs_mknod.c, libfs/src/devfs/devfs_node_type.c, libfs/src/devfs/devfs_show.c, libfs/src/devfs/devioctl.c, libfs/src/devfs/devopen.c, libfs/src/devfs/devread.c, libfs/src/devfs/devstat.c, libfs/src/devfs/devwrite.c, libfs/src/imfs/deviceerrno.c: New files. * libcsupport/src/newlibc.c: Removed.
45 lines
795 B
C
45 lines
795 B
C
/*
|
|
* The license and distribution terms for this file may be
|
|
* found in the file LICENSE in this distribution or at
|
|
* http://www.rtems.com/license/LICENSE.
|
|
*
|
|
* $Id$
|
|
*/
|
|
|
|
#if HAVE_CONFIG_H
|
|
#include "config.h"
|
|
#endif
|
|
|
|
#include <rtems.h>
|
|
#include <rtems/io.h>
|
|
|
|
#include "devfs.h"
|
|
|
|
int devFS_open(
|
|
rtems_libio_t *iop,
|
|
const char *pathname,
|
|
uint32_t flag,
|
|
uint32_t mode
|
|
)
|
|
{
|
|
rtems_libio_open_close_args_t args;
|
|
rtems_status_code status;
|
|
rtems_driver_name_t *np;
|
|
|
|
np = (rtems_device_name_t *)iop->file_info;
|
|
|
|
args.iop = iop;
|
|
args.flags = iop->flags;
|
|
args.mode = mode;
|
|
|
|
status = rtems_io_open(
|
|
np->major,
|
|
np->minor,
|
|
(void *) &args
|
|
);
|
|
if ( status )
|
|
return rtems_deviceio_errno(status);
|
|
|
|
return 0;
|
|
}
|