Commit 43438ba7 authored by Peter Stuge's avatar Peter Stuge
Browse files

exit(2) on /dev/mem open() failure and exit(3) on mmap() failure


Corresponding to flashrom svn r401 and coreboot v2 svn r3907.
Signed-off-by: default avatarPeter Stuge <peter@stuge.se>
Acked-by: default avatarWard Vandewege <ward@gnu.org>
parent 33fefcad
...@@ -57,7 +57,7 @@ void *sys_physmap(unsigned long phys_addr, size_t len) ...@@ -57,7 +57,7 @@ void *sys_physmap(unsigned long phys_addr, size_t len)
/* Open the memory device UNCACHED. Important for MMIO. */ /* Open the memory device UNCACHED. Important for MMIO. */
if (-1 == (fd_mem = open(MEM_DEV, O_RDWR|O_SYNC))) { if (-1 == (fd_mem = open(MEM_DEV, O_RDWR|O_SYNC))) {
perror("Critical error: open(" MEM_DEV ")"); perror("Critical error: open(" MEM_DEV ")");
exit(1); exit(2);
} }
} }
...@@ -87,7 +87,7 @@ void *physmap(const char *descr, unsigned long phys_addr, size_t len) ...@@ -87,7 +87,7 @@ void *physmap(const char *descr, unsigned long phys_addr, size_t len)
fprintf(stderr, "You can override CONFIG_X86_PAT at boot with the nopat kernel parameter but\n"); fprintf(stderr, "You can override CONFIG_X86_PAT at boot with the nopat kernel parameter but\n");
fprintf(stderr, "disabling the other option unfortunately requires a kernel recompile. Sorry!\n"); fprintf(stderr, "disabling the other option unfortunately requires a kernel recompile. Sorry!\n");
} }
exit(1); exit(3);
} }
return virt_addr; return virt_addr;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment