]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/platform-bionic.git/blob - libc/kernel/common/linux/mtd/map.h
Initial Contribution
[android-sdk/platform-bionic.git] / libc / kernel / common / linux / mtd / map.h
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ****************************************************************************
11  ****************************************************************************/
12 #ifndef __LINUX_MTD_MAP_H__
13 #define __LINUX_MTD_MAP_H__
15 #include <linux/types.h>
16 #include <linux/list.h>
17 #include <linux/string.h>
19 #include <linux/mtd/compatmac.h>
21 #include <asm/unaligned.h>
22 #include <asm/system.h>
23 #include <asm/io.h>
25 #define map_bankwidth_is_1(map) (0)
27 #define map_bankwidth_is_2(map) (0)
29 #define map_bankwidth_is_4(map) (0)
31 #define map_calc_words(map) ((map_bankwidth(map) + (sizeof(unsigned long)-1))/ sizeof(unsigned long))
33 #define map_bankwidth_is_8(map) (0)
35 #define map_bankwidth_is_16(map) (0)
37 #define map_bankwidth_is_32(map) (0)
39 #ifndef map_bankwidth
40 #error "No bus width supported. What's the point?"
41 #endif
43 #define MAX_MAP_LONGS ( ((MAX_MAP_BANKWIDTH*8) + BITS_PER_LONG - 1) / BITS_PER_LONG )
45 struct map_info {
46  char *name;
47  unsigned long size;
48  unsigned long phys;
49 #define NO_XIP (-1UL)
51  void __iomem *virt;
52  void *cached;
54  int bankwidth;
56  void (*inval_cache)(struct map_info *, unsigned long, ssize_t);
58  void (*set_vpp)(struct map_info *, int);
60  unsigned long map_priv_1;
61  unsigned long map_priv_2;
62  void *fldrv_priv;
63  struct mtd_chip_driver *fldrv;
64 };
66 struct mtd_chip_driver {
67  struct mtd_info *(*probe)(struct map_info *map);
68  void (*destroy)(struct mtd_info *);
69  struct module *module;
70  char *name;
71  struct list_head list;
72 };
74 struct mtd_info *do_map_probe(const char *name, struct map_info *map);
76 #define ENABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(map, 1); } while(0)
77 #define DISABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(map, 0); } while(0)
79 #define INVALIDATE_CACHED_RANGE(map, from, size)   do { if(map->inval_cache) map->inval_cache(map, from, size); } while(0)
81 #define map_word_andequal(m, a, b, z) map_word_equal(m, z, map_word_and(m, a, b))
82 #if BITS_PER_LONG >= 64
83 #endif
84 #ifdef __LITTLE_ENDIAN
85 #else
86 #endif
87 #if BITS_PER_LONG < 64
88 #define MAP_FF_LIMIT 4
89 #else
90 #define MAP_FF_LIMIT 8
91 #endif
92 #if BITS_PER_LONG >= 64
93 #endif
94 #if BITS_PER_LONG >= 64
95 #endif
96 #define map_read(map, ofs) inline_map_read(map, ofs)
97 #define map_copy_from(map, to, from, len) inline_map_copy_from(map, to, from, len)
98 #define map_write(map, datum, ofs) inline_map_write(map, datum, ofs)
99 #define map_copy_to(map, to, from, len) inline_map_copy_to(map, to, from, len)
100 #define simple_map_init(map) BUG_ON(!map_bankwidth_supported((map)->bankwidth))
101 #define map_is_linear(map) ({ (void)(map); 1; })
102 #endif