diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2007-07-15 13:50:04 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2007-07-15 13:50:04 +0200 |
commit | 665291e693efd1fd2955c6f8bfb89956711b0aef (patch) | |
tree | 0c9d871da372b4a640a9760f8946a8a57e3fbbba /include/driver.h | |
parent | 9b3761c4459167a335d3a1c30543824afa2d654d (diff) | |
download | barebox-665291e693efd1fd2955c6f8bfb89956711b0aef.tar.gz barebox-665291e693efd1fd2955c6f8bfb89956711b0aef.tar.xz |
implement memmap().
With this function we can get a pointer to directly memory mapped
devices like nor flash or RAM. Useful for bootm where we save one
memcopy when the image is mappable
Diffstat (limited to 'include/driver.h')
-rw-r--r-- | include/driver.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/driver.h b/include/driver.h index e360778c04..1be59100d6 100644 --- a/include/driver.h +++ b/include/driver.h @@ -53,6 +53,7 @@ struct driver_d { ssize_t (*read) (struct device_d*, void* buf, size_t count, ulong offset, ulong flags); ssize_t (*write) (struct device_d*, const void* buf, size_t count, ulong offset, ulong flags); ssize_t (*erase) (struct device_d*, size_t count, unsigned long offset); + int (*memmap)(struct device_d*, void **map, int flags); void (*info) (struct device_d *); void (*shortinfo) (struct device_d *); @@ -100,6 +101,7 @@ struct driver_d *get_driver_by_name(const char *name); ssize_t dev_read(struct device_d *dev, void *buf, size_t count, ulong offset, ulong flags); ssize_t dev_write(struct device_d *dev, const void *buf, size_t count, ulong offset, ulong flags); ssize_t dev_erase(struct device_d *dev, size_t count, unsigned long offset); +int dev_memmap(struct device_d *dev, void **map, int flags); /* These are used by drivers which work with direct memory accesses */ ssize_t mem_read(struct device_d *dev, void *buf, size_t count, ulong offset, ulong flags); @@ -108,5 +110,8 @@ ssize_t mem_write(struct device_d *dev, const void *buf, size_t count, ulong off /* Use this if you have nothing to do in your drivers probe function */ int dummy_probe(struct device_d *); +int generic_memmap_ro(struct device_d *dev, void **map, int flags); +int generic_memmap_rw(struct device_d *dev, void **map, int flags); + #endif /* DRIVER_H */ |