RTEMS  5.0.0
nvdisk.h
Go to the documentation of this file.
1 
7 /*
8  * Copyright (C) 2007 Chris Johns
9  *
10  * The license and distribution terms for this file may be
11  * found in the file LICENSE in this distribution or at
12  * http://www.rtems.org/license/LICENSE.
13  */
14 
25 #if !defined (_RTEMS_NVDISK_H_)
26 #define _RTEMS_NVDISK_H_
27 
28 #include <stdint.h>
29 #include <sys/ioctl.h>
30 
31 #include <rtems.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif /* __cplusplus */
36 
40 #define RTEMS_NVDISK_DEVICE_BASE_NAME "/dev/nvd"
41 
61 #define RTEMS_NVDISK_IOCTL_ERASE_DISK _IO('B', 128)
62 #define RTEMS_NVDISK_IOCTL_MONITORING _IO('B', 129)
63 #define RTEMS_NVDISK_IOCTL_INFO_LEVEL _IO('B', 130)
64 #define RTEMS_NVDISK_IOCTL_PRINT_STATUS _IO('B', 131)
65 
71 {
72  uint32_t block_size;
73  uint32_t block_count;
74  uint32_t page_count;
75  uint32_t pages_available;
76  uint32_t pages_used;
77  uint32_t info_level;
79 
83 #define RTEMS_NVDISK_KBYTES(_k) ((_k) * 1024)
84 
94 {
108  int (*read) (uint32_t device, uint32_t flags, void* base,
109  uint32_t offset, void* buffer, size_t size);
110 
124  int (*write) (uint32_t device, uint32_t flags, void* base,
125  uint32_t offset, const void* buffer, size_t size);
126 
140  int (*verify) (uint32_t device, uint32_t flags, void* base,
141  uint32_t offset, const void* buffer, size_t size);
142 
144 
155 {
156  uint32_t flags;
157  void* base;
158  uint32_t size;
161 
166 typedef struct rtems_nvdisk_config
167 {
168  uint32_t block_size;
169  uint32_t device_count;
171  uint32_t flags;
173  uint32_t info_level;
175 
176 /*
177  * Driver flags.
178  */
179 
185 #define RTEMS_NVDISK_CHECK_PAGES (1 << 0)
186 
199 rtems_nvdisk_initialize (rtems_device_major_number major,
200  rtems_device_minor_number minor,
201  void* arg);
202 
208 
213 extern uint32_t rtems_nvdisk_configuration_size;
214 
215 #ifdef __cplusplus
216 }
217 #endif /* __cplusplus */
218 
219 #endif
ssize_t read(int fd, void *buffer, size_t count)
Definition: read.c:27
uint32_t rtems_nvdisk_configuration_size
uint32_t flags
Definition: nvdisk.h:156
void * base
Definition: nvdisk.h:157
uint32_t size
Definition: nvdisk.h:158
Definition: nvdisk.h:93
ssize_t write(int fd, const void *buffer, size_t count)
Definition: write.c:30
struct rtems_nvdisk_driver_handlers rtems_nvdisk_driver_handlers
Definition: rtemscompat1.h:15
Definition: nvdisk.h:166
Definition: nvdisk.h:154
const rtems_nvdisk_device_desc * devices
Definition: nvdisk.h:170
rtems_status_code
Classic API Status.
Definition: status.h:43
Definition: nvdisk.h:70
uint32_t block_size
Definition: nvdisk.h:168
struct rtems_nvdisk_device_desc rtems_nvdisk_device_desc
uint32_t device_count
Definition: nvdisk.h:169
struct rtems_nvdisk_config rtems_nvdisk_config
const rtems_nvdisk_config rtems_nvdisk_configuration[]
rtems_device_driver rtems_nvdisk_initialize(rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
unsigned size
Definition: tte.h:74
struct rtems_nvdisk_monitor_data rtems_nvdisk_monitor_data
uint32_t info_level
Definition: nvdisk.h:173
const rtems_nvdisk_driver_handlers * nv_ops
Definition: nvdisk.h:159
uint32_t flags
Definition: nvdisk.h:171