summaryrefslogtreecommitdiffstats
path: root/cbtable.c
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2009-01-26 01:10:48 +0000
committerPeter Stuge <peter@stuge.se>2009-01-26 01:10:48 +0000
commit0593f21f1049e2dc8df1e2920c29ce9e93f7a663 (patch)
treea542b94c7b06b0242a00a3e6c538a475bb2f86e5 /cbtable.c
parent776d2021fd27ada1874cbe795b57f3cce1834c8b (diff)
downloadflashrom-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 'cbtable.c')
-rw-r--r--cbtable.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/cbtable.c b/cbtable.c
index 25c3ee2d3..284140a56 100644
--- a/cbtable.c
+++ b/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);