[coreboot] [v2] r4723 - trunk/util/msrtool

svn at coreboot.org svn at coreboot.org
Mon Oct 5 12:23:36 CEST 2009


Author: stepan
Date: 2009-10-05 12:23:36 +0200 (Mon, 05 Oct 2009)
New Revision: 4723

Modified:
   trunk/util/msrtool/darwin.c
Log:
fix building on Linux again, working around crude runtime OS detection.

Signed-off-by: Stefan Reinauer <stepan at coresystems.de>
Acked-by: Stefan Reinauer <stepan at coresystems.de>



Modified: trunk/util/msrtool/darwin.c
===================================================================
--- trunk/util/msrtool/darwin.c	2009-10-05 00:07:12 UTC (rev 4722)
+++ trunk/util/msrtool/darwin.c	2009-10-05 10:23:36 UTC (rev 4723)
@@ -37,11 +37,15 @@
 
 int darwin_open(uint8_t cpu, enum SysModes mode)
 {
+#ifdef __DARWIN__
 	if (cpu > 0) {
 		fprintf(stderr, "%s: only core 0 is supported on Mac OS X right now.\n", __func__);
 		return 0;
 	}
 	return 1;
+#else
+	return 0;
+#endif
 }
 
 int darwin_close(uint8_t cpu)
@@ -51,6 +55,7 @@
 
 int darwin_rdmsr(uint8_t cpu, uint32_t addr, struct msr *val)
 {
+#ifdef __DARWIN__
 	msr_t msr;
 
 	msr = rdmsr(addr);
@@ -58,4 +63,7 @@
 	val->hi = msr.lo;
 	val->lo = msr.hi;
 	return 1;
+#else
+	return 0;
+#endif
 }





More information about the coreboot mailing list