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 /fs/devfs.c | |
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 'fs/devfs.c')
-rw-r--r-- | fs/devfs.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/devfs.c b/fs/devfs.c index 5e60362f3f..aafcc34439 100644 --- a/fs/devfs.c +++ b/fs/devfs.c @@ -50,6 +50,13 @@ static int devfs_erase(struct device_d *_dev, FILE *f, size_t count, unsigned lo return dev_erase(dev, count, offset); } +static int devfs_memmap(struct device_d *_dev, FILE *f, void **map, int flags) +{ + struct device_d *dev = f->inode; + + return dev_memmap(dev, map, flags); +} + static int devfs_open(struct device_d *_dev, FILE *file, const char *filename) { struct device_d *dev = get_device_by_id(filename + 1); @@ -146,6 +153,7 @@ static struct fs_driver_d devfs_driver = { .closedir = devfs_closedir, .stat = devfs_stat, .erase = devfs_erase, + .memmap = devfs_memmap, .flags = FS_DRIVER_NO_DEV, .drv = { .type = DEVICE_TYPE_FS, |