diff options
author | Stefan Reinauer <stepan@coresystems.de> | 2009-01-26 01:10:48 +0000 |
---|---|---|
committer | Peter Stuge <peter@stuge.se> | 2009-01-26 01:10:48 +0000 |
commit | 0593f21f1049e2dc8df1e2920c29ce9e93f7a663 (patch) | |
tree | a542b94c7b06b0242a00a3e6c538a475bb2f86e5 /flash.h | |
parent | 776d2021fd27ada1874cbe795b57f3cce1834c8b (diff) | |
download | flashrom-0593f21f1049e2dc8df1e2920c29ce9e93f7a663.tar.gz flashrom-0593f21f1049e2dc8df1e2920c29ce9e93f7a663.tar.bz2 flashrom-0593f21f1049e2dc8df1e2920c29ce9e93f7a663.zip |
Abstract mmap() in physmap.c and only open /dev/mem on the first physmap() call
Corresponding to flashrom svn r397 and coreboot v2 svn r3903.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Signed-off-by: Peter Stuge <peter@stuge.se>
Acked-by: Peter Stuge <peter@stuge.se>
Diffstat (limited to 'flash.h')
-rw-r--r-- | flash.h | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -466,21 +466,15 @@ typedef enum { extern flashbus_t flashbus; extern void *spibar; -/* Physical memory mapping device */ -#if defined (__sun) && (defined(__i386) || defined(__amd64)) -# define MEM_DEV "/dev/xsvc" -#else -# define MEM_DEV "/dev/mem" -#endif - -extern int fd_mem; - /* debug.c */ extern int verbose; #define printf_debug(x...) { if (verbose) printf(x); } +/* physmap.c */ +void *physmap(const char *descr, unsigned long phys_addr, size_t len); +void physunmap(void *virt_addr, size_t len); + /* flashrom.c */ -void mmap_errmsg(); void map_flash_registers(struct flashchip *flash); /* layout.c */ |