From 507a34b3d0980a52a108019e5ed0f53d984ca00a Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Tue, 28 Jan 2020 14:48:06 +0100 Subject: [PATCH] hw/x86: implement wrmsr in macro Issue #3623 --- repos/base-hw/src/include/hw/spec/x86_64/register_macros.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/repos/base-hw/src/include/hw/spec/x86_64/register_macros.h b/repos/base-hw/src/include/hw/spec/x86_64/register_macros.h index 186b0d19a..15eec2296 100644 --- a/repos/base-hw/src/include/hw/spec/x86_64/register_macros.h +++ b/repos/base-hw/src/include/hw/spec/x86_64/register_macros.h @@ -43,7 +43,9 @@ return (high << 32) | (low & ~0U); \ } \ \ - static void write(access_t const) { } \ + static void write(access_t const value) { \ + asm volatile ("wrmsr" : : "a" (value), "d" (value >> 32), "c" (msr)); \ + } \ \ __VA_ARGS__; \ };