forked from Imagelibrary/rtems
Added const qualifier to various pointers and data tables to
reduce size of data area. IMFS: Fixed creation of symbolic links to avoid a compiler warning. DOSFS: Use LibBlock instead of read() to read the boot record.
This commit is contained in:
@@ -1,3 +1,69 @@
|
|||||||
|
|
||||||
|
2008-05-27 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||||
|
|
||||||
|
* score/include/rtems/score/object.h,
|
||||||
|
rtems/include/rtems/rtems/types.h: Added new defines OBJECTS_ID_NONE
|
||||||
|
and RTEMS_ID_NONE. No object can have this ID.
|
||||||
|
|
||||||
|
2008-05-27 Sebastian Huber <Sebastian.Huber@embedded-brains.de>
|
||||||
|
|
||||||
|
* include/rtems/fs.h,
|
||||||
|
libblock/include/rtems/diskdevs.h,
|
||||||
|
libblock/src/diskdevs.c,
|
||||||
|
libcsupport/include/rtems/libio.h,
|
||||||
|
libcsupport/src/base_fs.c,
|
||||||
|
libcsupport/src/error.c,
|
||||||
|
libcsupport/src/libio.c,
|
||||||
|
libcsupport/src/mount.c,
|
||||||
|
libfs/src/dosfs/fat.c,
|
||||||
|
libfs/src/dosfs/msdos.h,
|
||||||
|
libfs/src/dosfs/msdos_handlers_dir.c,
|
||||||
|
libfs/src/dosfs/msdos_handlers_file.c,
|
||||||
|
libfs/src/dosfs/msdos_init.c,
|
||||||
|
libfs/src/dosfs/msdos_initsupp.c,
|
||||||
|
libfs/src/imfs/deviceio.c,
|
||||||
|
libfs/src/imfs/imfs.h,
|
||||||
|
libfs/src/imfs/imfs_config.c,
|
||||||
|
libfs/src/imfs/imfs_creat.c,
|
||||||
|
libfs/src/imfs/imfs_getchild.c,
|
||||||
|
libfs/src/imfs/imfs_handlers_device.c,
|
||||||
|
libfs/src/imfs/imfs_handlers_directory.c,
|
||||||
|
libfs/src/imfs/imfs_handlers_link.c,
|
||||||
|
libfs/src/imfs/imfs_handlers_memfile.c,
|
||||||
|
libfs/src/imfs/imfs_init.c,
|
||||||
|
libfs/src/imfs/imfs_initsupp.c,
|
||||||
|
libfs/src/imfs/imfs_symlink.c,
|
||||||
|
libfs/src/imfs/imfs_unixstub.c,
|
||||||
|
libfs/src/imfs/miniimfs_init.c,
|
||||||
|
posix/include/rtems/posix/psignal.h,
|
||||||
|
posix/src/psignal.c,
|
||||||
|
rtems/include/rtems/rtems/status.h,
|
||||||
|
rtems/src/semtranslatereturncode.c,
|
||||||
|
sapi/include/confdefs.h,
|
||||||
|
sapi/include/rtems/io.h,
|
||||||
|
sapi/src/ioregisterdriver.c,
|
||||||
|
sapi/src/itronapi.c,
|
||||||
|
sapi/src/posixapi.c:
|
||||||
|
Added const qualifier to various pointers and data tables to
|
||||||
|
reduce size of data area.
|
||||||
|
IMFS: Fixed creation of symbolic links to avoid a compiler warning.
|
||||||
|
DOSFS: Use LibBlock instead of read() to read the boot record.
|
||||||
|
|
||||||
|
2008-05-27 Sebastian Huber <Sebastian.Huber@embedded-brains.de>
|
||||||
|
|
||||||
|
* libcsupport/include/console.h:
|
||||||
|
New define: CONSOLE_DEVICE_NAME.
|
||||||
|
|
||||||
|
2008-05-27 Sebastian Huber <Sebastian.Huber@embedded-brains.de>
|
||||||
|
|
||||||
|
* libcsupport/src/printk.c:
|
||||||
|
Bugfix: String output without width option.
|
||||||
|
|
||||||
|
2008-05-27 Sebastian Huber <Sebastian.Huber@embedded-brains.de>
|
||||||
|
|
||||||
|
* libnetworking/net/if_ppp.c, libnetworking/net/if_pppvar.h:
|
||||||
|
Bugfix: Moved definition of ppp_softc into source file.
|
||||||
|
|
||||||
2008-05-23 Till Straumann <strauman@slac.stanford.edu>
|
2008-05-23 Till Straumann <strauman@slac.stanford.edu>
|
||||||
|
|
||||||
* libnetworking/netinet/ip_output.c: when fragmenting
|
* libnetworking/netinet/ip_output.c: when fragmenting
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ typedef struct _rtems_filesystem_operations_table
|
|||||||
struct rtems_filesystem_location_info_tt
|
struct rtems_filesystem_location_info_tt
|
||||||
{
|
{
|
||||||
void *node_access;
|
void *node_access;
|
||||||
rtems_filesystem_file_handlers_r *handlers;
|
const rtems_filesystem_file_handlers_r *handlers;
|
||||||
rtems_filesystem_operations_table *ops;
|
const rtems_filesystem_operations_table *ops;
|
||||||
rtems_filesystem_mount_table_entry_t *mt_entry;
|
rtems_filesystem_mount_table_entry_t *mt_entry;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ typedef struct disk_device {
|
|||||||
rtems_status_code
|
rtems_status_code
|
||||||
rtems_disk_create_phys(dev_t dev, int block_size, int disk_size,
|
rtems_disk_create_phys(dev_t dev, int block_size, int disk_size,
|
||||||
block_device_ioctl handler,
|
block_device_ioctl handler,
|
||||||
char *name);
|
const char *name);
|
||||||
|
|
||||||
/* rtems_disk_create_log --
|
/* rtems_disk_create_log --
|
||||||
* Create logical disk entry. Logical disk is contiguous area on physical
|
* Create logical disk entry. Logical disk is contiguous area on physical
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ get_disk_entry(dev_t dev)
|
|||||||
* no memory available).
|
* no memory available).
|
||||||
*/
|
*/
|
||||||
static rtems_status_code
|
static rtems_status_code
|
||||||
create_disk(dev_t dev, char *name, disk_device **diskdev)
|
create_disk(dev_t dev, const char *name, disk_device **diskdev)
|
||||||
{
|
{
|
||||||
disk_device *dd;
|
disk_device *dd;
|
||||||
char *n;
|
char *n;
|
||||||
@@ -235,7 +235,7 @@ create_disk(dev_t dev, char *name, disk_device **diskdev)
|
|||||||
rtems_status_code
|
rtems_status_code
|
||||||
rtems_disk_create_phys(dev_t dev, int block_size, int disk_size,
|
rtems_disk_create_phys(dev_t dev, int block_size, int disk_size,
|
||||||
block_device_ioctl handler,
|
block_device_ioctl handler,
|
||||||
char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
int bs_log2;
|
int bs_log2;
|
||||||
int i;
|
int i;
|
||||||
|
|||||||
@@ -354,7 +354,7 @@ struct rtems_libio_tt {
|
|||||||
uint32_t data0; /* private to "driver" */
|
uint32_t data0; /* private to "driver" */
|
||||||
void *data1; /* ... */
|
void *data1; /* ... */
|
||||||
void *file_info; /* used by file handlers */
|
void *file_info; /* used by file handlers */
|
||||||
rtems_filesystem_file_handlers_r *handlers; /* type specific handlers */
|
const rtems_filesystem_file_handlers_r *handlers; /* type specific handlers */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -613,10 +613,10 @@ int unmount(
|
|||||||
|
|
||||||
int mount(
|
int mount(
|
||||||
rtems_filesystem_mount_table_entry_t **mt_entry,
|
rtems_filesystem_mount_table_entry_t **mt_entry,
|
||||||
rtems_filesystem_operations_table *fs_ops,
|
const rtems_filesystem_operations_table *fs_ops,
|
||||||
rtems_filesystem_options_t fsoptions,
|
rtems_filesystem_options_t fsoptions,
|
||||||
char *device,
|
const char *device,
|
||||||
char *mount_point
|
const char *mount_point
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -624,14 +624,14 @@ int mount(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
rtems_filesystem_operations_table *fs_ops;
|
const rtems_filesystem_operations_table *fs_ops;
|
||||||
rtems_filesystem_options_t fsoptions;
|
rtems_filesystem_options_t fsoptions;
|
||||||
char *device;
|
const char *device;
|
||||||
char *mount_point;
|
const char *mount_point;
|
||||||
} rtems_filesystem_mount_table_t;
|
} rtems_filesystem_mount_table_t;
|
||||||
|
|
||||||
extern rtems_filesystem_mount_table_t *rtems_filesystem_mount_table;
|
extern const rtems_filesystem_mount_table_t *rtems_filesystem_mount_table;
|
||||||
extern int rtems_filesystem_mount_table_size;
|
extern const int rtems_filesystem_mount_table_size;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ void rtems_filesystem_initialize( void )
|
|||||||
#if !defined(RTEMS_UNIX)
|
#if !defined(RTEMS_UNIX)
|
||||||
int status;
|
int status;
|
||||||
rtems_filesystem_mount_table_entry_t *entry;
|
rtems_filesystem_mount_table_entry_t *entry;
|
||||||
rtems_filesystem_mount_table_t *mt;
|
const rtems_filesystem_mount_table_t *mt;
|
||||||
rtems_filesystem_location_info_t loc;
|
rtems_filesystem_location_info_t loc;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ char *strerror(int);
|
|||||||
|
|
||||||
int rtems_panic_in_progress;
|
int rtems_panic_in_progress;
|
||||||
|
|
||||||
rtems_assoc_t rtems_status_assoc[] = {
|
const rtems_assoc_t rtems_status_assoc[] = {
|
||||||
{ "successful completion", RTEMS_SUCCESSFUL, },
|
{ "successful completion", RTEMS_SUCCESSFUL, },
|
||||||
{ "returned from a thread", RTEMS_TASK_EXITTED, },
|
{ "returned from a thread", RTEMS_TASK_EXITTED, },
|
||||||
{ "multiprocessing not configured", RTEMS_MP_NOT_CONFIGURED, },
|
{ "multiprocessing not configured", RTEMS_MP_NOT_CONFIGURED, },
|
||||||
|
|||||||
@@ -62,14 +62,14 @@ extern rtems_libio_t *rtems_libio_iop_freelist;
|
|||||||
* Convert UNIX fnctl(2) flags to ones that RTEMS drivers understand
|
* Convert UNIX fnctl(2) flags to ones that RTEMS drivers understand
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_assoc_t access_modes_assoc[] = {
|
const rtems_assoc_t access_modes_assoc[] = {
|
||||||
{ "READ", LIBIO_FLAGS_READ, O_RDONLY },
|
{ "READ", LIBIO_FLAGS_READ, O_RDONLY },
|
||||||
{ "WRITE", LIBIO_FLAGS_WRITE, O_WRONLY },
|
{ "WRITE", LIBIO_FLAGS_WRITE, O_WRONLY },
|
||||||
{ "READ/WRITE", LIBIO_FLAGS_READ_WRITE, O_RDWR },
|
{ "READ/WRITE", LIBIO_FLAGS_READ_WRITE, O_RDWR },
|
||||||
{ 0, 0, 0 },
|
{ 0, 0, 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
rtems_assoc_t status_flags_assoc[] = {
|
const rtems_assoc_t status_flags_assoc[] = {
|
||||||
#ifdef ACCEPT_O_NDELAY_ALIAS
|
#ifdef ACCEPT_O_NDELAY_ALIAS
|
||||||
{ "NO DELAY", LIBIO_FLAGS_NO_DELAY, O_NDELAY },
|
{ "NO DELAY", LIBIO_FLAGS_NO_DELAY, O_NDELAY },
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -69,10 +69,10 @@ static int Is_node_fs_root(
|
|||||||
|
|
||||||
int mount(
|
int mount(
|
||||||
rtems_filesystem_mount_table_entry_t **mt_entry,
|
rtems_filesystem_mount_table_entry_t **mt_entry,
|
||||||
rtems_filesystem_operations_table *fs_ops,
|
const rtems_filesystem_operations_table *fs_ops,
|
||||||
rtems_filesystem_options_t options,
|
rtems_filesystem_options_t options,
|
||||||
char *device,
|
const char *device,
|
||||||
char *mount_point
|
const char *mount_point
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
rtems_filesystem_location_info_t loc;
|
rtems_filesystem_location_info_t loc;
|
||||||
|
|||||||
@@ -205,6 +205,7 @@ fat_cluster_write(
|
|||||||
int
|
int
|
||||||
fat_init_volume_info(rtems_filesystem_mount_table_entry_t *mt_entry)
|
fat_init_volume_info(rtems_filesystem_mount_table_entry_t *mt_entry)
|
||||||
{
|
{
|
||||||
|
rtems_status_code sc = RTEMS_SUCCESSFUL;
|
||||||
int rc = RC_OK;
|
int rc = RC_OK;
|
||||||
fat_fs_info_t *fs_info = mt_entry->fs_info;
|
fat_fs_info_t *fs_info = mt_entry->fs_info;
|
||||||
register fat_vol_t *vol = &fs_info->vol;
|
register fat_vol_t *vol = &fs_info->vol;
|
||||||
@@ -212,9 +213,9 @@ fat_init_volume_info(rtems_filesystem_mount_table_entry_t *mt_entry)
|
|||||||
char boot_rec[FAT_MAX_BPB_SIZE];
|
char boot_rec[FAT_MAX_BPB_SIZE];
|
||||||
char fs_info_sector[FAT_USEFUL_INFO_SIZE];
|
char fs_info_sector[FAT_USEFUL_INFO_SIZE];
|
||||||
ssize_t ret = 0;
|
ssize_t ret = 0;
|
||||||
int fd;
|
|
||||||
struct stat stat_buf;
|
struct stat stat_buf;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
bdbuf_buffer *block = NULL;
|
||||||
|
|
||||||
rc = stat(mt_entry->dev, &stat_buf);
|
rc = stat(mt_entry->dev, &stat_buf);
|
||||||
if (rc == -1)
|
if (rc == -1)
|
||||||
@@ -231,22 +232,25 @@ fat_init_volume_info(rtems_filesystem_mount_table_entry_t *mt_entry)
|
|||||||
|
|
||||||
vol->dev = stat_buf.st_dev;
|
vol->dev = stat_buf.st_dev;
|
||||||
|
|
||||||
fd = open(mt_entry->dev, O_RDONLY);
|
/* Read boot record */
|
||||||
if (fd == -1)
|
/* FIXME: Asserts FAT_MAX_BPB_SIZE < bdbuf block size */
|
||||||
|
sc = rtems_bdbuf_read( vol->dev, 0, &block);
|
||||||
|
if (sc != RTEMS_SUCCESSFUL)
|
||||||
{
|
{
|
||||||
rtems_disk_release(vol->dd);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = read(fd, (void *)boot_rec, FAT_MAX_BPB_SIZE);
|
|
||||||
if ( ret != FAT_MAX_BPB_SIZE )
|
|
||||||
{
|
|
||||||
close(fd);
|
|
||||||
rtems_disk_release(vol->dd);
|
rtems_disk_release(vol->dd);
|
||||||
set_errno_and_return_minus_one( EIO);
|
set_errno_and_return_minus_one( EIO);
|
||||||
}
|
}
|
||||||
close(fd);
|
|
||||||
|
|
||||||
|
memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE);
|
||||||
|
|
||||||
|
sc = rtems_bdbuf_release( block);
|
||||||
|
if (sc != RTEMS_SUCCESSFUL)
|
||||||
|
{
|
||||||
|
rtems_disk_release(vol->dd);
|
||||||
|
set_errno_and_return_minus_one( EIO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Evaluate boot record */
|
||||||
vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec);
|
vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec);
|
||||||
|
|
||||||
if ( (vol->bps != 512) &&
|
if ( (vol->bps != 512) &&
|
||||||
|
|||||||
@@ -37,13 +37,13 @@ typedef struct msdos_fs_info_s
|
|||||||
* volume
|
* volume
|
||||||
* description
|
* description
|
||||||
*/
|
*/
|
||||||
rtems_filesystem_file_handlers_r *directory_handlers; /*
|
const rtems_filesystem_file_handlers_r *directory_handlers; /*
|
||||||
* a set of routines
|
* a set of routines
|
||||||
* that handles the
|
* that handles the
|
||||||
* nodes of directory
|
* nodes of directory
|
||||||
* type
|
* type
|
||||||
*/
|
*/
|
||||||
rtems_filesystem_file_handlers_r *file_handlers; /*
|
const rtems_filesystem_file_handlers_r *file_handlers; /*
|
||||||
* a set of routines
|
* a set of routines
|
||||||
* that handles the
|
* that handles the
|
||||||
* nodes of file
|
* nodes of file
|
||||||
@@ -61,10 +61,10 @@ typedef struct msdos_fs_info_s
|
|||||||
} msdos_fs_info_t;
|
} msdos_fs_info_t;
|
||||||
|
|
||||||
/* a set of routines that handle the nodes which are directories */
|
/* a set of routines that handle the nodes which are directories */
|
||||||
extern rtems_filesystem_file_handlers_r msdos_dir_handlers;
|
extern const rtems_filesystem_file_handlers_r msdos_dir_handlers;
|
||||||
|
|
||||||
/* a set of routines that handle the nodes which are files */
|
/* a set of routines that handle the nodes which are files */
|
||||||
extern rtems_filesystem_file_handlers_r msdos_file_handlers;
|
extern const rtems_filesystem_file_handlers_r msdos_file_handlers;
|
||||||
|
|
||||||
/* Volume semaphore timeout value. This value can be changed to a number
|
/* Volume semaphore timeout value. This value can be changed to a number
|
||||||
* of ticks to help debugging or if you need such a */
|
* of ticks to help debugging or if you need such a */
|
||||||
@@ -232,9 +232,9 @@ int msdos_utime(
|
|||||||
|
|
||||||
int msdos_initialize_support(
|
int msdos_initialize_support(
|
||||||
rtems_filesystem_mount_table_entry_t *temp_mt_entry,
|
rtems_filesystem_mount_table_entry_t *temp_mt_entry,
|
||||||
rtems_filesystem_operations_table *op_table,
|
const rtems_filesystem_operations_table *op_table,
|
||||||
rtems_filesystem_file_handlers_r *file_handlers,
|
const rtems_filesystem_file_handlers_r *file_handlers,
|
||||||
rtems_filesystem_file_handlers_r *directory_handlers
|
const rtems_filesystem_file_handlers_r *directory_handlers
|
||||||
);
|
);
|
||||||
|
|
||||||
int msdos_file_open(
|
int msdos_file_open(
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include <rtems/libio.h>
|
#include <rtems/libio.h>
|
||||||
#include "msdos.h"
|
#include "msdos.h"
|
||||||
|
|
||||||
rtems_filesystem_file_handlers_r msdos_dir_handlers = {
|
const rtems_filesystem_file_handlers_r msdos_dir_handlers = {
|
||||||
msdos_dir_open,
|
msdos_dir_open,
|
||||||
msdos_dir_close,
|
msdos_dir_close,
|
||||||
msdos_dir_read,
|
msdos_dir_read,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include <rtems/libio.h>
|
#include <rtems/libio.h>
|
||||||
#include "msdos.h"
|
#include "msdos.h"
|
||||||
|
|
||||||
rtems_filesystem_file_handlers_r msdos_file_handlers = {
|
const rtems_filesystem_file_handlers_r msdos_file_handlers = {
|
||||||
msdos_file_open,
|
msdos_file_open,
|
||||||
msdos_file_close,
|
msdos_file_close,
|
||||||
msdos_file_read,
|
msdos_file_read,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include <rtems/libio_.h>
|
#include <rtems/libio_.h>
|
||||||
#include "msdos.h"
|
#include "msdos.h"
|
||||||
|
|
||||||
rtems_filesystem_operations_table msdos_ops = {
|
const rtems_filesystem_operations_table msdos_ops = {
|
||||||
msdos_eval_path,
|
msdos_eval_path,
|
||||||
msdos_eval4make,
|
msdos_eval4make,
|
||||||
#if 0
|
#if 0
|
||||||
|
|||||||
@@ -48,9 +48,9 @@
|
|||||||
int
|
int
|
||||||
msdos_initialize_support(
|
msdos_initialize_support(
|
||||||
rtems_filesystem_mount_table_entry_t *temp_mt_entry,
|
rtems_filesystem_mount_table_entry_t *temp_mt_entry,
|
||||||
rtems_filesystem_operations_table *op_table,
|
const rtems_filesystem_operations_table *op_table,
|
||||||
rtems_filesystem_file_handlers_r *file_handlers,
|
const rtems_filesystem_file_handlers_r *file_handlers,
|
||||||
rtems_filesystem_file_handlers_r *directory_handlers
|
const rtems_filesystem_file_handlers_r *directory_handlers
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
int rc = RC_OK;
|
int rc = RC_OK;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
* Convert RTEMS status to a UNIX errno
|
* Convert RTEMS status to a UNIX errno
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_assoc_t errno_assoc[] = {
|
const rtems_assoc_t errno_assoc[] = {
|
||||||
{ "OK", RTEMS_SUCCESSFUL, 0 },
|
{ "OK", RTEMS_SUCCESSFUL, 0 },
|
||||||
{ "BUSY", RTEMS_RESOURCE_IN_USE, EBUSY },
|
{ "BUSY", RTEMS_RESOURCE_IN_USE, EBUSY },
|
||||||
{ "INVALID NAME", RTEMS_INVALID_NAME, EINVAL },
|
{ "INVALID NAME", RTEMS_INVALID_NAME, EINVAL },
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ typedef struct {
|
|||||||
} IMFS_link_t;
|
} IMFS_link_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char *name;
|
char *name;
|
||||||
} IMFS_sym_link_t;
|
} IMFS_sym_link_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -206,8 +206,8 @@ struct IMFS_jnode_tt {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ino_t ino_count;
|
ino_t ino_count;
|
||||||
rtems_filesystem_file_handlers_r *memfile_handlers;
|
const rtems_filesystem_file_handlers_r *memfile_handlers;
|
||||||
rtems_filesystem_file_handlers_r *directory_handlers;
|
const rtems_filesystem_file_handlers_r *directory_handlers;
|
||||||
} IMFS_fs_info_t;
|
} IMFS_fs_info_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -226,13 +226,13 @@ typedef enum {
|
|||||||
* Shared Data
|
* Shared Data
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern rtems_filesystem_file_handlers_r IMFS_directory_handlers;
|
extern const rtems_filesystem_file_handlers_r IMFS_directory_handlers;
|
||||||
extern rtems_filesystem_file_handlers_r IMFS_device_handlers;
|
extern const rtems_filesystem_file_handlers_r IMFS_device_handlers;
|
||||||
extern rtems_filesystem_file_handlers_r IMFS_link_handlers;
|
extern const rtems_filesystem_file_handlers_r IMFS_link_handlers;
|
||||||
extern rtems_filesystem_file_handlers_r IMFS_memfile_handlers;
|
extern const rtems_filesystem_file_handlers_r IMFS_memfile_handlers;
|
||||||
extern rtems_filesystem_operations_table IMFS_ops;
|
extern const rtems_filesystem_operations_table IMFS_ops;
|
||||||
extern rtems_filesystem_operations_table miniIMFS_ops;
|
extern const rtems_filesystem_operations_table miniIMFS_ops;
|
||||||
extern rtems_filesystem_limits_and_options_t IMFS_LIMITS_AND_OPTIONS;
|
extern const rtems_filesystem_limits_and_options_t IMFS_LIMITS_AND_OPTIONS;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Routines
|
* Routines
|
||||||
@@ -248,9 +248,9 @@ int miniIMFS_initialize(
|
|||||||
|
|
||||||
int IMFS_initialize_support(
|
int IMFS_initialize_support(
|
||||||
rtems_filesystem_mount_table_entry_t *mt_entry,
|
rtems_filesystem_mount_table_entry_t *mt_entry,
|
||||||
rtems_filesystem_operations_table *op_table,
|
const rtems_filesystem_operations_table *op_table,
|
||||||
rtems_filesystem_file_handlers_r *memfile_handlers,
|
const rtems_filesystem_file_handlers_r *memfile_handlers,
|
||||||
rtems_filesystem_file_handlers_r *directory_handlers
|
const rtems_filesystem_file_handlers_r *directory_handlers
|
||||||
);
|
);
|
||||||
|
|
||||||
int IMFS_fsunmount(
|
int IMFS_fsunmount(
|
||||||
@@ -342,9 +342,9 @@ int IMFS_mknod(
|
|||||||
IMFS_jnode_t *IMFS_create_node(
|
IMFS_jnode_t *IMFS_create_node(
|
||||||
rtems_filesystem_location_info_t *parent_loc, /* IN */
|
rtems_filesystem_location_info_t *parent_loc, /* IN */
|
||||||
IMFS_jnode_types_t type, /* IN */
|
IMFS_jnode_types_t type, /* IN */
|
||||||
char *name, /* IN */
|
const char *name, /* IN */
|
||||||
mode_t mode, /* IN */
|
mode_t mode, /* IN */
|
||||||
IMFS_types_union *info /* IN */
|
const IMFS_types_union *info /* IN */
|
||||||
);
|
);
|
||||||
|
|
||||||
int IMFS_evaluate_for_make(
|
int IMFS_evaluate_for_make(
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
/* XXX this structure should use real constants */
|
/* XXX this structure should use real constants */
|
||||||
|
|
||||||
rtems_filesystem_limits_and_options_t IMFS_LIMITS_AND_OPTIONS = {
|
const rtems_filesystem_limits_and_options_t IMFS_LIMITS_AND_OPTIONS = {
|
||||||
5, /* link_max */
|
5, /* link_max */
|
||||||
6, /* max_canon */
|
6, /* max_canon */
|
||||||
7, /* max_input */
|
7, /* max_input */
|
||||||
|
|||||||
@@ -26,16 +26,15 @@
|
|||||||
IMFS_jnode_t *IMFS_create_node(
|
IMFS_jnode_t *IMFS_create_node(
|
||||||
rtems_filesystem_location_info_t *parent_loc,
|
rtems_filesystem_location_info_t *parent_loc,
|
||||||
IMFS_jnode_types_t type,
|
IMFS_jnode_types_t type,
|
||||||
char *name,
|
const char *name,
|
||||||
mode_t mode,
|
mode_t mode,
|
||||||
IMFS_types_union *info
|
const IMFS_types_union *info
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
IMFS_jnode_t *node;
|
IMFS_jnode_t *node;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
IMFS_jnode_t *parent = NULL;
|
IMFS_jnode_t *parent = NULL;
|
||||||
IMFS_fs_info_t *fs_info;
|
IMFS_fs_info_t *fs_info;
|
||||||
char *sym_name;
|
|
||||||
|
|
||||||
if ( parent_loc != NULL )
|
if ( parent_loc != NULL )
|
||||||
parent = parent_loc->node_access;
|
parent = parent_loc->node_access;
|
||||||
@@ -94,9 +93,7 @@ IMFS_jnode_t *IMFS_create_node(
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case IMFS_SYM_LINK:
|
case IMFS_SYM_LINK:
|
||||||
sym_name = calloc( 1, strlen( info->sym_link.name ) + 1 );
|
node->info.sym_link.name = info->sym_link.name;
|
||||||
strcpy( sym_name, info->sym_link.name );
|
|
||||||
node->info.sym_link.name = sym_name;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IMFS_DEVICE:
|
case IMFS_DEVICE:
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "imfs.h"
|
#include "imfs.h"
|
||||||
|
|
||||||
static char dotname[2] = ".";
|
static const char dotname[2] = ".";
|
||||||
static char dotdotname[3] = "..";
|
static const char dotdotname[3] = "..";
|
||||||
|
|
||||||
IMFS_jnode_t *IMFS_find_match_in_dir(
|
IMFS_jnode_t *IMFS_find_match_in_dir(
|
||||||
IMFS_jnode_t *directory,
|
IMFS_jnode_t *directory,
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
* Handler table for IMFS device nodes
|
* Handler table for IMFS device nodes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_filesystem_file_handlers_r IMFS_device_handlers = {
|
const rtems_filesystem_file_handlers_r IMFS_device_handlers = {
|
||||||
device_open,
|
device_open,
|
||||||
device_close,
|
device_close,
|
||||||
device_read,
|
device_read,
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
* Set of operations handlers for operations on directories.
|
* Set of operations handlers for operations on directories.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_filesystem_file_handlers_r IMFS_directory_handlers = {
|
const rtems_filesystem_file_handlers_r IMFS_directory_handlers = {
|
||||||
imfs_dir_open,
|
imfs_dir_open,
|
||||||
imfs_dir_close,
|
imfs_dir_close,
|
||||||
imfs_dir_read,
|
imfs_dir_read,
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
* Handler table for IMFS device nodes
|
* Handler table for IMFS device nodes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_filesystem_file_handlers_r IMFS_link_handlers = {
|
const rtems_filesystem_file_handlers_r IMFS_link_handlers = {
|
||||||
NULL, /* open */
|
NULL, /* open */
|
||||||
NULL, /* close */
|
NULL, /* close */
|
||||||
NULL, /* read */
|
NULL, /* read */
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
* Set of operations handlers for operations on memfile entities.
|
* Set of operations handlers for operations on memfile entities.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_filesystem_file_handlers_r IMFS_memfile_handlers = {
|
const rtems_filesystem_file_handlers_r IMFS_memfile_handlers = {
|
||||||
memfile_open,
|
memfile_open,
|
||||||
memfile_close,
|
memfile_close,
|
||||||
memfile_read,
|
memfile_read,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
* IMFS file system operations table
|
* IMFS file system operations table
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_filesystem_operations_table IMFS_ops = {
|
const rtems_filesystem_operations_table IMFS_ops = {
|
||||||
IMFS_eval_path,
|
IMFS_eval_path,
|
||||||
IMFS_evaluate_for_make,
|
IMFS_evaluate_for_make,
|
||||||
IMFS_link,
|
IMFS_link,
|
||||||
|
|||||||
@@ -67,9 +67,9 @@ static int IMFS_determine_bytes_per_block(
|
|||||||
|
|
||||||
int IMFS_initialize_support(
|
int IMFS_initialize_support(
|
||||||
rtems_filesystem_mount_table_entry_t *temp_mt_entry,
|
rtems_filesystem_mount_table_entry_t *temp_mt_entry,
|
||||||
rtems_filesystem_operations_table *op_table,
|
const rtems_filesystem_operations_table *op_table,
|
||||||
rtems_filesystem_file_handlers_r *memfile_handlers,
|
const rtems_filesystem_file_handlers_r *memfile_handlers,
|
||||||
rtems_filesystem_file_handlers_r *directory_handlers
|
const rtems_filesystem_file_handlers_r *directory_handlers
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
IMFS_fs_info_t *fs_info;
|
IMFS_fs_info_t *fs_info;
|
||||||
|
|||||||
@@ -20,6 +20,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include "imfs.h"
|
#include "imfs.h"
|
||||||
#include <rtems/libio_.h>
|
#include <rtems/libio_.h>
|
||||||
#include <rtems/seterr.h>
|
#include <rtems/seterr.h>
|
||||||
@@ -41,7 +43,14 @@ int IMFS_symlink(
|
|||||||
|
|
||||||
IMFS_get_token( node_name, new_name, &i );
|
IMFS_get_token( node_name, new_name, &i );
|
||||||
|
|
||||||
info.sym_link.name = link_name;
|
/*
|
||||||
|
* Duplicate link name
|
||||||
|
*/
|
||||||
|
|
||||||
|
info.sym_link.name = strdup( link_name);
|
||||||
|
if (info.sym_link.name == NULL) {
|
||||||
|
rtems_set_errno_and_return_minus_one( ENOMEM);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create a new link node.
|
* Create a new link node.
|
||||||
@@ -55,8 +64,10 @@ int IMFS_symlink(
|
|||||||
&info
|
&info
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( !new_node )
|
if (new_node == NULL) {
|
||||||
|
free( info.sym_link.name);
|
||||||
rtems_set_errno_and_return_minus_one( ENOMEM);
|
rtems_set_errno_and_return_minus_one( ENOMEM);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
* IMFS file system operations table
|
* IMFS file system operations table
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_filesystem_operations_table IMFS_ops = {
|
const rtems_filesystem_operations_table IMFS_ops = {
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -54,7 +54,7 @@ rtems_filesystem_operations_table IMFS_ops = {
|
|||||||
* IMFS file system operations table
|
* IMFS file system operations table
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_filesystem_operations_table miniIMFS_ops = {
|
const rtems_filesystem_operations_table miniIMFS_ops = {
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
* miniIMFS file system operations table
|
* miniIMFS file system operations table
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_filesystem_operations_table miniIMFS_ops = {
|
const rtems_filesystem_operations_table miniIMFS_ops = {
|
||||||
IMFS_eval_path,
|
IMFS_eval_path,
|
||||||
IMFS_evaluate_for_make,
|
IMFS_evaluate_for_make,
|
||||||
NULL, /* XXX IMFS_link, */
|
NULL, /* XXX IMFS_link, */
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
|
|
||||||
extern sigset_t _POSIX_signals_Pending;
|
extern sigset_t _POSIX_signals_Pending;
|
||||||
|
|
||||||
extern struct sigaction _POSIX_signals_Default_vectors[ SIG_ARRAY_MAX ];
|
extern const struct sigaction _POSIX_signals_Default_vectors[ SIG_ARRAY_MAX ];
|
||||||
|
|
||||||
extern struct sigaction _POSIX_signals_Vectors[ SIG_ARRAY_MAX ];
|
extern struct sigaction _POSIX_signals_Vectors[ SIG_ARRAY_MAX ];
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ void _POSIX_signals_Abnormal_termination_handler( int signo )
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define SIG_ARRAY_MAX (SIGRTMAX + 1)
|
#define SIG_ARRAY_MAX (SIGRTMAX + 1)
|
||||||
struct sigaction _POSIX_signals_Default_vectors[ SIG_ARRAY_MAX ] = {
|
const struct sigaction _POSIX_signals_Default_vectors[ SIG_ARRAY_MAX ] = {
|
||||||
/* NO SIGNAL 0 */ SIGACTION_IGNORE,
|
/* NO SIGNAL 0 */ SIGACTION_IGNORE,
|
||||||
/* SIGHUP 1 */ SIGACTION_TERMINATE,
|
/* SIGHUP 1 */ SIGACTION_TERMINATE,
|
||||||
/* SIGINT 2 */ SIGACTION_TERMINATE,
|
/* SIGINT 2 */ SIGACTION_TERMINATE,
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ typedef enum {
|
|||||||
* codes to Classic API status codes.
|
* codes to Classic API status codes.
|
||||||
*/
|
*/
|
||||||
#ifdef RTEMS_API_INIT
|
#ifdef RTEMS_API_INIT
|
||||||
rtems_status_code _Status_Object_name_errors_to_status[] = {
|
const rtems_status_code _Status_Object_name_errors_to_status[] = {
|
||||||
/** This maps OBJECTS_SUCCESSFUL to RTEMS_SUCCESSFUL. */
|
/** This maps OBJECTS_SUCCESSFUL to RTEMS_SUCCESSFUL. */
|
||||||
RTEMS_SUCCESSFUL,
|
RTEMS_SUCCESSFUL,
|
||||||
/** This maps OBJECTS_INVALID_NAME to RTEMS_INVALID_NAME. */
|
/** This maps OBJECTS_INVALID_NAME to RTEMS_INVALID_NAME. */
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code _Semaphore_Translate_core_mutex_return_code_[] = {
|
const rtems_status_code _Semaphore_Translate_core_mutex_return_code_[] = {
|
||||||
RTEMS_SUCCESSFUL, /* CORE_MUTEX_STATUS_SUCCESSFUL */
|
RTEMS_SUCCESSFUL, /* CORE_MUTEX_STATUS_SUCCESSFUL */
|
||||||
RTEMS_UNSATISFIED, /* CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT */
|
RTEMS_UNSATISFIED, /* CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT */
|
||||||
RTEMS_UNSATISFIED, /* CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED */
|
RTEMS_UNSATISFIED, /* CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED */
|
||||||
@@ -109,7 +109,7 @@ rtems_status_code _Semaphore_Translate_core_mutex_return_code (
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_status_code _Semaphore_Translate_core_semaphore_return_code_[] = {
|
const rtems_status_code _Semaphore_Translate_core_semaphore_return_code_[] = {
|
||||||
RTEMS_SUCCESSFUL, /* CORE_SEMAPHORE_STATUS_SUCCESSFUL */
|
RTEMS_SUCCESSFUL, /* CORE_SEMAPHORE_STATUS_SUCCESSFUL */
|
||||||
RTEMS_UNSATISFIED, /* CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT */
|
RTEMS_UNSATISFIED, /* CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT */
|
||||||
RTEMS_OBJECT_WAS_DELETED, /* CORE_SEMAPHORE_WAS_DELETED */
|
RTEMS_OBJECT_WAS_DELETED, /* CORE_SEMAPHORE_WAS_DELETED */
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ extern int rtems_telnetd_maximum_ptys;
|
|||||||
|
|
||||||
#ifdef CONFIGURE_INIT
|
#ifdef CONFIGURE_INIT
|
||||||
#ifndef CONFIGURE_HAS_OWN_MOUNT_TABLE
|
#ifndef CONFIGURE_HAS_OWN_MOUNT_TABLE
|
||||||
rtems_filesystem_mount_table_t configuration_mount_table = {
|
const rtems_filesystem_mount_table_t configuration_mount_table = {
|
||||||
#ifdef CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
|
#ifdef CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
|
||||||
&IMFS_ops,
|
&IMFS_ops,
|
||||||
#else /* using miniIMFS as base filesystem */
|
#else /* using miniIMFS as base filesystem */
|
||||||
@@ -144,9 +144,9 @@ extern int rtems_telnetd_maximum_ptys;
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
rtems_filesystem_mount_table_t
|
const rtems_filesystem_mount_table_t
|
||||||
*rtems_filesystem_mount_table = &configuration_mount_table;
|
*rtems_filesystem_mount_table = &configuration_mount_table;
|
||||||
int rtems_filesystem_mount_table_size = 1;
|
const int rtems_filesystem_mount_table_size = 1;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ void _IO_Manager_initialization(
|
|||||||
|
|
||||||
rtems_status_code rtems_io_register_driver(
|
rtems_status_code rtems_io_register_driver(
|
||||||
rtems_device_major_number major,
|
rtems_device_major_number major,
|
||||||
rtems_driver_address_table *driver_table,
|
const rtems_driver_address_table *driver_table,
|
||||||
rtems_device_major_number *registered_major
|
rtems_device_major_number *registered_major
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
rtems_status_code rtems_io_register_driver(
|
rtems_status_code rtems_io_register_driver(
|
||||||
rtems_device_major_number major,
|
rtems_device_major_number major,
|
||||||
rtems_driver_address_table *driver_table,
|
const rtems_driver_address_table *driver_table,
|
||||||
rtems_device_major_number *registered_major
|
rtems_device_major_number *registered_major
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
* XXX
|
* XXX
|
||||||
*/
|
*/
|
||||||
|
|
||||||
itron_api_configuration_table _ITRON_Default_configuration = {
|
const itron_api_configuration_table _ITRON_Default_configuration = {
|
||||||
0, /* maximum_tasks */
|
0, /* maximum_tasks */
|
||||||
0, /* maximum_semaphores */
|
0, /* maximum_semaphores */
|
||||||
0, /* maximum_eventflags */
|
0, /* maximum_eventflags */
|
||||||
@@ -70,7 +70,7 @@ void _ITRON_API_Initialize(
|
|||||||
rtems_configuration_table *configuration_table
|
rtems_configuration_table *configuration_table
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
itron_api_configuration_table *api_configuration;
|
const itron_api_configuration_table *api_configuration;
|
||||||
|
|
||||||
/* XXX need to assert here based on size assumptions */
|
/* XXX need to assert here based on size assumptions */
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
* XXX
|
* XXX
|
||||||
*/
|
*/
|
||||||
|
|
||||||
posix_api_configuration_table _POSIX_Default_configuration = {
|
const posix_api_configuration_table _POSIX_Default_configuration = {
|
||||||
0, /* maximum_threads */
|
0, /* maximum_threads */
|
||||||
0, /* maximum_mutexes */
|
0, /* maximum_mutexes */
|
||||||
0, /* maximum_condition_variables */
|
0, /* maximum_condition_variables */
|
||||||
@@ -78,7 +78,7 @@ void _POSIX_API_Initialize(
|
|||||||
rtems_configuration_table *configuration_table
|
rtems_configuration_table *configuration_table
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
posix_api_configuration_table *api_configuration;
|
const posix_api_configuration_table *api_configuration;
|
||||||
|
|
||||||
/* XXX need to assert here based on size assumptions */
|
/* XXX need to assert here based on size assumptions */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user