From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roman Kagan Subject: [PATCH kvm-unit-tests 1/5] hyperv: move test dev control codes to C file Date: Tue, 6 Jun 2017 22:19:55 +0300 Message-ID: <20170606191959.16987-2-rkagan@virtuozzo.com> References: <20170606191959.16987-1-rkagan@virtuozzo.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Evgeny Yakovlev , "Denis V . Lunev" To: kvm@vger.kernel.org Return-path: Received: from mail-eopbgr50130.outbound.protection.outlook.com ([40.107.5.130]:10039 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751687AbdFFTU2 (ORCPT ); Tue, 6 Jun 2017 15:20:28 -0400 In-Reply-To: <20170606191959.16987-1-rkagan@virtuozzo.com> Sender: kvm-owner@vger.kernel.org List-ID: hyperv_testdev control codes aren't used outside hyperv.c so move them there. While at this, adjust the types to avoid surprizes with left shifts. Signed-off-by: Roman Kagan --- x86/hyperv.h | 6 ------ x86/hyperv.c | 9 ++++++++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/x86/hyperv.h b/x86/hyperv.h index bef0317..553c588 100644 --- a/x86/hyperv.h +++ b/x86/hyperv.h @@ -155,12 +155,6 @@ struct hv_message_page { struct hv_message sint_message[HV_SYNIC_SINT_COUNT]; }; -enum { - HV_TEST_DEV_SINT_ROUTE_CREATE = 1, - HV_TEST_DEV_SINT_ROUTE_DESTROY, - HV_TEST_DEV_SINT_ROUTE_SET_SINT -}; - static inline bool synic_supported(void) { return cpuid(HYPERV_CPUID_FEATURES).a & HV_X64_MSR_SYNIC_AVAILABLE; diff --git a/x86/hyperv.c b/x86/hyperv.c index 2511aa2..aa55614 100644 --- a/x86/hyperv.c +++ b/x86/hyperv.c @@ -1,7 +1,14 @@ #include "hyperv.h" #include "asm/io.h" +#include "smp.h" -static void synic_ctl(u8 ctl, u8 vcpu_id, u8 sint) +enum { + HV_TEST_DEV_SINT_ROUTE_CREATE = 1, + HV_TEST_DEV_SINT_ROUTE_DESTROY, + HV_TEST_DEV_SINT_ROUTE_SET_SINT, +}; + +static void synic_ctl(u32 ctl, u32 vcpu_id, u32 sint) { outl((ctl << 16)|((vcpu_id) << 8)|sint, 0x3000); } -- 2.9.4