summaryrefslogtreecommitdiff
path: root/util/flashrom/lbtable.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/flashrom/lbtable.c')
-rw-r--r--util/flashrom/lbtable.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/util/flashrom/lbtable.c b/util/flashrom/lbtable.c
index f98267273e..82119b1294 100644
--- a/util/flashrom/lbtable.c
+++ b/util/flashrom/lbtable.c
@@ -7,6 +7,7 @@
#include <string.h>
#include <errno.h>
#include <sys/mman.h>
+#include "flash.h"
#include "../../src/include/boot/linuxbios_tables.h"
#include "debug.h"
@@ -158,14 +159,14 @@ int linuxbios_init(void)
struct lb_record *rec, *last;
int fd;
- fd = open("/dev/mem", O_RDONLY);
+ fd = open(MEM_DEV, O_RDONLY);
if (fd < 0) {
- fprintf(stderr, "Can not open /dev/mem\n");
+ fprintf(stderr, "Can not access memory using " MEM_DEV "\n");
exit(-1);
}
low_1MB = mmap(0, 1024*1024, PROT_READ, MAP_SHARED, fd, 0x00000000);
if (low_1MB == ((void *) -1)) {
- fprintf(stderr, "Can not mmap /dev/mem at %08lx errno(%d):%s\n",
+ fprintf(stderr, "Can not mmap " MEM_DEV " at %08lx errno(%d):%s\n",
0x00000000UL, errno, strerror(errno));
exit(-2);
}