RTEMS 6.1-rc6
Loading...
Searching...
No Matches
nvdisk.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
9/*
10 * Copyright (C) 2007 Chris Johns
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 */
33
44#if !defined (_RTEMS_NVDISK_H_)
45#define _RTEMS_NVDISK_H_
46
47#include <stdint.h>
48#include <sys/ioctl.h>
49
50#include <rtems.h>
51
52#ifdef __cplusplus
53extern "C" {
54#endif /* __cplusplus */
55
59#define RTEMS_NVDISK_DEVICE_BASE_NAME "/dev/nvd"
60
80#define RTEMS_NVDISK_IOCTL_ERASE_DISK _IO('B', 128)
81#define RTEMS_NVDISK_IOCTL_MONITORING _IO('B', 129)
82#define RTEMS_NVDISK_IOCTL_INFO_LEVEL _IO('B', 130)
83#define RTEMS_NVDISK_IOCTL_PRINT_STATUS _IO('B', 131)
84
90{
91 uint32_t block_size;
92 uint32_t block_count;
93 uint32_t page_count;
94 uint32_t pages_available;
95 uint32_t pages_used;
96 uint32_t info_level;
98
102#define RTEMS_NVDISK_KBYTES(_k) ((_k) * 1024)
103
113{
127 int (*read) (uint32_t device, uint32_t flags, void* base,
128 uint32_t offset, void* buffer, size_t size);
129
143 int (*write) (uint32_t device, uint32_t flags, void* base,
144 uint32_t offset, const void* buffer, size_t size);
145
159 int (*verify) (uint32_t device, uint32_t flags, void* base,
160 uint32_t offset, const void* buffer, size_t size);
161
163
174{
175 uint32_t flags;
176 void* base;
177 uint32_t size;
180
186{
187 uint32_t block_size;
188 uint32_t device_count;
190 uint32_t flags;
192 uint32_t info_level;
194
195/*
196 * Driver flags.
197 */
198
204#define RTEMS_NVDISK_CHECK_PAGES (1 << 0)
205
220 void* arg);
221
227
232extern uint32_t rtems_nvdisk_configuration_size;
233
234#ifdef __cplusplus
235}
236#endif /* __cplusplus */
237
238#endif
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
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)
uint32_t rtems_nvdisk_configuration_size
This header file defines the RTEMS Classic API.
Definition: nvdisk.h:186
uint32_t block_size
Definition: nvdisk.h:187
uint32_t info_level
Definition: nvdisk.h:192
uint32_t device_count
Definition: nvdisk.h:188
uint32_t flags
Definition: nvdisk.h:190
const rtems_nvdisk_device_desc * devices
Definition: nvdisk.h:189
Definition: nvdisk.h:174
const rtems_nvdisk_driver_handlers * nv_ops
Definition: nvdisk.h:178
uint32_t size
Definition: nvdisk.h:177
uint32_t flags
Definition: nvdisk.h:175
void * base
Definition: nvdisk.h:176
Definition: nvdisk.h:113
int(* read)(uint32_t device, uint32_t flags, void *base, uint32_t offset, void *buffer, size_t size)
Definition: nvdisk.h:127
int(* verify)(uint32_t device, uint32_t flags, void *base, uint32_t offset, const void *buffer, size_t size)
Definition: nvdisk.h:159
int(* write)(uint32_t device, uint32_t flags, void *base, uint32_t offset, const void *buffer, size_t size)
Definition: nvdisk.h:143
Definition: nvdisk.h:90