summaryrefslogtreecommitdiff
path: root/util/inteltool/inteltool.h
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2009-09-01 09:52:14 +0000
committerStefan Reinauer <stepan@openbios.org>2009-09-01 09:52:14 +0000
commitf7f2f258d8b44218c2efb83cfb276890fd4fb95c (patch)
treed6eb6993ca8574571bfed1ca0b05835ea5850e1a /util/inteltool/inteltool.h
parentb2aedb1a3f2409b549c4094654281893b82c7435 (diff)
downloadcoreboot-f7f2f258d8b44218c2efb83cfb276890fd4fb95c.tar.xz
Clean up Mac OS X support of inteltool
Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Peter Stuge <peter@stuge.se> Some minor modifications to allow 64bit/32bit compilation on Darwin git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4621 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/inteltool/inteltool.h')
-rw-r--r--util/inteltool/inteltool.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/util/inteltool/inteltool.h b/util/inteltool/inteltool.h
index 391cd55d1d..7f9c59d96b 100644
--- a/util/inteltool/inteltool.h
+++ b/util/inteltool/inteltool.h
@@ -18,12 +18,13 @@
*/
#include <stdint.h>
-#ifndef DARWIN
+
+#if defined(__GLIBC__)
#include <sys/io.h>
-#else
-/* DirectIO is available here:
- * http://www.coresystems.de/en/directio
- */
+#endif
+#if (defined(__MACH__) && defined(__APPLE__))
+/* DirectIO is available here: http://www.coresystems.de/en/directio */
+#define __DARWIN__
#include <DirectIO/darwinio.h>
#endif
#include <pci/pci.h>
@@ -55,13 +56,13 @@
#define ARRAY_SIZE(a) ((int)(sizeof(a) / sizeof((a)[0])))
-#ifndef DARWIN
+#ifndef __DARWIN__
typedef struct { uint32_t hi, lo; } msr_t;
#endif
typedef struct { uint16_t addr; int size; char *name; } io_register_t;
-void *map_physical(unsigned long phys_addr, int len);
-void unmap_physical(void *virt_addr, int len);
+void *map_physical(unsigned long phys_addr, size_t len);
+void unmap_physical(void *virt_addr, size_t len);
unsigned int cpuid(unsigned int op);
int print_intel_core_msrs(void);