Remove stray white spaces.

This commit is contained in:
Ralf Corsepius committed 2004-04-17 08:15:17 +00:00
1 parent 714f06c7fa
commit 8b961495bb
9 files changed
+103 -103

No files matched your search

+13 -13
View File
@@ -31,13 +31,13 @@ extern "C" {
* Descriptors organized in AVL-tree to speedup buffer lookup.
* dev and block fields are search key in AVL-tree.
* Modified buffers, free buffers and used buffers linked in 'mod', 'free' and
* 'lru' chains appropriately.
* 'lru' chains appropriately.
*/
typedef struct bdbuf_buffer {
Chain_Node link; /* Link in the lru, mod or free chains */
struct bdbuf_avl_node {
struct bdbuf_avl_node {
signed char cache; /* Cache */
struct bdbuf_buffer* left; /* Left Child */
@@ -86,9 +86,9 @@ extern rtems_bdbuf_config rtems_bdbuf_configuration[];
extern int rtems_bdbuf_configuration_size;
/* rtems_bdbuf_init --
* Prepare buffering layer to work - initialize buffer descritors
* Prepare buffering layer to work - initialize buffer descritors
* and (if it is neccessary) buffers. Buffers will be allocated accoriding
* to the configuration table, each entry describes kind of block and
* to the configuration table, each entry describes kind of block and
* amount requested. After initialization all blocks is placed into
* free elements lists.
*
@@ -107,11 +107,11 @@ rtems_bdbuf_init(rtems_bdbuf_config *conf_table, int size);
/* rtems_bdbuf_get --
* Obtain block buffer. If specified block already cached (i.e. there's
* block in the _modified_, or _recently_used_), return address
* of appropriate buffer descriptor and increment reference counter to 1.
* If block is not cached, allocate new buffer and return it. Data
* shouldn't be read to the buffer from media; buffer may contains
* arbitrary data. This primitive may be blocked if there are no free
* buffer descriptors available and there are no unused non-modified
* of appropriate buffer descriptor and increment reference counter to 1.
* If block is not cached, allocate new buffer and return it. Data
* shouldn't be read to the buffer from media; buffer may contains
* arbitrary data. This primitive may be blocked if there are no free
* buffer descriptors available and there are no unused non-modified
* (or synchronized with media) buffers available.
*
* PARAMETERS:
@@ -163,7 +163,7 @@ rtems_bdbuf_read(dev_t device, blkdev_bnum block, bdbuf_buffer **bdb_ptr);
*
* PARAMETERS:
* bd_buf - pointer to the bdbuf_buffer structure previously obtained using
* get/read primitive.
* get/read primitive.
*
* RETURNS:
* RTEMS status code (RTEMS_SUCCESSFUL if operation completed successfully
@@ -177,7 +177,7 @@ rtems_bdbuf_release(bdbuf_buffer *bd_buf);
/* rtems_bdbuf_release_modified --
* Release buffer allocated before, assuming that it is _modified_ by
* it's owner. This primitive decrease usage counter for buffer, mark
* it's owner. This primitive decrease usage counter for buffer, mark
* buffer descriptor as modified. If usage counter is 0, insert it at
* end of mod chain and release flush_sema semaphore to activate the
* flush task.
@@ -242,7 +242,7 @@ rtems_bdbuf_syncdev(dev_t dev);
*
* RETURNS:
* RTEMS status code: RTEMS_SUCCESSFUL if operation completed successfully,
* RTEMS_INVALID_SIZE if specified block size is invalid (not a power
* RTEMS_INVALID_SIZE if specified block size is invalid (not a power
* of 2), RTEMS_NOT_DEFINED if buffer pool for this or greater block size
* is not configured.
*/
@@ -256,7 +256,7 @@ rtems_bdbuf_find_pool(int block_size, rtems_bdpool_id *pool);
* pool - buffer pool number
* block_size - block size for which buffer pool is configured returned
* there
* blocks - number of buffers in buffer pool returned there
* blocks - number of buffers in buffer pool returned there
*
* RETURNS:
* RTEMS status code: RTEMS_SUCCESSFUL if operation completed successfully,
+10 -10
View File
@@ -1,4 +1,4 @@
/*
/*
* blkdev.h - block device driver interface definitions
*
* Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
@@ -18,7 +18,7 @@ extern "C" {
#endif
/* Interface with device drivers
* Block device looks, initialized and behaves like traditional RTEMS device
* Block device looks, initialized and behaves like traditional RTEMS device
* driver. Heart of the block device driver is in BIOREQUEST ioctl. This call
* puts I/O request to the block device queue, in priority order, for
* asynchronous processing. When driver executes request, req_done
@@ -43,7 +43,7 @@ typedef enum blkdev_request_op {
* errno - errno value to be passed to the user when
* status != RTEMS_SUCCESSFUL
*/
typedef void (* blkdev_request_cb)(void *arg,
typedef void (* blkdev_request_cb)(void *arg,
rtems_status_code status,
int error);
@@ -56,19 +56,19 @@ typedef struct blkdev_sg_buffer {
} blkdev_sg_buffer;
/* blkdev_request (Block Device Request) structure is
* used to read/write a number of blocks from/to device.
* used to read/write a number of blocks from/to device.
*/
typedef struct blkdev_request {
blkdev_request_op req; /* Block device operation (read or write) */
blkdev_request_cb req_done; /* Callback function */
void *done_arg; /* Argument to be passed to callback function*/
rtems_status_code status; /* Last I/O operation completion status */
int error; /* If status != RTEMS_SUCCESSFUL, this field
int error; /* If status != RTEMS_SUCCESSFUL, this field
* contains error code
*/
blkdev_bnum start; /* Start block number */
uint32_t count; /* Number of blocks to be exchanged */
uint32_t bufnum; /* Number of buffers provided */
uint32_t bufnum; /* Number of buffers provided */
blkdev_sg_buffer bufs[0];/* List of scatter/gather buffers */
} blkdev_request;
@@ -80,8 +80,8 @@ typedef struct blkdev_request {
#define BLKIO_SYNCDEV _IO('B', 4)
/* Device driver interface conventions suppose that driver may
* contain initialize/open/close/read/write/ioctl entry points. These
* primitives (except initialize) can be implemented in generic fashion,
* contain initialize/open/close/read/write/ioctl entry points. These
* primitives (except initialize) can be implemented in generic fashion,
* based upon supplied block device driver ioctl handler. Every block
* device driver should provide initialize entry point, which is register
* all block devices and appropriate ioctl handlers.
@@ -104,8 +104,8 @@ rtems_blkdev_generic_read(
);
/* blkdev_generic_write --
* Generic block device driver write primitive. Implemented using block
* device buffer management primitives.
* Generic block device driver write primitive. Implemented using block
* device buffer management primitives.
*/
rtems_device_driver
rtems_blkdev_generic_write(
+7 -7
View File
@@ -1,4 +1,4 @@
/*
/*
* logdisk.h - Physical and logical block devices (disks) support
*
* Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
@@ -48,7 +48,7 @@ typedef struct disk_device {
int size; /* Size of physical or logical disk
in disk blocks */
int block_size; /* Size of device block (minimum
transfer unit) in bytes
transfer unit) in bytes
(must be power of 2) */
int block_size_log2; /* log2 of block_size */
rtems_bdpool_id pool; /* Buffer pool assigned to this
@@ -91,13 +91,13 @@ rtems_disk_create_phys(dev_t dev, int block_size, int disk_size,
* (DOS-like partition table, BSD disk label, etc). This function usually
* invoked from application when application-specific splitting are in use,
* or from generic code which handle different logical disk organizations.
* This primitive will register device in rtems (invoke
* This primitive will register device in rtems (invoke
* rtems_io_register_name).
*
* PARAMETERS:
* dev - logical device identifier (major, minor numbers)
* phys - physical device (block device which holds this logical disk)
* identifier
* identifier
* start - starting block number on the physical device
* size - logical disk size in blocks
* name - logical disk name
@@ -105,7 +105,7 @@ rtems_disk_create_phys(dev_t dev, int block_size, int disk_size,
* RETURNS:
* RTEMS_SUCCESSFUL if logical device successfully added, or error code
* if error occured (device already registered, no physical device
* exists, logical disk is out of physical disk boundaries, no memory
* exists, logical disk is out of physical disk boundaries, no memory
* available).
*/
rtems_status_code
@@ -180,7 +180,7 @@ rtems_disk_next(dev_t dev);
* none
*
* RETURNS:
* RTEMS_SUCCESSFUL if library initialized, or error code if error
* RTEMS_SUCCESSFUL if library initialized, or error code if error
* occured.
*/
rtems_status_code
@@ -193,7 +193,7 @@ rtems_disk_io_initialize(void);
* none
*
* RETURNS:
* RTEMS_SUCCESSFUL if all resources released, or error code if error
* RTEMS_SUCCESSFUL if all resources released, or error code if error
* occured.
*/
rtems_status_code
@@ -77,7 +77,7 @@
* sector_data_t --
* corresponds to the sector on the device
*/
typedef struct sector_data_s
typedef struct sector_data_s
{
uint32_t sector_num; /* sector number on the device */
uint8_t data[0]; /* raw sector data */
File diff suppressed because it is too large. Load diff
+5 -5
View File
@@ -1,5 +1,5 @@
/*
* blkdev.h - block device driver generic support
/*
* blkdev.h - block device driver generic support
*
* Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
* Author: Victor V. Vengerov <vvv@oktet.ru>
@@ -82,7 +82,7 @@ rtems_blkdev_generic_read(
/* rtems_blkdev_generic_write --
* Generic block device write primitive. Implemented using block device
* buffer management primitives.
* buffer management primitives.
*/
rtems_device_driver
rtems_blkdev_generic_write(
@@ -233,13 +233,13 @@ rtems_blkdev_generic_ioctl(
{
blkdev_request *req = args->buffer;
req->start += dd->start;
args->ioctl_return = dd->ioctl(dd->phys_dev->dev, args->command,
args->ioctl_return = dd->ioctl(dd->phys_dev->dev, args->command,
req);
break;
}
default:
args->ioctl_return = dd->ioctl(dd->phys_dev->dev, args->command,
args->ioctl_return = dd->ioctl(dd->phys_dev->dev, args->command,
args->buffer);
break;
}
+10 -10
View File
@@ -1,4 +1,4 @@
/*
/*
* diskdevs.c - Physical and logical block devices (disks) support
*
* Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
@@ -297,13 +297,13 @@ rtems_disk_create_phys(dev_t dev, int block_size, int disk_size,
* (DOS-like partition table, BSD disk label, etc). This function usually
* invoked from application when application-specific splitting are in use,
* or from generic code which handle different logical disk organizations.
* This primitive will register device in rtems (invoke
* This primitive will register device in rtems (invoke
* rtems_io_register_name).
*
* PARAMETERS:
* dev - logical device identifier (major, minor numbers)
* phys - physical device (block device which holds this logical disk)
* identifier
* identifier
* start - starting block number on the physical device
* size - logical disk size in blocks
* name - logical disk name
@@ -311,7 +311,7 @@ rtems_disk_create_phys(dev_t dev, int block_size, int disk_size,
* RETURNS:
* RTEMS_SUCCESSFUL if logical device successfully added, or error code
* if error occured (device already registered, no physical device
* exists, logical disk is out of physical disk boundaries, no memory
* exists, logical disk is out of physical disk boundaries, no memory
* available).
*/
rtems_status_code
@@ -458,7 +458,7 @@ rtems_disk_lookup(dev_t dev)
if (diskdevs_protected)
{
rtems_interrupt_enable(level);
rc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT,
rc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT,
RTEMS_NO_TIMEOUT);
if (rc != RTEMS_SUCCESSFUL)
return NULL;
@@ -524,7 +524,7 @@ rtems_disk_next(dev_t dev)
return NULL;
dtab = disktab + major;
while (TRUE)
while (TRUE)
{
if ((dtab == NULL) || (minor > dtab->size))
{
@@ -550,7 +550,7 @@ rtems_disk_next(dev_t dev)
* none
*
* RETURNS:
* RTEMS_SUCCESSFUL if library initialized, or error code if error
* RTEMS_SUCCESSFUL if library initialized, or error code if error
* occured.
*/
rtems_status_code
@@ -569,7 +569,7 @@ rtems_disk_io_initialize(void)
diskdevs_protected = FALSE;
rc = rtems_semaphore_create(
rtems_build_name('D', 'D', 'E', 'V'), 1,
RTEMS_FIFO | RTEMS_BINARY_SEMAPHORE | RTEMS_NO_INHERIT_PRIORITY |
RTEMS_FIFO | RTEMS_BINARY_SEMAPHORE | RTEMS_NO_INHERIT_PRIORITY |
RTEMS_NO_PRIORITY_CEILING | RTEMS_LOCAL, 0, &diskdevs_mutex);
if (rc != RTEMS_SUCCESSFUL)
@@ -599,7 +599,7 @@ rtems_disk_io_initialize(void)
* none
*
* RETURNS:
* RTEMS_SUCCESSFUL if all resources released, or error code if error
* RTEMS_SUCCESSFUL if all resources released, or error code if error
* occured.
*/
rtems_status_code
@@ -609,7 +609,7 @@ rtems_disk_io_done(void)
rtems_device_minor_number min;
rtems_status_code rc;
/* Free data structures */
/* Free data structures */
for (maj = 0; maj < disktab_size; maj++)
{
struct disk_device_table *dtab = disktab + maj;
+15 -15
View File
@@ -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, uint32_t 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;
@@ -92,7 +92,7 @@ get_sector(dev_t dev, uint32_t sector_num, sector_data_t **sector)
* TRUE if sector has msdos signature, FALSE otherwise
*/
static rtems_boolean
msdos_signature_check (sector_data_t *sector)
msdos_signature_check (sector_data_t *sector)
{
uint8_t *p = sector->data + RTEMS_IDE_PARTITION_MSDOS_SIGNATURE_OFFSET;
@@ -112,7 +112,7 @@ msdos_signature_check (sector_data_t *sector)
* TRUE if partition type is extended, FALSE otherwise
*/
static rtems_boolean
is_extended(uint8_t type)
is_extended(uint8_t type)
{
return ((type == EXTENDED_PARTITION) || (type == LINUX_EXTENDED));
}
@@ -128,7 +128,7 @@ is_extended(uint8_t type)
* TRUE if partition type is extended, FALSE otherwise
*/
static rtems_boolean
is_fat_partition(uint8_t type)
is_fat_partition(uint8_t type)
{
static const uint8_t fat_part_types[] = {
DOS_FAT12_PARTITION,DOS_FAT16_PARTITION,
@@ -186,7 +186,7 @@ data_to_part_desc(uint8_t *data, part_desc_t **new_part_desc)
part_desc->size = LE_TO_CPU_U32(temp);
/*
* use partitions that are
* use partitions that are
* - extended
* or
* - FAT type and non-zero
@@ -195,7 +195,7 @@ data_to_part_desc(uint8_t *data, part_desc_t **new_part_desc)
((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) {
*new_part_desc = part_desc;
}
else {
else {
/* empty partition */
free(part_desc);
}
@@ -209,7 +209,7 @@ data_to_part_desc(uint8_t *data, part_desc_t **new_part_desc)
* and constructs the partition table tree
*
* PARAMETERS:
* start - start sector of primary extended partition, used for
* start - start sector of primary extended partition, used for
* calculation of absolute partition sector address
* ext_part - description of extended partition to process
*
@@ -219,7 +219,7 @@ data_to_part_desc(uint8_t *data, part_desc_t **new_part_desc)
* RTEMS_INTERNAL_ERROR if other error occurs.
*/
static rtems_status_code
read_extended_partition(uint32_t start, part_desc_t *ext_part)
read_extended_partition(uint32_t start, part_desc_t *ext_part)
{
int i;
dev_t dev;
@@ -256,7 +256,7 @@ read_extended_partition(uint32_t start, part_desc_t *ext_part)
data = sector->data + RTEMS_IDE_PARTITION_TABLE_OFFSET;
for (i = 0; i < RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER; i++)
for (i = 0; i < RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER; i++)
{
/* if data_to_part_desc fails skip this partition
* and parse the next one
@@ -278,13 +278,13 @@ read_extended_partition(uint32_t start, part_desc_t *ext_part)
new_part_desc->ext_part = ext_part;
new_part_desc->disk_desc = ext_part->disk_desc;
if (is_extended(new_part_desc->sys_type))
if (is_extended(new_part_desc->sys_type))
{
new_part_desc->log_id = EMPTY_PARTITION;
new_part_desc->start += start;
read_extended_partition(start, new_part_desc);
read_extended_partition(start, new_part_desc);
}
else
else
{
disk_desc_t *disk_desc = new_part_desc->disk_desc;
disk_desc->partitions[disk_desc->last_log_id] = new_part_desc;
@@ -314,7 +314,7 @@ read_extended_partition(uint32_t start, part_desc_t *ext_part)
* RTEMS_INTERNAL_ERROR otherwise
*/
static rtems_status_code
read_mbr(disk_desc_t *disk_desc)
read_mbr(disk_desc_t *disk_desc)
{
int part_num;
sector_data_t *sector;
@@ -351,13 +351,13 @@ read_mbr(disk_desc_t *disk_desc)
return rc;
}
if (part_desc != NULL)
if (part_desc != NULL)
{
part_desc->log_id = part_num + 1;
part_desc->disk_desc = disk_desc;
part_desc->end = part_desc->start + part_desc->size - 1;
disk_desc->partitions[part_num] = part_desc;
}
}
else
{
disk_desc->partitions[part_num] = NULL;
+5 -5
View File
@@ -29,7 +29,7 @@ struct ramdisk {
int block_num; /* Number of blocks on this RAM disk */
void *area; /* RAM disk memory area */
rtems_boolean initialized;/* RAM disk is initialized */
rtems_boolean malloced; /* != 0, if memory allocated by malloc for this
rtems_boolean malloced; /* != 0, if memory allocated by malloc for this
RAM disk */
};
@@ -40,7 +40,7 @@ static int nramdisks;
* RAM disk READ request handler. This primitive copies data from RAM
* disk to supplied buffer and invoke the callout function to inform
* upper layer that reading is completed.
*
*
* PARAMETERS:
* req - pointer to the READ block device request info
*
@@ -75,7 +75,7 @@ ramdisk_read(struct ramdisk *rd, blkdev_request *req)
* RAM disk WRITE request handler. This primitive copies data from
* supplied buffer to RAM disk and invoke the callout function to inform
* upper layer that writing is completed.
*
*
* PARAMETERS:
* req - pointer to the WRITE block device request info
*
@@ -159,7 +159,7 @@ ramdisk_ioctl(dev_t dev, int req, void *argp)
}
/* ramdisk_initialize --
* RAM disk device driver initialization. Run through RAM disk
* RAM disk device driver initialization. Run through RAM disk
* configuration information and configure appropriate RAM disks.
*
* PARAMETERS:
@@ -185,7 +185,7 @@ ramdisk_initialize(
if (rc != RTEMS_SUCCESSFUL)
return rc;
r = ramdisk = calloc(rtems_ramdisk_configuration_size,
r = ramdisk = calloc(rtems_ramdisk_configuration_size,
sizeof(struct ramdisk));
for (i = 0; i < rtems_ramdisk_configuration_size; i++, c++, r++)