From 37f3935029cef0616fa36b9c822496e3e51f03ba Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Tue, 1 Sep 2009 10:03:01 +0000 Subject: port msrtool to darwin. Signed-off-by: Stefan Reinauer Acked-by: Peter Stuge with minor changes to allow 32bit and 64bit compilation and (I hope), Peter's concerns addressed. git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4624 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/msrtool/msrtool.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'util/msrtool/msrtool.h') diff --git a/util/msrtool/msrtool.h b/util/msrtool/msrtool.h index 9fe820dd04..fa37c8507a 100644 --- a/util/msrtool/msrtool.h +++ b/util/msrtool/msrtool.h @@ -2,6 +2,7 @@ * This file is part of msrtool. * * Copyright (c) 2008 Peter Stuge + * Copyright (c) 2009 coresystems GmbH * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -22,6 +23,11 @@ #include #include +#if (defined(__MACH__) && defined(__APPLE__)) +/* DirectIO is available here: http://www.coresystems.de/en/directio */ +#define __DARWIN__ +#include +#endif #include #define HEXCHARS "0123456789abcdefABCDEF" @@ -174,6 +180,11 @@ extern int linux_open(uint8_t cpu, enum SysModes mode); extern int linux_close(uint8_t cpu); extern int linux_rdmsr(uint8_t cpu, uint32_t addr, struct msr *val); +/* darwin.c */ +extern int darwin_probe(const struct sysdef *system); +extern int darwin_open(uint8_t cpu, enum SysModes mode); +extern int darwin_close(uint8_t cpu); +extern int darwin_rdmsr(uint8_t cpu, uint32_t addr, struct msr *val); /** target externs **/ -- cgit v1.2.3