2008-08-21 Joel Sherrill <joel.sherrill@OARcorp.com>

* libblock/include/rtems/bdbuf.h, libblock/include/rtems/diskdevs.h,
	libblock/src/bdbuf.c, libblock/src/blkdev.c, libblock/src/diskdevs.c,
	libblock/src/ramdisk.c: Eliminate sign mismatch warnings.
This commit is contained in:
Joel Sherrill
2008-08-21 16:17:35 +00:00
parent d9be802487
commit cec5c069b0
7 changed files with 42 additions and 36 deletions
+6
View File
@@ -1,3 +1,9 @@
2008-08-21 Joel Sherrill <joel.sherrill@OARcorp.com>
* libblock/include/rtems/bdbuf.h, libblock/include/rtems/diskdevs.h,
libblock/src/bdbuf.c, libblock/src/blkdev.c, libblock/src/diskdevs.c,
libblock/src/ramdisk.c: Eliminate sign mismatch warnings.
2008-08-21 Ralf Corsépius <ralf.corsepius@rtems.org> 2008-08-21 Ralf Corsépius <ralf.corsepius@rtems.org>
* libmisc/monitor/mon-network.c: Use memset instead of bzero. * libmisc/monitor/mon-network.c: Use memset instead of bzero.
+5 -5
View File
@@ -86,8 +86,8 @@ typedef struct rtems_bdbuf_buffer
*/ */
typedef struct rtems_bdbuf_pool typedef struct rtems_bdbuf_pool
{ {
int blksize; /*< The size of the blocks (in bytes) */ uint32_t blksize; /*< The size of the blocks (in bytes) */
int nblks; /*< Number of blocks in this pool */ uint32_t nblks; /*< Number of blocks in this pool */
uint32_t flags; /*< Configuration flags */ uint32_t flags; /*< Configuration flags */
@@ -144,8 +144,8 @@ extern int rtems_bdbuf_pool_configuration_size;
* structure. * structure.
*/ */
typedef struct rtems_bdbuf_config { typedef struct rtems_bdbuf_config {
int max_read_ahead_blocks; /*< Number of blocks to read ahead. */ uint32_t max_read_ahead_blocks; /*< Number of blocks to read ahead. */
int max_write_blocks; /*< Number of blocks to write at once. */ uint32_t max_write_blocks; /*< Number of blocks to write at once. */
rtems_task_priority swapout_priority; /*< Priority of the swap out task. */ rtems_task_priority swapout_priority; /*< Priority of the swap out task. */
uint32_t swapout_period; /*< Period swapout checks buf timers. */ uint32_t swapout_period; /*< Period swapout checks buf timers. */
uint32_t swap_block_hold; /*< Period a buffer is held. */ uint32_t swap_block_hold; /*< Period a buffer is held. */
@@ -317,7 +317,7 @@ rtems_bdbuf_syncdev (dev_t dev);
* is not configured. * is not configured.
*/ */
rtems_status_code rtems_status_code
rtems_bdbuf_find_pool (int block_size, rtems_bdpool_id *pool); rtems_bdbuf_find_pool (uint32_t block_size, rtems_bdpool_id *pool);
/** /**
* Obtain characteristics of buffer pool with specified number. * Obtain characteristics of buffer pool with specified number.
+4 -4
View File
@@ -47,16 +47,16 @@ typedef struct rtems_disk_device {
char *name; /* Disk device name */ char *name; /* Disk device name */
int uses; /* Use counter. Device couldn't be int uses; /* Use counter. Device couldn't be
removed if it is in use. */ removed if it is in use. */
int start; /* Starting block number (0 for uint32_t start; /* Starting block number (0 for
physical devices, block offset physical devices, block offset
on the related physical device on the related physical device
for logical device) */ for logical device) */
int size; /* Size of physical or logical disk uint32_t size; /* Size of physical or logical disk
in disk blocks */ in disk blocks */
int block_size; /* Size of device block (minimum uint32_t block_size; /* Size of device block (minimum
transfer unit) in bytes transfer unit) in bytes
(must be power of 2) */ (must be power of 2) */
int block_size_log2; /* log2 of block_size */ uint32_t block_size_log2; /* log2 of block_size */
rtems_bdpool_id pool; /* Buffer pool assigned to this rtems_bdpool_id pool; /* Buffer pool assigned to this
device */ device */
rtems_block_device_ioctl ioctl; /* ioctl handler for this block rtems_block_device_ioctl ioctl; /* ioctl handler for this block
+9 -9
View File
@@ -927,7 +927,7 @@ rtems_bdbuf_initialize_pool (rtems_bdbuf_pool_config* config,
rtems_bdbuf_pool* pool; rtems_bdbuf_pool* pool;
rtems_bdbuf_buffer* bd; rtems_bdbuf_buffer* bd;
rtems_status_code sc; rtems_status_code sc;
int b; uint32_t b;
pool = rtems_bdbuf_get_pool (pid); pool = rtems_bdbuf_get_pool (pid);
@@ -1296,7 +1296,7 @@ rtems_bdbuf_get_buffer (rtems_disk_device* pdd,
if (!rtems_chain_is_empty (&pool->modified)) if (!rtems_chain_is_empty (&pool->modified))
{ {
rtems_chain_node* node = rtems_chain_head (&pool->modified); rtems_chain_node* node = rtems_chain_head (&pool->modified);
int write_blocks = 0; uint32_t write_blocks = 0;
node = node->next; node = node->next;
while ((write_blocks < rtems_bdbuf_configuration.max_write_blocks) && while ((write_blocks < rtems_bdbuf_configuration.max_write_blocks) &&
@@ -1527,7 +1527,7 @@ rtems_bdbuf_read (dev_t device,
rtems_disk_device* dd; rtems_disk_device* dd;
rtems_bdbuf_pool* pool; rtems_bdbuf_pool* pool;
rtems_bdbuf_buffer* bd = NULL; rtems_bdbuf_buffer* bd = NULL;
int read_ahead_count; uint32_t read_ahead_count;
rtems_blkdev_request* req; rtems_blkdev_request* req;
/* /*
@@ -1639,8 +1639,8 @@ rtems_bdbuf_read (dev_t device,
* enabled and the pool unlocked. This is a change to the previous version * enabled and the pool unlocked. This is a change to the previous version
* of the bdbuf code. * of the bdbuf code.
*/ */
int result; int result;
int b; uint32_t b;
rtems_bdbuf_unlock_pool (pool); rtems_bdbuf_unlock_pool (pool);
@@ -2042,7 +2042,7 @@ rtems_bdbuf_swapout_modified_processing (rtems_bdpool_id pid,
* assumption. Cannot use the transfer list being empty the sync dev * assumption. Cannot use the transfer list being empty the sync dev
* calls sets the dev to use. * calls sets the dev to use.
*/ */
if (*dev == -1) if (*dev == (dev_t)-1)
*dev = bd->dev; *dev = bd->dev;
if (bd->dev == *dev) if (bd->dev == *dev)
@@ -2235,7 +2235,7 @@ rtems_bdbuf_swapout_pool_processing (rtems_bdpool_id pid,
if (write) if (write)
{ {
int result; int result;
int b; uint32_t b;
/* /*
* Perform the transfer. No pool locks, no preemption, only the disk * Perform the transfer. No pool locks, no preemption, only the disk
@@ -2435,13 +2435,13 @@ rtems_bdbuf_swapout_task (rtems_task_argument arg)
* is not configured. * is not configured.
*/ */
rtems_status_code rtems_status_code
rtems_bdbuf_find_pool (int block_size, rtems_bdpool_id *pool) rtems_bdbuf_find_pool (uint32_t block_size, rtems_bdpool_id *pool)
{ {
rtems_bdbuf_pool* p; rtems_bdbuf_pool* p;
rtems_bdpool_id i; rtems_bdpool_id i;
rtems_bdpool_id curid = -1; rtems_bdpool_id curid = -1;
rtems_boolean found = FALSE; rtems_boolean found = FALSE;
int cursize = INT_MAX; uint32_t cursize = UINT_MAX;
int j; int j;
for (j = block_size; (j != 0) && ((j & 1) == 0); j >>= 1); for (j = block_size; (j != 0) && ((j & 1) == 0); j >>= 1);
+8 -8
View File
@@ -58,8 +58,8 @@ rtems_blkdev_generic_read(
while (count > 0) while (count > 0)
{ {
rtems_bdbuf_buffer *diskbuf; rtems_bdbuf_buffer *diskbuf;
int copy; uint32_t copy;
rtems_status_code rc; rtems_status_code rc;
rc = rtems_bdbuf_read(dev, block, &diskbuf); rc = rtems_bdbuf_read(dev, block, &diskbuf);
if (rc != RTEMS_SUCCESSFUL) if (rc != RTEMS_SUCCESSFUL)
@@ -91,12 +91,12 @@ rtems_blkdev_generic_write(
void * arg) void * arg)
{ {
rtems_libio_rw_args_t *args = arg; rtems_libio_rw_args_t *args = arg;
int block_size_log2; int block_size_log2;
int block_size; uint32_t block_size;
char *buf; char *buf;
unsigned int count; uint32_t count;
unsigned int block; uint32_t block;
unsigned int blkofs; uint32_t blkofs;
dev_t dev; dev_t dev;
rtems_status_code rc; rtems_status_code rc;
rtems_disk_device *dd; rtems_disk_device *dd;
@@ -119,7 +119,7 @@ rtems_blkdev_generic_write(
while (count > 0) while (count > 0)
{ {
rtems_bdbuf_buffer *diskbuf; rtems_bdbuf_buffer *diskbuf;
int copy; uint32_t copy;
if ((blkofs == 0) && (count >= block_size)) if ((blkofs == 0) && (count >= block_size))
rc = rtems_bdbuf_get(dev, block, &diskbuf); rc = rtems_bdbuf_get(dev, block, &diskbuf);
+7 -7
View File
@@ -25,14 +25,14 @@
/* Table of disk devices having the same major number */ /* Table of disk devices having the same major number */
typedef struct rtems_disk_device_table { typedef struct rtems_disk_device_table {
rtems_disk_device **minor; /* minor-indexed disk device table */ rtems_disk_device **minor; /* minor-indexed disk device table */
int size; /* Number of entries in the table */ uint32_t size; /* Number of entries in the table */
} rtems_disk_device_table; } rtems_disk_device_table;
/* Pointer to [major].minor[minor] indexed array of disk devices */ /* Pointer to [major].minor[minor] indexed array of disk devices */
static rtems_disk_device_table *disktab; static rtems_disk_device_table *disktab;
/* Number of allocated entries in disktab table */ /* Number of allocated entries in disktab table */
static int disktab_size; static uint32_t disktab_size;
/* Mutual exclusion semaphore for disk devices table */ /* Mutual exclusion semaphore for disk devices table */
static rtems_id diskdevs_mutex; static rtems_id diskdevs_mutex;
@@ -76,8 +76,8 @@ create_disk_entry(dev_t dev)
if (major >= disktab_size) if (major >= disktab_size)
{ {
rtems_disk_device_table *p; rtems_disk_device_table *p;
int newsize; uint32_t newsize;
int i; uint32_t i;
newsize = disktab_size * 2; newsize = disktab_size * 2;
if (major >= newsize) if (major >= newsize)
newsize = major + 1; newsize = major + 1;
@@ -97,10 +97,10 @@ create_disk_entry(dev_t dev)
if ((disktab[major].minor == NULL) || if ((disktab[major].minor == NULL) ||
(minor >= disktab[major].size)) (minor >= disktab[major].size))
{ {
int newsize; uint32_t newsize;
rtems_disk_device **p; rtems_disk_device **p;
int i; uint32_t i;
int s = disktab[major].size; uint32_t s = disktab[major].size;
if (s == 0) if (s == 0)
newsize = DISKTAB_INITIAL_SIZE; newsize = DISKTAB_INITIAL_SIZE;
+3 -3
View File
@@ -46,7 +46,7 @@ struct ramdisk {
}; };
static struct ramdisk *ramdisk; static struct ramdisk *ramdisk;
static int nramdisks; static uint32_t nramdisks;
#if RTEMS_RAMDISK_TRACE #if RTEMS_RAMDISK_TRACE
/** /**
@@ -103,7 +103,7 @@ ramdisk_read(struct ramdisk *rd, rtems_blkdev_request *req)
sg = req->bufs; sg = req->bufs;
for (i = 0; (remains > 0) && (i < req->bufnum); i++, sg++) for (i = 0; (remains > 0) && (i < req->bufnum); i++, sg++)
{ {
int count = sg->length; uint32_t count = sg->length;
from = ((char *)rd->area + (sg->block * rd->block_size)); from = ((char *)rd->area + (sg->block * rd->block_size));
if (count > remains) if (count > remains)
count = remains; count = remains;
@@ -143,7 +143,7 @@ ramdisk_write(struct ramdisk *rd, rtems_blkdev_request *req)
sg = req->bufs; sg = req->bufs;
for (i = 0; (remains > 0) && (i < req->bufnum); i++, sg++) for (i = 0; (remains > 0) && (i < req->bufnum); i++, sg++)
{ {
int count = sg->length; uint32_t count = sg->length;
to = ((char *)rd->area + (sg->block * rd->block_size)); to = ((char *)rd->area + (sg->block * rd->block_size));
if (count > remains) if (count > remains)
count = remains; count = remains;