2009-07-17  Ozkan Sezer  <sezeroz@gmail.com>
	    Kai Tietz  <kai.tietz@onevision.com>

	* misc/io_intrin.c: Deleted. Broken out its contents, one function
	per file, into new sources in the 'intrincs' directory.
	* intrincs/cpuid.c, intrincs/inbyte.c, intrincs/inbytestring.c,
	intrincs/indword.c, intrincs/indwordstring.c, intrincs/inword.c,
	intrincs/inwordstring.c, intrincs/outbyte.c, intrincs/outbytestring.c,
	intrincs/outdword.c, intrincs/outdwordstring.c, intrincs/outword.c,
	intrincs/outwordstring.c, intrincs/rdtsc.c, intrincs/readcr2.c,
	intrincs/readcr3.c, intrincs/readcr4.c, intrincs/readcr8.c,
	intrincs/readmsr.c, intrincs/writecr0.c, intrincs/writecr2.c,
	intrincs/writecr3.c, intrincs/writecr4.c, intrincs/writecr8.c,
	intrincs/writemsr.c: New.
	* Makefile.am: Removed misc/io_intrin.c from build. Adjusted for the
	new intrincs/*.c files.
	* Makefile.in: Regenerated.


git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@1030 4407c894-4637-0410-b4f5-ada5f102cad1
diff --git a/mingw-w64-crt/intrincs/writemsr.c b/mingw-w64-crt/intrincs/writemsr.c
new file mode 100644
index 0000000..b00da8c
--- /dev/null
+++ b/mingw-w64-crt/intrincs/writemsr.c
@@ -0,0 +1,17 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+
+#include <_mingw.h>
+
+  void __writemsr (unsigned long msr, unsigned __int64 Value)
+  {
+    unsigned long val1 = Value, val2 = Value >> 32;
+   __asm__ __volatile__ (
+       "wrmsr"
+       :
+       : "c" (msr), "a" (val1), "d" (val2));
+  }
+