]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/memory.h
memory_accessor: new interface for reading/writing persistent memory
[linux-2.6-omap-h63xx.git] / include / linux / memory.h
index 36c82c9e6ea70985243e56a2b41ac13fe060bd5b..42767d1a62e784e9ce25dfbc9cc37ab9232f226a 100644 (file)
@@ -79,14 +79,14 @@ static inline int memory_notify(unsigned long val, void *v)
 #else
 extern int register_memory_notifier(struct notifier_block *nb);
 extern void unregister_memory_notifier(struct notifier_block *nb);
-extern int register_new_memory(struct mem_section *);
+extern int register_new_memory(int, struct mem_section *);
 extern int unregister_memory_section(struct mem_section *);
 extern int memory_dev_init(void);
 extern int remove_memory_block(unsigned long, struct mem_section *, int);
 extern int memory_notify(unsigned long val, void *v);
+extern struct memory_block *find_memory_block(struct mem_section *);
 #define CONFIG_MEM_BLOCK_SIZE  (PAGES_PER_SECTION<<PAGE_SHIFT)
-
-
+enum mem_add_context { BOOT, HOTPLUG };
 #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */
 
 #ifdef CONFIG_MEMORY_HOTPLUG
@@ -99,4 +99,15 @@ extern int memory_notify(unsigned long val, void *v);
 #define hotplug_memory_notifier(fn, pri) do { } while (0)
 #endif
 
+/*
+ * 'struct memory_accessor' is a generic interface to provide
+ * in-kernel access to persistent memory such as i2c or SPI EEPROMs
+ */
+struct memory_accessor {
+       ssize_t (*read)(struct memory_accessor *, char *buf, off_t offset,
+                       size_t count);
+       ssize_t (*write)(struct memory_accessor *, const char *buf,
+                        off_t offset, size_t count);
+};
+
 #endif /* _LINUX_MEMORY_H_ */