Changeset d0c3b38b in rtems for cpukit/libblock


Ignore:
Timestamp:
May 5, 2009, 12:57:16 PM (11 years ago)
Author:
Thomas Doerfler <Thomas.Doerfler@…>
Branches:
4.10, 4.11, master
Children:
ce7cfe7
Parents:
d8602eb
Message:

Documentation. Changed integer types to match block device types.
Added const qualifier whenever possible. Added
rtems_fsmount_create_mount_point() prototype.

Location:
cpukit/libblock
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libblock/include/rtems/ramdisk.h

    rd8602eb rd0c3b38b  
    11/**
    2  * @file rtems/ramdisk.h
    3  * RAM disk block device implementation
     2 * @file
     3 *
     4 * RAM disk block device.
    45 */
    56
     
    2223#endif
    2324
    24 /* RAM disk configuration table entry */
     25/**
     26 * @defgroup rtems_ramdisk RAM Disk Device
     27 *
     28 * @ingroup rtems_blkdev
     29 *
     30 * @{
     31 */
     32
     33/**
     34 * RAM disk configuration table entry.
     35 */
    2536typedef struct rtems_ramdisk_config {
    26     int   block_size; /* RAM disk block size */
    27     int   block_num;  /* Number of blocks on this RAM disk */
    28     void *location;   /* RAM disk permanent location (out of RTEMS controlled
    29                          memory), or NULL if RAM disk memory should be
    30                          allocated dynamically */
     37  /**
     38   * RAM disk block size (must be a power of two).
     39   */
     40  uint32_t block_size;
     41
     42  /**
     43   * Number of blocks on this RAM disk.
     44   */
     45  rtems_blkdev_bnum block_num;
     46
     47  /**
     48   * RAM disk location or @c NULL if RAM disk memory should be allocated
     49   * dynamically.
     50   */
     51  void *location;
    3152} rtems_ramdisk_config;
    3253
    33 /* If application want to use RAM disk, it should specify configuration of
    34  * available RAM disks.
    35  * The following is definitions for RAM disk configuration table
     54/**
     55 * External reference to the RAM disk configuration table describing each RAM
     56 * disk in the system.
     57 *
     58 * The configuration table is provided by the application.
    3659 */
    37 extern rtems_ramdisk_config rtems_ramdisk_configuration[];
     60extern rtems_ramdisk_config rtems_ramdisk_configuration [];
     61
     62/**
     63 * External reference the size of the RAM disk configuration table
     64 * @ref rtems_ramdisk_configuration.
     65 *
     66 * The configuration table size is provided by the application.
     67 */
    3868extern size_t rtems_ramdisk_configuration_size;
    3969
    40 /* ramdisk_initialize --
    41  *     RAM disk driver initialization entry point.
     70/**
     71 * RAM disk driver initialization entry point.
    4272 */
    43 rtems_device_driver
    44 ramdisk_initialize(
    45     rtems_device_major_number major,
    46     rtems_device_minor_number minor,
    47     void *arg);
     73rtems_device_driver ramdisk_initialize(
     74 rtems_device_major_number major,
     75 rtems_device_minor_number minor,
     76 void *arg
     77);
    4878
     79/**
     80 * RAM disk driver table entry.
     81 */
    4982#define RAMDISK_DRIVER_TABLE_ENTRY \
    50     { ramdisk_initialize, RTEMS_GENERIC_BLOCK_DEVICE_DRIVER_ENTRIES }
     83  { \
     84    .initialization_entry = ramdisk_initialize, \
     85    RTEMS_GENERIC_BLOCK_DEVICE_DRIVER_ENTRIES \
     86  }
     87
     88/** @} */
    5189
    5290#ifdef __cplusplus
  • cpukit/libblock/src/ramdisk.c

    rd8602eb rd0c3b38b  
    1 /* ramdisk.c -- RAM disk block device implementation
    2  *
     1/**
     2 * @file
     3 *
     4 * RAM disk block device.
     5 */
     6
     7/*
    38 * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
    49 * Author: Victor V. Vengerov <vvv@oktet.ru>
     
    1924#include <inttypes.h>
    2025
    21 #include "rtems/blkdev.h"
    22 #include "rtems/diskdevs.h"
    23 #include "rtems/ramdisk.h"
     26#include <rtems/blkdev.h>
     27#include <rtems/diskdevs.h>
     28#include <rtems/ramdisk.h>
    2429
    2530/**
     
    3136#endif
    3237
    33 #define RAMDISK_DEVICE_BASE_NAME "/dev/ramdisk"
     38#define RAMDISK_DEVICE_BASE_NAME "/dev/rd"
    3439
    3540/* Internal RAM disk descriptor */
    3641struct ramdisk {
    37     int           block_size; /* RAM disk block size */
    38     int           block_num;  /* Number of blocks on this RAM disk */
    39     void         *area;       /* RAM disk memory area */
    40     bool          initialized;/* RAM disk is initialized */
    41     bool          malloced;   /* != 0, if memory allocated by malloc for this
    42                                  RAM disk */
    43 #if RTEMS_RAMDISK_TRACE
    44     int           info_level; /* Trace level */
     42  uint32_t block_size; /* RAM disk block size */
     43  rtems_blkdev_bnum block_num; /* Number of blocks on this RAM disk */
     44  void *area; /* RAM disk memory area */
     45  bool initialized; /* RAM disk is initialized */
     46  bool malloced; /* != 0, if memory allocated by malloc for this RAM disk */
     47#if RTEMS_RAMDISK_TRACE
     48  int info_level; /* Trace level */
    4549#endif
    4650};
    4751
    4852static struct ramdisk *ramdisk;
    49 static uint32_t        nramdisks;
     53static uint32_t nramdisks;
    5054
    5155#if RTEMS_RAMDISK_TRACE
     
    243247    {
    244248        dev_t dev = rtems_filesystem_make_dev_t(major, i);
    245         char name[sizeof(RAMDISK_DEVICE_BASE_NAME "0123456789")];
    246         snprintf(name, sizeof(name), RAMDISK_DEVICE_BASE_NAME "%" PRIu32, i);
     249        char name [] = RAMDISK_DEVICE_BASE_NAME "a";
     250        name [sizeof(RAMDISK_DEVICE_BASE_NAME)] += i;
    247251        r->block_size = c->block_size;
    248252        r->block_num = c->block_num;
Note: See TracChangeset for help on using the changeset viewer.