RTEMS
5.0.0
|
Flash Disk Block Device Implementation. More...
#include <rtems.h>
#include <rtems/libio.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <inttypes.h>
#include <rtems/blkdev.h>
#include <rtems/flashdisk.h>
#include <rtems/thread.h>
Data Structures | |
struct | rtems_fdisk_page_desc |
struct | rtems_fdisk_segment_ctl |
struct | rtems_fdisk_segment_ctl_queue |
struct | rtems_fdisk_device_ctl |
struct | rtems_fdisk_block_ctl |
struct | rtems_flashdisk |
Macros | |
#define | RTEMS_FDISK_TRACE 1 |
#define | RTEMS_FDISK_PAGE_ACTIVE (1 << 0) |
#define | RTEMS_FDISK_PAGE_USED (1 << 1) |
#define | rtems_fdisk_calc_crc16(_b, _c) rtems_fdisk_crc16_factor[((_b) ^ ((_c) & 0xff)) & 0xff] ^ (((_c) >> 8) & 0xff) |
Typedefs | |
typedef struct rtems_fdisk_page_desc | rtems_fdisk_page_desc |
typedef struct rtems_fdisk_segment_ctl | rtems_fdisk_segment_ctl |
typedef struct rtems_fdisk_segment_ctl_queue | rtems_fdisk_segment_ctl_queue |
typedef struct rtems_fdisk_device_ctl | rtems_fdisk_device_ctl |
typedef struct rtems_fdisk_block_ctl | rtems_fdisk_block_ctl |
typedef struct rtems_flashdisk | rtems_flashdisk |
Functions | |
rtems_device_driver | rtems_fdisk_initialize (rtems_device_major_number major, rtems_device_minor_number minor, void *arg RTEMS_UNUSED) |
Flash Disk Block Device Implementation.
#define rtems_fdisk_calc_crc16 | ( | _b, | |
_c | |||
) | rtems_fdisk_crc16_factor[((_b) ^ ((_c) & 0xff)) & 0xff] ^ (((_c) >> 8) & 0xff) |
Calculate the CRC16 checksum.
_b | The byte to checksum. |
_c | The current checksum. |
#define RTEMS_FDISK_PAGE_ACTIVE (1 << 0) |
Flag the page as active.
#define RTEMS_FDISK_PAGE_USED (1 << 1) |
Flag the page as used.
#define RTEMS_FDISK_TRACE 1 |
Control tracing. It can be compiled out of the code for small footprint targets. Leave in by default.
typedef struct rtems_fdisk_block_ctl rtems_fdisk_block_ctl |
The Block control holds the segment and page with the data.
typedef struct rtems_fdisk_device_ctl rtems_fdisk_device_ctl |
Flash Device Control holds the segment controls
typedef struct rtems_fdisk_page_desc rtems_fdisk_page_desc |
The start of a segment has a segment control table. This hold the CRC and block number for the page.
typedef struct rtems_fdisk_segment_ctl rtems_fdisk_segment_ctl |
Flash Segment Control holds the pointer to the segment, number of pages, various page stats and the memory copy of the page descriptors.
typedef struct rtems_fdisk_segment_ctl_queue rtems_fdisk_segment_ctl_queue |
Segment control table queue.
typedef struct rtems_flashdisk rtems_flashdisk |
The virtual block table holds the mapping for blocks as seen by the disk drivers to the device, segment and page numbers of the physical device.
rtems_device_driver rtems_fdisk_initialize | ( | rtems_device_major_number | major, |
rtems_device_minor_number | minor, | ||
void *arg | RTEMS_UNUSED | ||
) |
Flash disk device driver initialization.
major | Flash disk major device number. |
minor | Minor device number, not applicable. |
arg | Initialization argument, not applicable. |