summaryrefslogtreecommitdiffstats
path: root/hwaccess.h
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2012-02-25 22:50:21 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2012-02-25 22:50:21 +0000
commita5eecdab44ab3e02b15c461cf25f79603c89a41a (patch)
tree734a5c79ce8f2fdd2c7a463ac9a31da8fa128781 /hwaccess.h
parent2d2512453b9a27e4da9a82c5eafb4ad3fcf55d20 (diff)
downloadast2050-flashrom-a5eecdab44ab3e02b15c461cf25f79603c89a41a.zip
ast2050-flashrom-a5eecdab44ab3e02b15c461cf25f79603c89a41a.tar.gz
Support Debian/kFreeBSD
Corresponding to flashrom svn r1507. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Tested-by: Robert Millan <rmh@debian.org> Tested-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'hwaccess.h')
-rw-r--r--hwaccess.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/hwaccess.h b/hwaccess.h
index c10b12e..1e276ec 100644
--- a/hwaccess.h
+++ b/hwaccess.h
@@ -189,6 +189,10 @@ cpu_to_be(64)
*/
#if defined(__FreeBSD__) || defined(__DragonFly__)
+ /* Note that Debian/kFreeBSD (FreeBSD kernel with glibc) has conflicting
+ * out[bwl] definitions in machine/cpufunc.h and sys/io.h at least in some
+ * versions. Use machine/cpufunc.h only for plain FreeBSD/DragonFlyBSD.
+ */
#include <machine/cpufunc.h>
#define off64_t off_t
#define lseek64 lseek
@@ -228,7 +232,7 @@ cpu_to_be(64)
#define INL inportl
#else
-
+ /* This is the usual glibc interface. */
#define OUTB outb
#define OUTW outw
#define OUTL outl
@@ -299,12 +303,12 @@ static inline uint32_t inl(uint16_t port)
#endif
#endif
-#if !defined(__DARWIN__) && !defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__LIBPAYLOAD__)
+#if !defined(__DARWIN__) && !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__DragonFly__) && !defined(__LIBPAYLOAD__)
typedef struct { uint32_t hi, lo; } msr_t;
msr_t rdmsr(int addr);
int wrmsr(int addr, msr_t msr);
#endif
-#if defined(__FreeBSD__) || defined(__DragonFly__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
/* FreeBSD already has conflicting definitions for wrmsr/rdmsr. */
#undef rdmsr
#undef wrmsr
OpenPOWER on IntegriCloud