Unify mmap error messages
Corresponding to flashrom svn r112 and coreboot v2 svn r2690.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
diff --git a/82802ab.c b/82802ab.c
index 9512c67..199cf4d 100644
--- a/82802ab.c
+++ b/82802ab.c
@@ -83,7 +83,7 @@
fd_mem, (off_t) (0 - 0x400000 - size));
if (registers == MAP_FAILED) {
// it's this part but we can't map it ...
- perror("Error MMAP memory using " MEM_DEV);
+ perror("Can't mmap memory using " MEM_DEV);
exit(1);
}
diff --git a/flashrom.c b/flashrom.c
index cd97dda..a05def7 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -116,15 +116,16 @@
#ifdef TS5300
// FIXME: Wrong place for this decision
+ // FIXME: This should be autodetected. It is trivial.
flash_baseaddr = 0x9400000;
#else
flash_baseaddr = (0xffffffff - size + 1);
#endif
/* If getpagesize() > size ->
- * `Error MMAP /dev/mem: Invalid argument'
+ * "Can't mmap memory using /dev/mem: Invalid argument"
* This should never happen as we don't support any flash chips
- * smaller than 4k or 8k yet.
+ * smaller than 4k or 8k (yet).
*/
if (getpagesize() > size) {
@@ -136,7 +137,7 @@
bios = mmap(0, size, PROT_WRITE | PROT_READ, MAP_SHARED,
fd_mem, (off_t) flash_baseaddr);
if (bios == MAP_FAILED) {
- perror("Error: Can't mmap " MEM_DEV ".");
+ perror("Can't mmap memory using " MEM_DEV);
exit(1);
}
flash->virtual_memory = bios;
diff --git a/lbtable.c b/lbtable.c
index d65d1a0..bbee991 100644
--- a/lbtable.c
+++ b/lbtable.c
@@ -161,9 +161,7 @@
low_1MB = mmap(0, 1024 * 1024, PROT_READ, MAP_SHARED, fd_mem,
0x00000000);
if (low_1MB == MAP_FAILED) {
- fprintf(stderr,
- "Can not mmap " MEM_DEV " at %08lx errno(%d):%s\n",
- 0x00000000UL, errno, strerror(errno));
+ perror("Can't mmap memory using " MEM_DEV);
exit(-2);
}
lb_table = 0;
diff --git a/sharplhf00l04.c b/sharplhf00l04.c
index fd3a714..a4d086e 100644
--- a/sharplhf00l04.c
+++ b/sharplhf00l04.c
@@ -82,7 +82,7 @@
fd_mem, (off_t) (0 - 0x400000 - size));
if (registers == MAP_FAILED) {
// it's this part but we can't map it ...
- perror("Error MMAP /dev/mem");
+ perror("Can't mmap memory using " MEM_DEV);
exit(1);
}
diff --git a/sst49lfxxxc.c b/sst49lfxxxc.c
index efa2a61..b8f4b84 100644
--- a/sst49lfxxxc.c
+++ b/sst49lfxxxc.c
@@ -154,7 +154,7 @@
fd_mem, (off_t) (0xFFFFFFFF - 0x400000 - size + 1));
if (registers == MAP_FAILED) {
// it's this part but we can't map it ...
- perror("Error MMAP /dev/mem");
+ perror("Can't mmap memory using " MEM_DEV);
exit(1);
}
flash->virtual_registers = registers;
diff --git a/sst_fwhub.c b/sst_fwhub.c
index 72a8453..78589b1 100644
--- a/sst_fwhub.c
+++ b/sst_fwhub.c
@@ -56,7 +56,7 @@
fd_mem, (off_t) (0xFFFFFFFF - 0x400000 - size + 1));
if (registers == MAP_FAILED) {
// it's this part but we can't map it ...
- perror("Error MMAP /dev/mem");
+ perror("Can't mmap memory using " MEM_DEV);
exit(1);
}