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
This commit is contained in:
Stefan Reinauer
2009-09-01 09:52:14 +00:00
committed by Stefan Reinauer
parent b2aedb1a3f
commit f7f2f258d8
4 changed files with 32 additions and 39 deletions

View File

@ -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);