forked from Imagelibrary/rtems
rfs: Fix major and minor number integer types
This commit is contained in:
@@ -24,6 +24,15 @@
|
||||
#include <rtems/devfs.h>
|
||||
#include "rtems-rfs-rtems.h"
|
||||
|
||||
static void
|
||||
rtems_rfs_rtems_device_get_major_and_minor ( const rtems_libio_t *iop,
|
||||
rtems_device_major_number *major,
|
||||
rtems_device_minor_number *minor)
|
||||
{
|
||||
*major = iop->data0;
|
||||
*minor = (rtems_device_minor_number) iop->data1;
|
||||
}
|
||||
|
||||
/**
|
||||
* This handler maps an open() operation onto rtems_io_open().
|
||||
*
|
||||
@@ -43,8 +52,8 @@ rtems_rfs_rtems_device_open ( rtems_libio_t *iop,
|
||||
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
|
||||
rtems_rfs_ino ino = rtems_rfs_rtems_get_iop_ino (iop);
|
||||
rtems_rfs_inode_handle inode;
|
||||
int major;
|
||||
int minor;
|
||||
rtems_device_major_number major;
|
||||
rtems_device_minor_number minor;
|
||||
rtems_status_code status;
|
||||
int rc;
|
||||
|
||||
@@ -70,7 +79,7 @@ rtems_rfs_rtems_device_open ( rtems_libio_t *iop,
|
||||
rtems_rfs_rtems_unlock (fs);
|
||||
|
||||
iop->data0 = major;
|
||||
iop->data1 = (void*)((intptr_t) minor);
|
||||
iop->data1 = (void *) minor;
|
||||
|
||||
args.iop = iop;
|
||||
args.flags = iop->flags;
|
||||
@@ -93,11 +102,10 @@ rtems_rfs_rtems_device_close (rtems_libio_t* iop)
|
||||
{
|
||||
rtems_libio_open_close_args_t args;
|
||||
rtems_status_code status;
|
||||
int major;
|
||||
int minor;
|
||||
rtems_device_major_number major;
|
||||
rtems_device_minor_number minor;
|
||||
|
||||
major = (int) iop->data0;
|
||||
minor = (intptr_t) iop->data1;
|
||||
rtems_rfs_rtems_device_get_major_and_minor (iop, &major, &minor);
|
||||
|
||||
args.iop = iop;
|
||||
args.flags = 0;
|
||||
@@ -120,13 +128,12 @@ rtems_rfs_rtems_device_close (rtems_libio_t* iop)
|
||||
static ssize_t
|
||||
rtems_rfs_rtems_device_read (rtems_libio_t* iop, void* buffer, size_t count)
|
||||
{
|
||||
rtems_libio_rw_args_t args;
|
||||
rtems_status_code status;
|
||||
int major;
|
||||
int minor;
|
||||
rtems_libio_rw_args_t args;
|
||||
rtems_status_code status;
|
||||
rtems_device_major_number major;
|
||||
rtems_device_minor_number minor;
|
||||
|
||||
major = (int) iop->data0;
|
||||
minor = (intptr_t) iop->data1;
|
||||
rtems_rfs_rtems_device_get_major_and_minor (iop, &major, &minor);
|
||||
|
||||
args.iop = iop;
|
||||
args.offset = iop->offset;
|
||||
@@ -156,13 +163,12 @@ rtems_rfs_rtems_device_write (rtems_libio_t* iop,
|
||||
const void* buffer,
|
||||
size_t count)
|
||||
{
|
||||
rtems_libio_rw_args_t args;
|
||||
rtems_status_code status;
|
||||
int major;
|
||||
int minor;
|
||||
rtems_libio_rw_args_t args;
|
||||
rtems_status_code status;
|
||||
rtems_device_major_number major;
|
||||
rtems_device_minor_number minor;
|
||||
|
||||
major = (int) iop->data0;
|
||||
minor = (intptr_t) iop->data1;
|
||||
rtems_rfs_rtems_device_get_major_and_minor (iop, &major, &minor);
|
||||
|
||||
args.iop = iop;
|
||||
args.offset = iop->offset;
|
||||
@@ -192,13 +198,12 @@ rtems_rfs_rtems_device_ioctl (rtems_libio_t* iop,
|
||||
uint32_t command,
|
||||
void* buffer)
|
||||
{
|
||||
rtems_libio_ioctl_args_t args;
|
||||
rtems_status_code status;
|
||||
int major;
|
||||
int minor;
|
||||
rtems_libio_ioctl_args_t args;
|
||||
rtems_status_code status;
|
||||
rtems_device_major_number major;
|
||||
rtems_device_minor_number minor;
|
||||
|
||||
major = (int) iop->data0;
|
||||
minor = (intptr_t) iop->data1;
|
||||
rtems_rfs_rtems_device_get_major_and_minor (iop, &major, &minor);
|
||||
|
||||
args.iop = iop;
|
||||
args.command = command;
|
||||
|
||||
Reference in New Issue
Block a user