Lines Matching full:map

22 #define map_bankwidth(map) 1  argument
23 #define map_bankwidth_is_1(map) (map_bankwidth(map) == 1) argument
24 #define map_bankwidth_is_large(map) (0) argument
25 #define map_words(map) (1) argument
28 #define map_bankwidth_is_1(map) (0) argument
34 # define map_bankwidth(map) ((map)->bankwidth) argument
36 # define map_bankwidth(map) 2 argument
37 # define map_bankwidth_is_large(map) (0) argument
38 # define map_words(map) (1) argument
40 #define map_bankwidth_is_2(map) (map_bankwidth(map) == 2) argument
44 #define map_bankwidth_is_2(map) (0) argument
50 # define map_bankwidth(map) ((map)->bankwidth) argument
52 # define map_bankwidth(map) 4 argument
53 # define map_bankwidth_is_large(map) (0) argument
54 # define map_words(map) (1) argument
56 #define map_bankwidth_is_4(map) (map_bankwidth(map) == 4) argument
60 #define map_bankwidth_is_4(map) (0) argument
66 #define map_calc_words(map) ((map_bankwidth(map) + (sizeof(unsigned long)-1)) / sizeof(unsigned lon… argument
71 # define map_bankwidth(map) ((map)->bankwidth) argument
74 # define map_bankwidth_is_large(map) (map_bankwidth(map) > BITS_PER_LONG/8) argument
76 # define map_words(map) map_calc_words(map) argument
79 # define map_bankwidth(map) 8 argument
80 # define map_bankwidth_is_large(map) (BITS_PER_LONG < 64) argument
81 # define map_words(map) map_calc_words(map) argument
83 #define map_bankwidth_is_8(map) (map_bankwidth(map) == 8) argument
87 #define map_bankwidth_is_8(map) (0) argument
93 # define map_bankwidth(map) ((map)->bankwidth) argument
95 # define map_bankwidth_is_large(map) (map_bankwidth(map) > BITS_PER_LONG/8) argument
97 # define map_words(map) map_calc_words(map) argument
99 # define map_bankwidth(map) 16 argument
100 # define map_bankwidth_is_large(map) (1) argument
101 # define map_words(map) map_calc_words(map) argument
103 #define map_bankwidth_is_16(map) (map_bankwidth(map) == 16) argument
107 #define map_bankwidth_is_16(map) (0) argument
113 # define map_bankwidth(map) ((map)->bankwidth) argument
115 # define map_bankwidth_is_large(map) (map_bankwidth(map) > BITS_PER_LONG/8) argument
117 # define map_words(map) map_calc_words(map) argument
118 #define map_bankwidth_is_32(map) (map_bankwidth(map) == 32) argument
122 #define map_bankwidth_is_32(map) (0) argument
129 static inline int map_bankwidth(void *map) in map_bankwidth() argument
134 #define map_bankwidth_is_large(map) (0) argument
135 #define map_words(map) (0) argument
173 /* The map stuff is very simple. You fill in your struct map_info with
186 mtd->priv->fldrv_priv field. This allows the map driver to get at
187 the destructor function map->fldrv_destroy() when it's tired
216 /* It's possible for the map driver to use cached memory in its
219 it will signal it to the map driver through this routine to let
220 the map driver invalidate the corresponding cache as needed.
224 /* This will be called with 1 as parameter when the first map user
225 * needs VPP, and called with 0 when the last user exits. The map
240 struct mtd_info *(*probe)(struct map_info *map);
250 struct mtd_info *do_map_probe(const char *name, struct map_info *map);
253 #define ENABLE_VPP(map) do { if (map->set_vpp) map->set_vpp(map, 1); } while (0) argument
254 #define DISABLE_VPP(map) do { if (map->set_vpp) map->set_vpp(map, 0); } while (0) argument
256 #define INVALIDATE_CACHED_RANGE(map, from, size) \ argument
257 do { if (map->inval_cache) map->inval_cache(map, from, size); } while (0)
259 #define map_word_equal(map, val1, val2) \ argument
262 for (i = 0; i < map_words(map); i++) \
270 #define map_word_and(map, val1, val2) \ argument
274 for (i = 0; i < map_words(map); i++) \
279 #define map_word_clr(map, val1, val2) \ argument
283 for (i = 0; i < map_words(map); i++) \
288 #define map_word_or(map, val1, val2) \ argument
292 for (i = 0; i < map_words(map); i++) \
297 #define map_word_andequal(map, val1, val2, val3) \ argument
300 for (i = 0; i < map_words(map); i++) { \
309 #define map_word_bitsset(map, val1, val2) \ argument
312 for (i = 0; i < map_words(map); i++) { \
321 static inline map_word map_word_load(struct map_info *map, const void *ptr) in map_word_load() argument
325 if (map_bankwidth_is_1(map)) in map_word_load()
327 else if (map_bankwidth_is_2(map)) in map_word_load()
329 else if (map_bankwidth_is_4(map)) in map_word_load()
332 else if (map_bankwidth_is_8(map)) in map_word_load()
335 else if (map_bankwidth_is_large(map)) in map_word_load()
336 memcpy(r.x, ptr, map->bankwidth); in map_word_load()
343 static inline map_word map_word_load_partial(struct map_info *map, map_word orig, const unsigned ch… in map_word_load_partial() argument
347 if (map_bankwidth_is_large(map)) { in map_word_load_partial()
358 bitpos = (map_bankwidth(map) - 1 - i) * 8; in map_word_load_partial()
373 static inline map_word map_word_ff(struct map_info *map) in map_word_ff() argument
378 if (map_bankwidth(map) < MAP_FF_LIMIT) { in map_word_ff()
379 int bw = 8 * map_bankwidth(map); in map_word_ff()
383 for (i = 0; i < map_words(map); i++) in map_word_ff()
389 static inline map_word inline_map_read(struct map_info *map, unsigned long ofs) in inline_map_read() argument
393 if (map_bankwidth_is_1(map)) in inline_map_read()
394 r.x[0] = __raw_readb(map->virt + ofs); in inline_map_read()
395 else if (map_bankwidth_is_2(map)) in inline_map_read()
396 r.x[0] = __raw_readw(map->virt + ofs); in inline_map_read()
397 else if (map_bankwidth_is_4(map)) in inline_map_read()
398 r.x[0] = __raw_readl(map->virt + ofs); in inline_map_read()
400 else if (map_bankwidth_is_8(map)) in inline_map_read()
401 r.x[0] = __raw_readq(map->virt + ofs); in inline_map_read()
403 else if (map_bankwidth_is_large(map)) in inline_map_read()
404 memcpy_fromio(r.x, map->virt + ofs, map->bankwidth); in inline_map_read()
411 static inline void inline_map_write(struct map_info *map, const map_word datum, unsigned long ofs) in inline_map_write() argument
413 if (map_bankwidth_is_1(map)) in inline_map_write()
414 __raw_writeb(datum.x[0], map->virt + ofs); in inline_map_write()
415 else if (map_bankwidth_is_2(map)) in inline_map_write()
416 __raw_writew(datum.x[0], map->virt + ofs); in inline_map_write()
417 else if (map_bankwidth_is_4(map)) in inline_map_write()
418 __raw_writel(datum.x[0], map->virt + ofs); in inline_map_write()
420 else if (map_bankwidth_is_8(map)) in inline_map_write()
421 __raw_writeq(datum.x[0], map->virt + ofs); in inline_map_write()
423 else if (map_bankwidth_is_large(map)) in inline_map_write()
424 memcpy_toio(map->virt+ofs, datum.x, map->bankwidth); in inline_map_write()
430 static inline void inline_map_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t… in inline_map_copy_from() argument
432 if (map->cached) in inline_map_copy_from()
433 memcpy(to, (char *)map->cached + from, len); in inline_map_copy_from()
435 memcpy_fromio(to, map->virt + from, len); in inline_map_copy_from()
438 static inline void inline_map_copy_to(struct map_info *map, unsigned long to, const void *from, ssi… in inline_map_copy_to() argument
440 memcpy_toio(map->virt + to, from, len); in inline_map_copy_to()
444 #define map_read(map, ofs) (map)->read(map, ofs) argument
445 #define map_copy_from(map, to, from, len) (map)->copy_from(map, to, from, len) argument
446 #define map_write(map, datum, ofs) (map)->write(map, datum, ofs) argument
447 #define map_copy_to(map, to, from, len) (map)->copy_to(map, to, from, len) argument
450 #define map_is_linear(map) (map->phys != NO_XIP) argument
453 #define map_read(map, ofs) inline_map_read(map, ofs) argument
454 #define map_copy_from(map, to, from, len) inline_map_copy_from(map, to, from, len) argument
455 #define map_write(map, datum, ofs) inline_map_write(map, datum, ofs) argument
456 #define map_copy_to(map, to, from, len) inline_map_copy_to(map, to, from, len) argument
459 #define simple_map_init(map) BUG_ON(!map_bankwidth_supported((map)->bankwidth)) argument
460 #define map_is_linear(map) ({ (void)(map); 1; }) argument