mtd/include/linux/mtd map.h,1.35,1.36

Nicolas Pitre nico at infradead.org
Wed Jun 2 22:08:44 EDT 2004


Update of /home/cvs/mtd/include/linux/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv23673/include/linux/mtd

Modified Files:
	map.h 
Log Message:
MTD infrastructure for cached access (only for Intel CFI flash right now)


Index: map.h
===================================================================
RCS file: /home/cvs/mtd/include/linux/mtd/map.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- map.h	2 Apr 2004 01:25:24 -0000	1.35
+++ map.h	3 Jun 2004 02:08:41 -0000	1.36
@@ -55,6 +55,14 @@
 	void (*write64)(struct map_info *, u64, unsigned long);
 	void (*copy_to)(struct map_info *, unsigned long, const void *, ssize_t);
 
+	/* It's possible for the map driver to use cached memory in its
+	   copy_from implementation (and _only_ with copy_from).  However,
+	   when the chip driver knows some flash area has changed contents,
+	   it will signal it to the map driver through this routine to let
+	   the map driver invalidate the corresponding cache as needed.
+	   If there is no cache to care about this can be set to NULL. */
+	void (*inval_cache)(struct map_info *, unsigned long, ssize_t);
+
 	/* We can perhaps put in 'point' and 'unpoint' methods, if we really
 	   want to enable XIP for non-linear mappings. Not yet though. */
 #endif
@@ -85,6 +93,9 @@
 #define ENABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(map, 1); } while(0)
 #define DISABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(map, 0); } while(0)
 
+#define INVALIDATE_CACHED_RANGE(map, from, size) \
+	do { if(map->inval_cache) map->inval_cache(map, from, size); } while(0)
+
 #ifdef CONFIG_MTD_COMPLEX_MAPPINGS
 #define map_read8(map, ofs) (map)->read8(map, ofs)
 #define map_read16(map, ofs) (map)->read16(map, ofs)





More information about the linux-mtd-cvs mailing list