RTEMS CPU Kit with SuperCore  4.11.3
jffs2.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 embedded brains GmbH. All rights reserved.
3  *
4  * embedded brains GmbH
5  * Dornierstr. 4
6  * 82178 Puchheim
7  * Germany
8  * <rtems@embedded-brains.de>
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 
15 #ifndef RTEMS_JFFS2_H
16 #define RTEMS_JFFS2_H
17 
18 #include <rtems/fs.h>
19 #include <sys/param.h>
20 #include <zlib.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif /* __cplusplus */
25 
27 
175 typedef int (*rtems_jffs2_flash_read)(
177  uint32_t offset,
178  unsigned char *buffer,
179  size_t size_of_buffer
180 );
181 
194 typedef int (*rtems_jffs2_flash_write)(
196  uint32_t offset,
197  const unsigned char *buffer,
198  size_t size_of_buffer
199 );
200 
213 typedef int (*rtems_jffs2_flash_erase)(
215  uint32_t offset
216 );
217 
227 typedef void (*rtems_jffs2_flash_destroy)(
229 );
230 
238  uint32_t block_size;
246  uint32_t flash_size;
276  dev_t device_identifier;
277 };
278 
280 
296 typedef uint16_t (*rtems_jffs2_compressor_compress)(
298  unsigned char *data_in,
299  unsigned char *cdata_out,
300  uint32_t *datalen,
301  uint32_t *cdatalen
302 );
303 
318 typedef int (*rtems_jffs2_compressor_decompress)(
320  uint16_t comprtype,
321  unsigned char *cdata_in,
322  unsigned char *data_out,
323  uint32_t cdatalen,
324  uint32_t datalen
325 );
326 
336 typedef void (*rtems_jffs2_compressor_destroy)(
338 );
339 
364  unsigned char buffer[PAGE_SIZE];
365 };
366 
372  unsigned char *data_in,
373  unsigned char *cdata_out,
374  uint32_t *datalen,
375  uint32_t *cdatalen
376 );
377 
383  uint16_t comprtype,
384  unsigned char *cdata_in,
385  unsigned char *data_out,
386  uint32_t cdatalen,
387  uint32_t datalen
388 );
389 
393 typedef struct {
395  z_stream stream;
397 
403  unsigned char *data_in,
404  unsigned char *cdata_out,
405  uint32_t *datalen,
406  uint32_t *cdatalen
407 );
408 
414  uint16_t comprtype,
415  unsigned char *cdata_in,
416  unsigned char *data_out,
417  uint32_t cdatalen,
418  uint32_t datalen
419 );
420 
426 typedef struct {
430  rtems_jffs2_flash_control *flash_control;
437  rtems_jffs2_compressor_control *compressor_control;
439 
455  const void *data
456 );
457 
460 #ifdef __cplusplus
461 }
462 #endif /* __cplusplus */
463 
464 #endif /* RTEMS_JFFS2_H */
void(* rtems_jffs2_flash_destroy)(rtems_jffs2_flash_control *self)
Flash destroy operation.
Definition: jffs2.h:228
ZLIB compressor control structure.
Definition: jffs2.h:394
int rtems_jffs2_compressor_zlib_decompress(rtems_jffs2_compressor_control *self, uint16_t comprtype, unsigned char *cdata_in, unsigned char *data_out, uint32_t cdatalen, uint32_t datalen)
ZLIB compressor decompress operation.
Definition: compr_zlib.c:119
uint16_t(* rtems_jffs2_compressor_compress)(rtems_jffs2_compressor_control *self, unsigned char *data_in, unsigned char *cdata_out, uint32_t *datalen, uint32_t *cdatalen)
Compress operation.
Definition: jffs2.h:297
int(* rtems_jffs2_flash_read)(rtems_jffs2_flash_control *self, uint32_t offset, unsigned char *buffer, size_t size_of_buffer)
Read from flash operation.
Definition: jffs2.h:176
rtems_jffs2_flash_erase erase
Flash erase operation.
Definition: jffs2.h:262
uint32_t block_size
The size in bytes of the erasable unit of the flash device.
Definition: jffs2.h:239
rtems_jffs2_flash_read read
Read from flash operation.
Definition: jffs2.h:252
int(* rtems_jffs2_flash_erase)(rtems_jffs2_flash_control *self, uint32_t offset)
Flash erase operation.
Definition: jffs2.h:214
uint16_t rtems_jffs2_compressor_zlib_compress(rtems_jffs2_compressor_control *self, unsigned char *data_in, unsigned char *cdata_out, uint32_t *datalen, uint32_t *cdatalen)
ZLIB compressor compress operation.
Definition: compr_zlib.c:45
int(* rtems_jffs2_flash_write)(rtems_jffs2_flash_control *self, uint32_t offset, const unsigned char *buffer, size_t size_of_buffer)
Write to flash operation.
Definition: jffs2.h:195
rtems_jffs2_flash_write write
Write to flash operation.
Definition: jffs2.h:257
uint32_t flash_size
The size in bytes of the flash device.
Definition: jffs2.h:247
Mount table entry.
Definition: libio.h:1542
uint16_t rtems_jffs2_compressor_rtime_compress(rtems_jffs2_compressor_control *self, unsigned char *data_in, unsigned char *cdata_out, uint32_t *datalen, uint32_t *cdatalen)
RTIME compressor compress operation.
Definition: compr_rtime.c:32
Basic Filesystem Types.
int(* rtems_jffs2_compressor_decompress)(rtems_jffs2_compressor_control *self, uint16_t comprtype, unsigned char *cdata_in, unsigned char *data_out, uint32_t cdatalen, uint32_t datalen)
Decompress operation.
Definition: jffs2.h:319
dev_t device_identifier
The device identifier of the flash device.
Definition: jffs2.h:277
rtems_jffs2_flash_destroy destroy
Flash destroy operation.
Definition: jffs2.h:269
void(* rtems_jffs2_compressor_destroy)(rtems_jffs2_compressor_control *self)
Compressor destroy operation.
Definition: jffs2.h:337
JFFS2 compressor control.
Definition: jffs2.h:344
JFFS2 mount options.
Definition: jffs2.h:427
int rtems_jffs2_compressor_rtime_decompress(rtems_jffs2_compressor_control *self, uint16_t comprtype, unsigned char *cdata_in, unsigned char *data_out, uint32_t cdatalen, uint32_t datalen)
RTIME compressor decompress operation.
Definition: compr_rtime.c:79
JFFS2 flash device control.
Definition: jffs2.h:235
Definition: zlib.h:86
int rtems_jffs2_initialize(rtems_filesystem_mount_table_entry_t *mt_entry, const void *data)
Initialization handler of the JFFS2 file system.
Definition: fs-rtems.c:1138