From 53ac3947db69be8c526958b07f59a24dbc3678be Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Mon, 26 Jan 2009 01:10:48 +0000 Subject: flashrom: Abstract mmap() in physmap.c and only open /dev/mem on the first physmap() call. Signed-off-by: Stefan Reinauer Signed-off-by: Peter Stuge Acked-by: Peter Stuge git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3903 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/flashrom/cbtable.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'util/flashrom/cbtable.c') diff --git a/util/flashrom/cbtable.c b/util/flashrom/cbtable.c index 25c3ee2d3e..284140a563 100644 --- a/util/flashrom/cbtable.c +++ b/util/flashrom/cbtable.c @@ -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); -- cgit v1.2.3