RTEMS 6.1-rc5
Loading...
Searching...
No Matches
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.
 
size_t rtems_ramdisk_configuration_size
 External reference the size of the RAM disk configuration table rtems_ramdisk_configuration.
 
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.
 
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.
 

Detailed Description

Macro Definition Documentation

◆ RAMDISK_DRIVER_TABLE_ENTRY

#define RAMDISK_DRIVER_TABLE_ENTRY
Value:
{ \
NULL, NULL, NULL, NULL, NULL \
}
rtems_device_driver ramdisk_initialize(rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
RAM disk driver initialization entry point.

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;
}
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85
@ RTEMS_UNSATISFIED
This status code indicates that the request was not satisfied.
Definition: status.h:158
rtems_status_code rtems_blkdev_create(const char *device, uint32_t media_block_size, rtems_blkdev_bnum media_block_count, rtems_block_device_ioctl handler, void *driver_data)
Creates a block device.
Definition: blkdev-imfs.c:293
uint32_t rtems_blkdev_bnum
Block device block index type.
Definition: diskdevs.h:45
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.
Definition: ramdisk-init.c:45
RAM Disk Block Device API.
RAM disk descriptor.
Definition: ramdisk.h:103

◆ 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[]
extern

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
extern

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

The configuration table size is provided by the application.