summaryrefslogtreecommitdiffstats
path: root/hwaccess.h
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@coresystems.de>2010-09-30 17:03:32 +0000
committerPatrick Georgi <patrick.georgi@coresystems.de>2010-09-30 17:03:32 +0000
commit3ec743b0df7fc7596ef3484ceb8feb6bcfbb9ecc (patch)
treef79ff036266bb09b180f27b3552dd30116a221e4 /hwaccess.h
parentbcffd595d818d8a8729e20f224c307437520749a (diff)
downloadflashrom-3ec743b0df7fc7596ef3484ceb8feb6bcfbb9ecc.zip
flashrom-3ec743b0df7fc7596ef3484ceb8feb6bcfbb9ecc.tar.gz
Add support for building flashrom against libpayload
This doesn't include changes to the frontend which must be done separately, so this won't work out of the box. This code was tested on hardware. Corresponding to flashrom svn r1184. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'hwaccess.h')
-rw-r--r--hwaccess.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/hwaccess.h b/hwaccess.h
index 2d17326..45629d2 100644
--- a/hwaccess.h
+++ b/hwaccess.h
@@ -292,7 +292,7 @@ static inline uint32_t inl(uint16_t port)
#endif
#endif
-#if !defined(__DARWIN__) && !defined(__FreeBSD__) && !defined(__DragonFly__)
+#if !defined(__DARWIN__) && !defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__LIBPAYLOAD__)
typedef struct { uint32_t hi, lo; } msr_t;
msr_t rdmsr(int addr);
int wrmsr(int addr, msr_t msr);
@@ -307,6 +307,16 @@ typedef struct { uint32_t hi, lo; } msr_t;
msr_t freebsd_rdmsr(int addr);
int freebsd_wrmsr(int addr, msr_t msr);
#endif
+#if defined(__LIBPAYLOAD__)
+#include <arch/io.h>
+#include <arch/msr.h>
+typedef struct { uint32_t hi, lo; } msr_t;
+msr_t libpayload_rdmsr(int addr);
+int libpayload_wrmsr(int addr, msr_t msr);
+#undef rdmsr
+#define rdmsr libpayload_rdmsr
+#define wrmsr libpayload_wrmsr
+#endif
#elif defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__) || defined(__ppc64__)
OpenPOWER on IntegriCloud