blob: c0f0b2bb422626347af7e117ae48970ac88380fe [file] [log] [blame]
Ozkan Sezer4fba91a2009-07-17 16:47:16 +00001/**
2 * This file has no copyright assigned and is placed in the Public Domain.
Rafaël Carré8a67ab42012-06-28 15:40:59 +00003 * This file is part of the mingw-w64 runtime package.
Kai Tietzfa0cfe32010-01-15 20:02:21 +00004 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
Ozkan Sezer4fba91a2009-07-17 16:47:16 +00005 */
6
Ozkan Sezer3d415922009-09-08 18:30:08 +00007#include <intrin.h>
Ozkan Sezer4fba91a2009-07-17 16:47:16 +00008
Corinna Vinschen00989892013-04-05 11:19:50 +00009void __writemsr (unsigned __LONG32 msr, unsigned __int64 Value)
Ozkan Sezer3d415922009-09-08 18:30:08 +000010{
Corinna Vinschen00989892013-04-05 11:19:50 +000011 unsigned __LONG32 val1 = Value, val2 = Value >> 32;
Ozkan Sezer4fba91a2009-07-17 16:47:16 +000012 __asm__ __volatile__ (
13 "wrmsr"
14 :
15 : "c" (msr), "a" (val1), "d" (val2));
Ozkan Sezer3d415922009-09-08 18:30:08 +000016}
Ozkan Sezer4fba91a2009-07-17 16:47:16 +000017