diff options
author | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-05-11 14:13:25 +0000 |
---|---|---|
committer | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-05-11 14:13:25 +0000 |
commit | 51bb9c19c7254aef8a61863bcf3622817b0ea9f4 (patch) | |
tree | bfa1507d50bf32cc52f03f21f2922520061d9c3f /dummyflasher.c | |
parent | bf3c90962f49ddc070f632aacc30ee4970162f14 (diff) | |
download | flashrom-51bb9c19c7254aef8a61863bcf3622817b0ea9f4.zip flashrom-51bb9c19c7254aef8a61863bcf3622817b0ea9f4.tar.gz |
Flash mapping/unmapping was performed without an abstraction layer, so even the dummy flasher caused memory mappings to be set up
Add map/unmap functions to the external flasher abstraction. Fix a possible
scribble-over-low-memory corner case which fortunately never triggered so far.
With this patch,--programmer dummy works fine as non-root.
Corresponding to flashrom svn r493.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Diffstat (limited to 'dummyflasher.c')
-rw-r--r-- | dummyflasher.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/dummyflasher.c b/dummyflasher.c index 4a4ea0f..3bda7a7 100644 --- a/dummyflasher.c +++ b/dummyflasher.c @@ -40,6 +40,19 @@ int dummy_shutdown(void) return 0; } +void *dummy_map(const char *descr, unsigned long phys_addr, size_t len) +{ + printf("%s: Mapping %s, 0x%lx bytes at 0x%08lx\n", + __func__, descr, (unsigned long)len, phys_addr); + return (void *)phys_addr; +} + +void dummy_unmap(void *virt_addr, size_t len) +{ + printf("%s: Unmapping 0x%lx bytes at %p\n", + __func__, (unsigned long)len, virt_addr); +} + void dummy_chip_writeb(uint8_t val, volatile void *addr) { printf("%s: addr=%p, val=0x%02x\n", __func__, addr, val); |