annotate packages/fs/jffs2/current/src/compr.h @ 3292:7f8e529b4d82 default tip

Fix FREESCALE_EDMA_NBYTES_MLOFFYES_MLOFF() so it works with negative offsets.
author vae
date Wed, 29 Apr 2015 23:31:48 +0000
parents 5bcbb50b501e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1714
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
1 /*
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
2 * JFFS2 -- Journalling Flash File System, Version 2.
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
3 *
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
4 * Copyright (C) 2004 Ferenc Havasi <havasi@inf.u-szeged.hu>,
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
5 * University of Szeged, Hungary
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
6 *
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
7 * For licensing information, see the file 'LICENCE' in the
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
8 * jffs2 directory.
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
9 *
2042
5bcbb50b501e * Merge to public MTD
asl
parents: 1834
diff changeset
10 * $Id: compr.h,v 1.8 2005/07/26 13:24:40 havasi Exp $
1714
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
11 *
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
12 */
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
13
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
14 #ifndef __JFFS2_COMPR_H__
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
15 #define __JFFS2_COMPR_H__
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
16
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
17 #include <linux/kernel.h>
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
18 #include <linux/vmalloc.h>
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
19 #include <linux/list.h>
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
20 #include <linux/types.h>
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
21 #include <linux/string.h>
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
22 #include <linux/slab.h>
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
23 #include <linux/errno.h>
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
24 #include <linux/fs.h>
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
25 #include <linux/jffs2.h>
1834
121da35df27b * Merge from public MTD.
asl
parents: 1714
diff changeset
26 #include <linux/jffs2_fs_i.h>
1714
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
27 #include <linux/jffs2_fs_sb.h>
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
28 #include "nodelist.h"
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
29
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
30 #define JFFS2_RUBINMIPS_PRIORITY 10
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
31 #define JFFS2_DYNRUBIN_PRIORITY 20
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
32 #define JFFS2_LZARI_PRIORITY 30
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
33 #define JFFS2_LZO_PRIORITY 40
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
34 #define JFFS2_RTIME_PRIORITY 50
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
35 #define JFFS2_ZLIB_PRIORITY 60
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
36
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
37 #define JFFS2_RUBINMIPS_DISABLED /* RUBINs will be used only */
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
38 #define JFFS2_DYNRUBIN_DISABLED /* for decompression */
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
39
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
40 #define JFFS2_COMPR_MODE_NONE 0
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
41 #define JFFS2_COMPR_MODE_PRIORITY 1
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
42 #define JFFS2_COMPR_MODE_SIZE 2
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
43
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
44 struct jffs2_compressor {
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
45 struct list_head list;
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
46 int priority; /* used by prirority comr. mode */
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
47 char *name;
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
48 char compr; /* JFFS2_COMPR_XXX */
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
49 int (*compress)(unsigned char *data_in, unsigned char *cpage_out,
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
50 uint32_t *srclen, uint32_t *destlen, void *model);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
51 int (*decompress)(unsigned char *cdata_in, unsigned char *data_out,
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
52 uint32_t cdatalen, uint32_t datalen, void *model);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
53 int usecount;
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
54 int disabled; /* if seted the compressor won't compress */
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
55 unsigned char *compr_buf; /* used by size compr. mode */
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
56 uint32_t compr_buf_size; /* used by size compr. mode */
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
57 uint32_t stat_compr_orig_size;
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
58 uint32_t stat_compr_new_size;
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
59 uint32_t stat_compr_blocks;
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
60 uint32_t stat_decompr_blocks;
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
61 };
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
62
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
63 int jffs2_register_compressor(struct jffs2_compressor *comp);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
64 int jffs2_unregister_compressor(struct jffs2_compressor *comp);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
65
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
66 int jffs2_compressors_init(void);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
67 int jffs2_compressors_exit(void);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
68
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
69 uint16_t jffs2_compress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
70 unsigned char *data_in, unsigned char **cpage_out,
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
71 uint32_t *datalen, uint32_t *cdatalen);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
72
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
73 int jffs2_decompress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
74 uint16_t comprtype, unsigned char *cdata_in,
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
75 unsigned char *data_out, uint32_t cdatalen, uint32_t datalen);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
76
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
77 void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
78
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
79 #ifdef CONFIG_JFFS2_PROC
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
80 int jffs2_enable_compressor_name(const char *name);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
81 int jffs2_disable_compressor_name(const char *name);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
82 int jffs2_set_compression_mode_name(const char *mode_name);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
83 char *jffs2_get_compression_mode_name(void);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
84 int jffs2_set_compressor_priority(const char *mode_name, int priority);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
85 char *jffs2_list_compressors(void);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
86 char *jffs2_stats(void);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
87 #endif
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
88
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
89 /* Compressor modules */
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
90 /* These functions will be called by jffs2_compressors_init/exit */
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
91
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
92 #ifdef CONFIG_JFFS2_RUBIN
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
93 int jffs2_rubinmips_init(void);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
94 void jffs2_rubinmips_exit(void);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
95 int jffs2_dynrubin_init(void);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
96 void jffs2_dynrubin_exit(void);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
97 #endif
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
98 #ifdef CONFIG_JFFS2_RTIME
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
99 int jffs2_rtime_init(void);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
100 void jffs2_rtime_exit(void);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
101 #endif
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
102 #ifdef CONFIG_JFFS2_ZLIB
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
103 int jffs2_zlib_init(void);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
104 void jffs2_zlib_exit(void);
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
105 #endif
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
106
3fc626a650ab * src/compr.h: Committed this file which if forgot yesterday.
asl
parents:
diff changeset
107 #endif /* __JFFS2_COMPR_H__ */