RTEMS  5.0.0
Files | Data Structures

Files

file  ramdisk-config.c
 RAM disk block device implementation.
 
file  ramdisk-driver.c
 RAM disk block device implementation.
 
file  ramdisk-init.c
 RAM disk block device implementation.
 
file  ramdisk-register.c
 RAM disk block device implementation.
 

Data Structures

struct  rtems_ramdisk_config
 RAM disk configuration table entry. More...
 
struct  ramdisk
 RAM disk descriptor. More...
 

Static Configuration

typedef struct rtems_ramdisk_config rtems_ramdisk_config
 RAM disk configuration table entry.
 
rtems_ramdisk_config rtems_ramdisk_configuration []
 External reference to the RAM disk configuration table describing each RAM disk in the system. More...
 
size_t rtems_ramdisk_configuration_size
 External reference the size of the RAM disk configuration table rtems_ramdisk_configuration. More...
 
rtems_device_driver ramdisk_initialize (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
 RAM disk driver initialization entry point.
 
#define RAMDISK_DRIVER_TABLE_ENTRY
 
#define RAMDISK_DEVICE_BASE_NAME   "/dev/rd"
 

Runtime Configuration

typedef struct ramdisk ramdisk
 RAM disk descriptor.
 
int ramdisk_ioctl (rtems_disk_device *dd, uint32_t req, void *argp)
 
ramdiskramdisk_allocate (void *area_begin, uint32_t media_block_size, rtems_blkdev_bnum media_block_count, bool trace)
 Allocates and initializes a RAM disk descriptor. More...
 
void ramdisk_free (ramdisk *rd)
 
rtems_status_code ramdisk_register (uint32_t media_block_size, rtems_blkdev_bnum media_block_count, bool trace, const char *disk)
 Allocates, initializes and registers a RAM disk. More...
 

Detailed Description

Macro Definition Documentation

◆ RAMDISK_DRIVER_TABLE_ENTRY

#define RAMDISK_DRIVER_TABLE_ENTRY
Value:
{ \
ramdisk_initialize, \
NULL, NULL, NULL, NULL, NULL \
}
#define NULL
Requests a GPIO pin group configuration.
Definition: bestcomm_api.h:77

RAM disk driver table entry.

Function Documentation

◆ ramdisk_allocate()

ramdisk* ramdisk_allocate ( void *  area_begin,
uint32_t  media_block_size,
rtems_blkdev_bnum  media_block_count,
bool  trace 
)

Allocates and initializes a RAM disk descriptor.

The block size will be media_block_size. The block count will be media_block_count. The disk storage area begins at area_begin. If area_begin is NULL, the memory will be allocated and zeroed. Sets the trace enable to trace.

Returns
Pointer to allocated and initialized ramdisk structure, or NULL if no memory is available.
Note
Runtime configuration example:
#include <rtems/ramdisk.h>
rtems_status_code create_ramdisk(
const char *device,
uint32_t media_block_size,
rtems_blkdev_bnum media_block_count
)
{
ramdisk *rd;
rd = ramdisk_allocate(NULL, media_block_size, media_block_count, false);
if (rd != NULL) {
device,
media_block_size,
media_block_count,
ramdisk_ioctl,
rd
);
} else {
}
return sc;
}

◆ ramdisk_register()

rtems_status_code ramdisk_register ( uint32_t  media_block_size,
rtems_blkdev_bnum  media_block_count,
bool  trace,
const char *  disk 
)

Allocates, initializes and registers a RAM disk.

The block size will be media_block_size. The block count will be media_block_count. The disk storage will be allocated. Sets the trace enable to trace. Registers a device node with disk name path disk. The registered device number will be returned in dev.

Return values
RTEMS_SUCCESSFULSuccessful operation.
RTEMS_UNSATISFIEDSomething is wrong.

Variable Documentation

◆ rtems_ramdisk_configuration

rtems_ramdisk_config rtems_ramdisk_configuration[]

External reference to the RAM disk configuration table describing each RAM disk in the system.

The configuration table is provided by the application.

◆ rtems_ramdisk_configuration_size

size_t rtems_ramdisk_configuration_size

External reference the size of the RAM disk configuration table rtems_ramdisk_configuration.

The configuration table size is provided by the application.