From 2284b3b0158710d78c1003e171a0692a89f0ce8d Mon Sep 17 00:00:00 2001 From: stefanct Date: Sat, 10 Jan 2015 09:33:06 +0000 Subject: Refinements for DragonflyBSD. - /usr/include/cpu/param.h defines PAGE_MASK already, hence use another name for the respective macro in nicintel_eeprom.c. - Since DragonflyBSD 3.6 DPorts is used as the default package manager. Therefore we should use /usr/local/ instead of /usr/pkg/ on default to fetch libraries. Signed-off-by: Stefan Tauner Acked-by: Stefan Tauner git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1866 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- Makefile | 6 +++--- README | 8 ++------ hwaccess.h | 2 +- nicintel_eeprom.c | 10 +++++----- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 201dd07..8cb39ed 100644 --- a/Makefile +++ b/Makefile @@ -111,8 +111,8 @@ LDFLAGS += -L/usr/pkg/lib endif ifeq ($(TARGET_OS), DragonFlyBSD) -CPPFLAGS += -I/usr/pkg/include -LDFLAGS += -L/usr/pkg/lib +CPPFLAGS += -I/usr/local/include +LDFLAGS += -L/usr/local/lib endif ifeq ($(TARGET_OS), DOS) @@ -815,7 +815,7 @@ endif define LIBPCI_TEST /* Avoid a failing test due to libpci header symbol shadowing breakage */ #define index shadow_workaround_index -#if !defined __NetBSD__ && !defined __DragonFly__ +#if !defined __NetBSD__ #include #else #include diff --git a/README b/README index b8dec83..b29784c 100644 --- a/README +++ b/README @@ -68,7 +68,7 @@ To compile on Linux, use: make -To compile on FreeBSD, use: +To compile on FreeBSD, OpenBSD or DragonFly BSD, use: gmake @@ -80,11 +80,7 @@ To compile on Solaris, use: gmake LDFLAGS="-L$pathtolibpci" CC="gcc -I$pathtopciheaders" CFLAGS=-O2 -To compile on NetBSD or DragonFly BSD (with pciutils, libftdi, libusb installed in /usr/pkg/), use: - - gmake - -To compile on OpenBSD, use: +To compile on NetBSD (with pciutils, libftdi, libusb installed in /usr/pkg/), use: gmake diff --git a/hwaccess.h b/hwaccess.h index f2b14df..a4fd502 100644 --- a/hwaccess.h +++ b/hwaccess.h @@ -40,7 +40,7 @@ */ #define index shadow_workaround_index -#if !defined (__NetBSD__) && !defined (__DragonFly__) +#if !defined (__NetBSD__) #include #else #include diff --git a/nicintel_eeprom.c b/nicintel_eeprom.c index 44bc773..7597cca 100644 --- a/nicintel_eeprom.c +++ b/nicintel_eeprom.c @@ -57,7 +57,7 @@ #define EERD_DATA 16 #define BIT(x) (1<chip->page_size = PAGE_MASK + 1; + flash->chip->page_size = EE_PAGE_MASK + 1; flash->chip->tested = TEST_OK_PREW; flash->chip->gran = write_gran_1byte_implicit_erase; - flash->chip->block_erasers->eraseblocks[0].size = (PAGE_MASK + 1); - flash->chip->block_erasers->eraseblocks[0].count = (flash->chip->total_size * 1024) / (PAGE_MASK + 1); + flash->chip->block_erasers->eraseblocks[0].size = (EE_PAGE_MASK + 1); + flash->chip->block_erasers->eraseblocks[0].count = (flash->chip->total_size * 1024) / (EE_PAGE_MASK + 1); return 1; } @@ -249,7 +249,7 @@ static int nicintel_ee_write(struct flashctx *flash, const uint8_t *buf, unsigne nicintel_ee_bitbang((buf) ? *buf++ : 0xff, NULL); len--; addr++; - if (!(addr & PAGE_MASK)) + if (!(addr & EE_PAGE_MASK)) break; } nicintel_ee_bitset(EEC, EE_CS, 1); -- cgit v1.2.1