diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-05-14 13:16:31 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-05-15 10:01:42 +0200 |
commit | df01da67078b4ed4787680d3987f5b40ac93d080 (patch) | |
tree | a5a111a82290eb1b79c344459d34b989b341602d /cpukit | |
parent | rfs: Fix major and minor number integer types (diff) | |
download | rtems-df01da67078b4ed4787680d3987f5b40ac93d080.tar.bz2 |
Filesystem: Use ioctl_command_t
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/libcsupport/include/rtems/libio.h | 14 | ||||
-rw-r--r-- | cpukit/libcsupport/include/sys/ioccom.h | 7 | ||||
-rw-r--r-- | cpukit/libfs/src/defaults/default_ioctl.c | 12 | ||||
-rw-r--r-- | cpukit/libfs/src/devfs/devfs.h | 6 | ||||
-rw-r--r-- | cpukit/libfs/src/devfs/devioctl.c | 6 | ||||
-rw-r--r-- | cpukit/libfs/src/imfs/deviceio.c | 6 | ||||
-rw-r--r-- | cpukit/libfs/src/imfs/imfs.h | 12 | ||||
-rw-r--r-- | cpukit/libfs/src/imfs/imfs_fifo.c | 6 | ||||
-rw-r--r-- | cpukit/libfs/src/imfs/imfs_handlers_memfile.c | 2 | ||||
-rw-r--r-- | cpukit/libfs/src/imfs/memfile.c | 16 | ||||
-rw-r--r-- | cpukit/libfs/src/pipe/fifo.c | 8 | ||||
-rw-r--r-- | cpukit/libfs/src/pipe/pipe.h | 8 | ||||
-rw-r--r-- | cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c | 6 | ||||
-rw-r--r-- | cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c | 18 | ||||
-rw-r--r-- | cpukit/libnetworking/rtems/rtems_bsdnet_internal.h | 7 |
15 files changed, 45 insertions, 89 deletions
diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h index bb6c44fcfa..9268aed2e1 100644 --- a/cpukit/libcsupport/include/rtems/libio.h +++ b/cpukit/libcsupport/include/rtems/libio.h @@ -832,9 +832,9 @@ typedef ssize_t (*rtems_filesystem_write_t)( * @see rtems_filesystem_default_ioctl(). */ typedef int (*rtems_filesystem_ioctl_t)( - rtems_libio_t *iop, - uint32_t request, - void *buffer + rtems_libio_t *iop, + ioctl_command_t request, + void *buffer ); /** @@ -1008,9 +1008,9 @@ ssize_t rtems_filesystem_default_write( * @see rtems_filesystem_ioctl_t. */ int rtems_filesystem_default_ioctl( - rtems_libio_t *iop, - uint32_t command, - void *buffer + rtems_libio_t *iop, + ioctl_command_t request, + void *buffer ); /** @@ -1225,7 +1225,7 @@ typedef struct { */ typedef struct { rtems_libio_t *iop; - uint32_t command; + ioctl_command_t command; void *buffer; int ioctl_return; } rtems_libio_ioctl_args_t; diff --git a/cpukit/libcsupport/include/sys/ioccom.h b/cpukit/libcsupport/include/sys/ioccom.h index 054eac7f04..4bbe1bcc79 100644 --- a/cpukit/libcsupport/include/sys/ioccom.h +++ b/cpukit/libcsupport/include/sys/ioccom.h @@ -83,15 +83,12 @@ #define FIOSETOWN _IOW('f', 124, int) /* set owner */ #define FIOGETOWN _IOR('f', 123, int) /* get owner */ +typedef uint32_t ioctl_command_t; + #ifndef _KERNEL #include <sys/cdefs.h> -#ifndef __ioctl_command_defined -typedef u_int32_t ioctl_command_t; -#define __ioctl_command_defined -#endif - __BEGIN_DECLS int ioctl(int, ioctl_command_t, ...); __END_DECLS diff --git a/cpukit/libfs/src/defaults/default_ioctl.c b/cpukit/libfs/src/defaults/default_ioctl.c index f86f2bc173..edd1c622ba 100644 --- a/cpukit/libfs/src/defaults/default_ioctl.c +++ b/cpukit/libfs/src/defaults/default_ioctl.c @@ -7,14 +7,16 @@ * http://www.rtems.com/license/LICENSE. */ -#include <rtems/libio.h> +#if HAVE_CONFIG_H + #include "config.h" +#endif + #include <rtems/libio_.h> -#include <rtems/seterr.h> int rtems_filesystem_default_ioctl( - rtems_libio_t *iop, - uint32_t command, - void *buffer + rtems_libio_t *iop, + ioctl_command_t request, + void *buffer ) { rtems_set_errno_and_return_minus_one( ENOTSUP ); diff --git a/cpukit/libfs/src/devfs/devfs.h b/cpukit/libfs/src/devfs/devfs.h index 64b86d44c1..60ee7ab0be 100644 --- a/cpukit/libfs/src/devfs/devfs.h +++ b/cpukit/libfs/src/devfs/devfs.h @@ -137,9 +137,9 @@ extern ssize_t devFS_write( */ extern int devFS_ioctl( - rtems_libio_t *iop, - uint32_t command, - void *buffer + rtems_libio_t *iop, + ioctl_command_t command, + void *buffer ); diff --git a/cpukit/libfs/src/devfs/devioctl.c b/cpukit/libfs/src/devfs/devioctl.c index 7f9c343afb..bca82509df 100644 --- a/cpukit/libfs/src/devfs/devioctl.c +++ b/cpukit/libfs/src/devfs/devioctl.c @@ -14,9 +14,9 @@ #include "devfs.h" int devFS_ioctl( - rtems_libio_t *iop, - uint32_t command, - void *buffer + rtems_libio_t *iop, + ioctl_command_t command, + void *buffer ) { rtems_libio_ioctl_args_t args; diff --git a/cpukit/libfs/src/imfs/deviceio.c b/cpukit/libfs/src/imfs/deviceio.c index e5a4d85a21..60a66f3f3d 100644 --- a/cpukit/libfs/src/imfs/deviceio.c +++ b/cpukit/libfs/src/imfs/deviceio.c @@ -162,9 +162,9 @@ ssize_t device_write( */ int device_ioctl( - rtems_libio_t *iop, - uint32_t command, - void *buffer + rtems_libio_t *iop, + ioctl_command_t command, + void *buffer ) { rtems_libio_ioctl_args_t args; diff --git a/cpukit/libfs/src/imfs/imfs.h b/cpukit/libfs/src/imfs/imfs.h index fc9d50e912..7c0cbe5931 100644 --- a/cpukit/libfs/src/imfs/imfs.h +++ b/cpukit/libfs/src/imfs/imfs.h @@ -435,12 +435,6 @@ extern ssize_t memfile_write( size_t count /* IN */ ); -extern int memfile_ioctl( - rtems_libio_t *iop, /* IN */ - uint32_t command, /* IN */ - void *buffer /* IN */ -); - extern int device_open( rtems_libio_t *iop, /* IN */ const char *pathname, /* IN */ @@ -465,9 +459,9 @@ extern ssize_t device_write( ); extern int device_ioctl( - rtems_libio_t *iop, /* IN */ - uint32_t command, /* IN */ - void *buffer /* IN */ + rtems_libio_t *iop, + ioctl_command_t command, + void *buffer ); extern int device_ftruncate( diff --git a/cpukit/libfs/src/imfs/imfs_fifo.c b/cpukit/libfs/src/imfs/imfs_fifo.c index 943bfed692..8601ef7b62 100644 --- a/cpukit/libfs/src/imfs/imfs_fifo.c +++ b/cpukit/libfs/src/imfs/imfs_fifo.c @@ -83,9 +83,9 @@ static ssize_t IMFS_fifo_write( } static int IMFS_fifo_ioctl( - rtems_libio_t *iop, - uint32_t command, - void *buffer + rtems_libio_t *iop, + ioctl_command_t command, + void *buffer ) { int err; diff --git a/cpukit/libfs/src/imfs/imfs_handlers_memfile.c b/cpukit/libfs/src/imfs/imfs_handlers_memfile.c index 6a1466e29c..6953319861 100644 --- a/cpukit/libfs/src/imfs/imfs_handlers_memfile.c +++ b/cpukit/libfs/src/imfs/imfs_handlers_memfile.c @@ -33,7 +33,7 @@ static const rtems_filesystem_file_handlers_r IMFS_memfile_handlers = { rtems_filesystem_default_close, memfile_read, memfile_write, - memfile_ioctl, + rtems_filesystem_default_ioctl, rtems_filesystem_default_lseek_file, IMFS_stat_file, memfile_ftruncate, diff --git a/cpukit/libfs/src/imfs/memfile.c b/cpukit/libfs/src/imfs/memfile.c index 2907591bfb..fcbeed96b3 100644 --- a/cpukit/libfs/src/imfs/memfile.c +++ b/cpukit/libfs/src/imfs/memfile.c @@ -152,22 +152,6 @@ ssize_t memfile_write( } /* - * memfile_ioctl - * - * This routine processes the ioctl() system call. - * - * NOTE: No ioctl()'s are supported for in-memory files. - */ -int memfile_ioctl( - rtems_libio_t *iop, - uint32_t command, - void *buffer -) -{ - return 0; -} - -/* * memfile_stat * * This IMFS_stat() can be used. diff --git a/cpukit/libfs/src/pipe/fifo.c b/cpukit/libfs/src/pipe/fifo.c index 7d990e5acb..06eacd712f 100644 --- a/cpukit/libfs/src/pipe/fifo.c +++ b/cpukit/libfs/src/pipe/fifo.c @@ -549,10 +549,10 @@ out_nolock: * Interface to file system ioctl. */ int pipe_ioctl( - pipe_control_t *pipe, - uint32_t cmd, - void *buffer, - rtems_libio_t *iop + pipe_control_t *pipe, + ioctl_command_t cmd, + void *buffer, + rtems_libio_t *iop ) { if (cmd == FIONREAD) { diff --git a/cpukit/libfs/src/pipe/pipe.h b/cpukit/libfs/src/pipe/pipe.h index d856a63e84..29e7542b43 100644 --- a/cpukit/libfs/src/pipe/pipe.h +++ b/cpukit/libfs/src/pipe/pipe.h @@ -96,10 +96,10 @@ extern ssize_t pipe_write( * Interface to file system ioctl. */ extern int pipe_ioctl( - pipe_control_t *pipe, - uint32_t cmd, - void *buffer, - rtems_libio_t *iop + pipe_control_t *pipe, + ioctl_command_t cmd, + void *buffer, + rtems_libio_t *iop ); #ifdef __cplusplus diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c b/cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c index 81fdbe34eb..729d4200c5 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c @@ -194,9 +194,9 @@ rtems_rfs_rtems_device_write (rtems_libio_t* iop, */ static int -rtems_rfs_rtems_device_ioctl (rtems_libio_t* iop, - uint32_t command, - void* buffer) +rtems_rfs_rtems_device_ioctl (rtems_libio_t* iop, + ioctl_command_t command, + void* buffer) { rtems_libio_ioctl_args_t args; rtems_status_code status; diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c b/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c index cf864c7347..525dceec1d 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c @@ -257,22 +257,6 @@ rtems_rfs_rtems_file_write (rtems_libio_t* iop, } /** - * This routine processes the ioctl() system call. - * - * @note No ioctl()'s are currently supported for RFS files. - * - * @param iop - * @param command - * @param buffer - */ - -static int -rtems_rfs_rtems_file_ioctl (rtems_libio_t* iop, uint32_t command, void* buffer) -{ - return 0; -} - -/** * This routine processes the lseek() system call. * * @param iop @@ -351,7 +335,7 @@ const rtems_filesystem_file_handlers_r rtems_rfs_rtems_file_handlers = { .close_h = rtems_rfs_rtems_file_close, .read_h = rtems_rfs_rtems_file_read, .write_h = rtems_rfs_rtems_file_write, - .ioctl_h = rtems_rfs_rtems_file_ioctl, + .ioctl_h = rtems_filesystem_default_ioctl, .lseek_h = rtems_rfs_rtems_file_lseek, .fstat_h = rtems_rfs_rtems_fstat, .ftruncate_h = rtems_rfs_rtems_file_ftruncate, diff --git a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h index faf601c735..d9be5af2d3 100644 --- a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h +++ b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h @@ -22,12 +22,6 @@ typedef long long vm_ooffset_t; typedef unsigned int vm_pindex_t; typedef unsigned int vm_size_t; -#ifndef __ioctl_command_defined -typedef u_int32_t ioctl_command_t; -#define __ioctl_command_defined -#endif - - #define _BSD_OFF_T_ int32_t #define _BSD_PID_T_ rtems_id #define _BSD_VA_LIST_ char * @@ -38,6 +32,7 @@ typedef u_int32_t ioctl_command_t; #include <sys/cdefs.h> #include <sys/time.h> +#include <sys/ioctl.h> struct mdproc { int md_flags; |