diff options
author | Adam Kaufman <adam.kaufman@pinnacle.com> | 2007-02-06 19:47:50 +0000 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2007-02-06 19:47:50 +0000 |
commit | 064b1f23fa507878bddca3c308e5e6034b06c998 (patch) | |
tree | 53d889789d8317e36e0f3238902e3d268fd5d05e /lbtable.c | |
parent | 474230ad421b2e2e4ca26493292d224a22a262c2 (diff) | |
download | ast2050-flashrom-064b1f23fa507878bddca3c308e5e6034b06c998.zip ast2050-flashrom-064b1f23fa507878bddca3c308e5e6034b06c998.tar.gz |
This patch is a rework of Adam Kaufman's Solaris patch
* flash.h:
- add a license header
- add system definitions
* flash_enable.c:
- put io priviledge access in one single place
- add includes required for Solaris.
* lbtable.c, flash_rom.c, 82802ab.c:
- use MEM_DEV so it works on Solaris
* sst49lfxxxc.c, sharplhf00l04.c, sst_fwhub.c, 82802ab.c
- drop unneeded include to sys/io.h
* Makefile
- adapt to Solaris specifics.
Corresponding to flashrom svn r88 and coreboot v2 svn r2550.
Signed-off-by: Adam Kaufman <adam.kaufman@pinnacle.com>
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Adam Kaufman <adam.kaufman@pinnacle.com>
Diffstat (limited to 'lbtable.c')
-rw-r--r-- | lbtable.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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); } |