RTEMS 6.1-rc4
Loading...
Searching...
No Matches
ramdisk.h
Go to the documentation of this file.
1
7/*
8 * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
9 * Author: Victor V. Vengerov <vvv@oktet.ru>
10 */
11
12#ifndef _RTEMS_RAMDISK_H
13#define _RTEMS_RAMDISK_H
14
15
16#include <rtems.h>
17#include <rtems/blkdev.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
39typedef struct rtems_ramdisk_config {
43 uint32_t block_size;
44
49
54 void *location;
56
64
72
79 void *arg
80);
81
85#define RAMDISK_DRIVER_TABLE_ENTRY \
86 { \
87 ramdisk_initialize, \
88 NULL, NULL, NULL, NULL, NULL \
89 }
90
91#define RAMDISK_DEVICE_BASE_NAME "/dev/rd"
92
103typedef struct ramdisk {
107 uint32_t block_size;
108
113
117 void *area;
118
123
128
132 bool trace;
133
139
140int ramdisk_ioctl(rtems_disk_device *dd, uint32_t req, void *argp);
141
185 void *area_begin,
186 uint32_t media_block_size,
187 rtems_blkdev_bnum media_block_count,
188 bool trace
189);
190
191void ramdisk_free(ramdisk *rd);
192
193static inline void ramdisk_enable_free_at_delete_request(ramdisk *rd)
194{
195 rd->free_at_delete_request = true;
196}
197
210 uint32_t media_block_size,
211 rtems_blkdev_bnum media_block_count,
212 bool trace,
213 const char *disk
214);
215
220#ifdef __cplusplus
221}
222#endif
223
224#endif
Block Device Management.
uint32_t rtems_device_major_number
This integer type represents the major number of devices.
Definition: io.h:103
uint32_t rtems_device_minor_number
This integer type represents the minor number of devices.
Definition: io.h:115
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85
uint32_t rtems_blkdev_bnum
Block device block index type.
Definition: diskdevs.h:45
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.
Definition: ramdisk-register.c:42
rtems_ramdisk_config rtems_ramdisk_configuration[]
External reference to the RAM disk configuration table describing each RAM disk in the system.
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
rtems_device_driver ramdisk_initialize(rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
RAM disk driver initialization entry point.
size_t rtems_ramdisk_configuration_size
External reference the size of the RAM disk configuration table rtems_ramdisk_configuration.
This header file defines the RTEMS Classic API.
RAM disk descriptor.
Definition: ramdisk.h:103
rtems_blkdev_bnum block_num
Number of blocks on this RAM disk.
Definition: ramdisk.h:112
uint32_t block_size
RAM disk block size, the media size.
Definition: ramdisk.h:107
bool initialized
RAM disk is initialized.
Definition: ramdisk.h:122
bool malloced
Indicates if memory is allocated by malloc() for this RAM disk.
Definition: ramdisk.h:127
bool free_at_delete_request
Free the RAM disk at the block device delete request.
Definition: ramdisk.h:137
bool trace
Trace enable.
Definition: ramdisk.h:132
void * area
RAM disk memory area.
Definition: ramdisk.h:117
Description of a disk device (logical and physical disks).
Definition: diskdevs.h:177
RAM disk configuration table entry.
Definition: ramdisk.h:39
void * location
RAM disk location or NULL if RAM disk memory should be allocated dynamically.
Definition: ramdisk.h:54
rtems_blkdev_bnum block_num
Number of blocks on this RAM disk.
Definition: ramdisk.h:48
uint32_t block_size
RAM disk block size.
Definition: ramdisk.h:43