diff options
author | stuge <stuge@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2009-01-26 01:10:48 +0000 |
---|---|---|
committer | stuge <stuge@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2009-01-26 01:10:48 +0000 |
commit | e1d68a6da23bfcfbe54274c0f1b2e75947cf161d (patch) | |
tree | a542b94c7b06b0242a00a3e6c538a475bb2f86e5 /cbtable.c | |
parent | c14b3b74e476730d8ca954769d87544910da589c (diff) | |
download | flashrom-e1d68a6da23bfcfbe54274c0f1b2e75947cf161d.tar.gz |
Original v2 revision: 3903
flashrom: Abstract mmap() in physmap.c and only open /dev/mem on the first physmap() call.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Signed-off-by: Peter Stuge <peter@stuge.se>
Acked-by: Peter Stuge <peter@stuge.se>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@397 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'cbtable.c')
-rw-r--r-- | cbtable.c | 8 |
1 files changed, 1 insertions, 7 deletions
@@ -188,13 +188,7 @@ int coreboot_init(void) struct lb_header *lb_table; struct lb_record *rec, *last; - low_1MB = mmap(0, 1024 * 1024, PROT_READ, MAP_SHARED, fd_mem, - 0x00000000); - if (low_1MB == MAP_FAILED) { - perror("Can't mmap memory using " MEM_DEV); - mmap_errmsg(); - exit(-2); - } + low_1MB = physmap("low megabyte", 0x0, 1024*1024); lb_table = find_lb_table(low_1MB, 0x00000, 0x1000); if (!lb_table) lb_table = find_lb_table(low_1MB, 0xf0000, 1024*1024); |