summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2004-01-09 15:40:54 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2004-01-09 15:40:54 +0000
commitc01d95b7751a42434b7fa8cd65d7a75f3f44e0e2 (patch)
treefe2e270360c8c8f938aaf8e855ae77e385b02387 /cpukit
parent2004-01-08 Ralf Corsepius <corsepiu@faw.uni-ulm.de> (diff)
downloadrtems-c01d95b7751a42434b7fa8cd65d7a75f3f44e0e2.tar.bz2
2004-01-08 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* include/rtems/blkdev.h, include/rtems/ide_part_table.h, src/bdbuf.c, src/ide_part_table.c, src/ramdisk.c: Switch to using c99 fixed size types instead of RTEMS-types.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/libblock/ChangeLog6
-rw-r--r--cpukit/libblock/include/rtems/blkdev.h8
-rw-r--r--cpukit/libblock/include/rtems/ide_part_table.h24
-rw-r--r--cpukit/libblock/src/bdbuf.c2
-rw-r--r--cpukit/libblock/src/ide_part_table.c26
-rw-r--r--cpukit/libblock/src/ramdisk.c8
6 files changed, 40 insertions, 34 deletions
diff --git a/cpukit/libblock/ChangeLog b/cpukit/libblock/ChangeLog
index 35fb88d277..fce3fac48e 100644
--- a/cpukit/libblock/ChangeLog
+++ b/cpukit/libblock/ChangeLog
@@ -1,5 +1,11 @@
2004-01-08 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+ * include/rtems/blkdev.h, include/rtems/ide_part_table.h,
+ src/bdbuf.c, src/ide_part_table.c, src/ramdisk.c:
+ Switch to using c99 fixed size types instead of RTEMS-types.
+
+2004-01-08 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
* Makefile.am: Build libblock$(LIB_VARIANT).a instead of
$(ARCH)/libblock.a.
diff --git a/cpukit/libblock/include/rtems/blkdev.h b/cpukit/libblock/include/rtems/blkdev.h
index 5f3f6159ea..a873418196 100644
--- a/cpukit/libblock/include/rtems/blkdev.h
+++ b/cpukit/libblock/include/rtems/blkdev.h
@@ -27,7 +27,7 @@ extern "C" {
/* Block device block number datatype */
-typedef rtems_unsigned32 blkdev_bnum;
+typedef uint32_t blkdev_bnum;
/* Block device request type */
typedef enum blkdev_request_op {
@@ -51,7 +51,7 @@ typedef void (* blkdev_request_cb)(void *arg,
* Block device scatter/gather buffer structure
*/
typedef struct blkdev_sg_buffer {
- rtems_unsigned32 length; /* Buffer length */
+ uint32_t length; /* Buffer length */
void *buffer; /* Buffer pointer */
} blkdev_sg_buffer;
@@ -67,8 +67,8 @@ typedef struct blkdev_request {
* contains error code
*/
blkdev_bnum start; /* Start block number */
- rtems_unsigned32 count; /* Number of blocks to be exchanged */
- rtems_unsigned32 bufnum; /* Number of buffers provided */
+ uint32_t count; /* Number of blocks to be exchanged */
+ uint32_t bufnum; /* Number of buffers provided */
blkdev_sg_buffer bufs[0];/* List of scatter/gather buffers */
} blkdev_request;
diff --git a/cpukit/libblock/include/rtems/ide_part_table.h b/cpukit/libblock/include/rtems/ide_part_table.h
index 12933e465a..6c3af11639 100644
--- a/cpukit/libblock/include/rtems/ide_part_table.h
+++ b/cpukit/libblock/include/rtems/ide_part_table.h
@@ -79,8 +79,8 @@
*/
typedef struct sector_data_s
{
- unsigned32 sector_num; /* sector number on the device */
- unsigned8 data[0]; /* raw sector data */
+ uint32_t sector_num; /* sector number on the device */
+ uint8_t data[0]; /* raw sector data */
} sector_data_t;
@@ -115,12 +115,12 @@ struct disk_desc_s;
* contains all neccessary information about partition
*/
typedef struct part_desc_s {
- unsigned8 bootable; /* is the partition active */
- unsigned8 sys_type; /* type of partition */
- unsigned8 log_id; /* logical number of partition */
- unsigned32 start; /* first partition sector, in absolute numeration */
- unsigned32 size; /* size in sectors */
- unsigned32 end; /* last partition sector, end = start + size - 1 */
+ uint8_t bootable; /* is the partition active */
+ uint8_t sys_type; /* type of partition */
+ uint8_t log_id; /* logical number of partition */
+ uint32_t start; /* first partition sector, in absolute numeration */
+ uint32_t size; /* size in sectors */
+ uint32_t end; /* last partition sector, end = start + size - 1 */
struct disk_desc_s *disk_desc; /* descriptor of disk, partition contains in */
struct part_desc_s *ext_part; /* extended partition containing this one */
@@ -134,11 +134,11 @@ typedef struct disk_desc_s {
dev_t dev; /* device number */
/* device name in /dev filesystem */
- unsigned8 dev_name[RTEMS_IDE_PARTITION_DEV_NAME_LENGTH_MAX];
+ uint8_t dev_name[RTEMS_IDE_PARTITION_DEV_NAME_LENGTH_MAX];
- unsigned32 sector_size; /* size of sector */
- unsigned32 sector_bits; /* the base-2 logarithm of sector_size */
- unsigned32 lba_size; /* total amount of sectors in lba address mode */
+ uint32_t sector_size; /* size of sector */
+ uint32_t sector_bits; /* the base-2 logarithm of sector_size */
+ uint32_t lba_size; /* total amount of sectors in lba address mode */
int last_log_id; /* used for logical disks enumerating */
/* primary partition descriptors */
diff --git a/cpukit/libblock/src/bdbuf.c b/cpukit/libblock/src/bdbuf.c
index 58c0c92055..739942e628 100644
--- a/cpukit/libblock/src/bdbuf.c
+++ b/cpukit/libblock/src/bdbuf.c
@@ -23,7 +23,7 @@
#include "rtems/bdbuf.h"
/* Fatal errors: */
-#define BLKDEV_FATAL_ERROR(n) (((unsigned32)'B' << 24) | ((unsigned32)(n) & (unsigned32)0x00FFFFFF))
+#define BLKDEV_FATAL_ERROR(n) (((uint32_t)'B' << 24) | ((uint32_t)(n) & (uint32_t)0x00FFFFFF))
#define BLKDEV_FATAL_BDBUF_CONSISTENCY BLKDEV_FATAL_ERROR(1)
#define BLKDEV_FATAL_BDBUF_SWAPOUT BLKDEV_FATAL_ERROR(2)
diff --git a/cpukit/libblock/src/ide_part_table.c b/cpukit/libblock/src/ide_part_table.c
index 2a9d98c6a4..5a28f0d9a4 100644
--- a/cpukit/libblock/src/ide_part_table.c
+++ b/cpukit/libblock/src/ide_part_table.c
@@ -46,7 +46,7 @@
* and does not support devices with sector size other than 512 bytes
*/
static rtems_status_code
-get_sector(dev_t dev, unsigned32 sector_num, sector_data_t **sector)
+get_sector(dev_t dev, uint32_t sector_num, sector_data_t **sector)
{
sector_data_t *s;
bdbuf_buffer *buf;
@@ -94,7 +94,7 @@ get_sector(dev_t dev, unsigned32 sector_num, sector_data_t **sector)
static rtems_boolean
msdos_signature_check (sector_data_t *sector)
{
- unsigned8 *p = sector->data + RTEMS_IDE_PARTITION_MSDOS_SIGNATURE_OFFSET;
+ uint8_t *p = sector->data + RTEMS_IDE_PARTITION_MSDOS_SIGNATURE_OFFSET;
return ((p[0] == RTEMS_IDE_PARTITION_MSDOS_SIGNATURE_DATA1) &&
(p[1] == RTEMS_IDE_PARTITION_MSDOS_SIGNATURE_DATA2));
@@ -112,7 +112,7 @@ msdos_signature_check (sector_data_t *sector)
* TRUE if partition type is extended, FALSE otherwise
*/
static rtems_boolean
-is_extended(unsigned8 type)
+is_extended(uint8_t type)
{
return ((type == EXTENDED_PARTITION) || (type == LINUX_EXTENDED));
}
@@ -128,9 +128,9 @@ is_extended(unsigned8 type)
* TRUE if partition type is extended, FALSE otherwise
*/
static rtems_boolean
-is_fat_partition(unsigned8 type)
+is_fat_partition(uint8_t type)
{
- static const unsigned8 fat_part_types[] = {
+ static const uint8_t fat_part_types[] = {
DOS_FAT12_PARTITION,DOS_FAT16_PARTITION,
DOS_P32MB_PARTITION,
FAT32_PARTITION ,FAT32_LBA_PARTITION,
@@ -156,10 +156,10 @@ is_fat_partition(unsigned8 type)
* RTEMS_INTERNAL_ERROR, if other error occurs.
*/
static rtems_status_code
-data_to_part_desc(unsigned8 *data, part_desc_t **new_part_desc)
+data_to_part_desc(uint8_t *data, part_desc_t **new_part_desc)
{
part_desc_t *part_desc;
- unsigned32 temp;
+ uint32_t temp;
if (new_part_desc == NULL)
{
@@ -179,10 +179,10 @@ data_to_part_desc(unsigned8 *data, part_desc_t **new_part_desc)
/* read the offset start position and partition size in sectors */
/* due to incorrect data alignment one have to align data first */
- memcpy(&temp, data + RTEMS_IDE_PARTITION_START_OFFSET, sizeof(unsigned32));
+ memcpy(&temp, data + RTEMS_IDE_PARTITION_START_OFFSET, sizeof(uint32_t));
part_desc->start = LE_TO_CPU_U32(temp);
- memcpy(&temp, data + RTEMS_IDE_PARTITION_SIZE_OFFSET, sizeof(unsigned32));
+ memcpy(&temp, data + RTEMS_IDE_PARTITION_SIZE_OFFSET, sizeof(uint32_t));
part_desc->size = LE_TO_CPU_U32(temp);
/*
@@ -219,13 +219,13 @@ data_to_part_desc(unsigned8 *data, part_desc_t **new_part_desc)
* RTEMS_INTERNAL_ERROR if other error occurs.
*/
static rtems_status_code
-read_extended_partition(unsigned32 start, part_desc_t *ext_part)
+read_extended_partition(uint32_t start, part_desc_t *ext_part)
{
int i;
dev_t dev;
sector_data_t *sector;
- unsigned32 here;
- unsigned8 *data;
+ uint32_t here;
+ uint8_t *data;
part_desc_t *new_part_desc;
rtems_status_code rc;
@@ -319,7 +319,7 @@ read_mbr(disk_desc_t *disk_desc)
int part_num;
sector_data_t *sector;
part_desc_t *part_desc;
- unsigned8 *data;
+ uint8_t *data;
rtems_status_code rc;
dev_t dev = disk_desc->dev;
diff --git a/cpukit/libblock/src/ramdisk.c b/cpukit/libblock/src/ramdisk.c
index 27bc01e302..be78a8ee31 100644
--- a/cpukit/libblock/src/ramdisk.c
+++ b/cpukit/libblock/src/ramdisk.c
@@ -51,9 +51,9 @@ static int
ramdisk_read(struct ramdisk *rd, blkdev_request *req)
{
char *from;
- rtems_unsigned32 i;
+ uint32_t i;
blkdev_sg_buffer *sg;
- rtems_unsigned32 remains;
+ uint32_t remains;
from = (char *)rd->area + (req->start * rd->block_size);
remains = rd->block_size * req->count;
@@ -86,9 +86,9 @@ static int
ramdisk_write(struct ramdisk *rd, blkdev_request *req)
{
char *to;
- rtems_unsigned32 i;
+ uint32_t i;
blkdev_sg_buffer *sg;
- rtems_unsigned32 remains;
+ uint32_t remains;
to = (char *)rd->area + (req->start * rd->block_size);
remains = rd->block_size * req->count;