Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932136AbbLAWSM (ORCPT ); Tue, 1 Dec 2015 17:18:12 -0500 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]:37989 "EHLO smtp-outbound-2.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932114AbbLAWSJ (ORCPT ); Tue, 1 Dec 2015 17:18:09 -0500 From: "Sinclair Yeh" To: x86@kernel.org Cc: Sinclair Yeh , pv-drivers@vmware.com, Xavier Deguillard , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: [PATCH 6/6] VMware balloon: Update vmw_balloon.c to use the VMW_PORT macro Date: Tue, 1 Dec 2015 14:18:52 -0800 Message-Id: <1449008332-9394-6-git-send-email-syeh@vmware.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1449008332-9394-1-git-send-email-syeh@vmware.com> References: <1449008047-8252-1-git-send-email-syeh@vmware.com> <1449008332-9394-1-git-send-email-syeh@vmware.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2207 Lines: 66 Signed-off-by: Sinclair Yeh Reviewed-by: Thomas Hellstrom Reviewed-by: Alok N Kataria Cc: pv-drivers@vmware.com Cc: Xavier Deguillard Cc: linux-kernel@vger.kernel.org Cc: virtualization@lists.linux-foundation.org --- drivers/misc/vmw_balloon.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c index ffb5634..90a0d07 100644 --- a/drivers/misc/vmw_balloon.c +++ b/drivers/misc/vmw_balloon.c @@ -43,6 +43,7 @@ #include #include #include +#include MODULE_AUTHOR("VMware, Inc."); MODULE_DESCRIPTION("VMware Memory Control (Balloon) Driver"); @@ -142,23 +143,17 @@ enum vmwballoon_capabilities { #define VMW_BALLOON_SUCCESS_WITH_CAPABILITIES (0x03000000) -#define VMWARE_BALLOON_CMD(cmd, data, result) \ -({ \ - unsigned long __status, __dummy1, __dummy2; \ - __asm__ __volatile__ ("inl %%dx" : \ - "=a"(__status), \ - "=c"(__dummy1), \ - "=d"(__dummy2), \ - "=b"(result) : \ - "0"(VMW_BALLOON_HV_MAGIC), \ - "1"(VMW_BALLOON_CMD_##cmd), \ - "2"(VMW_BALLOON_HV_PORT), \ - "3"(data) : \ - "memory"); \ - if (VMW_BALLOON_CMD_##cmd == VMW_BALLOON_CMD_START) \ - result = __dummy1; \ - result &= -1UL; \ - __status & -1UL; \ +#define VMWARE_BALLOON_CMD(cmd, data, result) \ +({ \ + unsigned long __status, __dummy1, __dummy2; \ + unsigned long __si = 0, __di = 0; \ + VMW_PORT(data, VMW_BALLOON_CMD_##cmd, VMW_BALLOON_HV_PORT, \ + VMW_BALLOON_HV_MAGIC, \ + __status, result, __dummy1, __dummy2, __si, __di);\ + if (VMW_BALLOON_CMD_##cmd == VMW_BALLOON_CMD_START) \ + result = __dummy1; \ + result &= -1UL; \ + __status & -1UL; \ }) #ifdef CONFIG_DEBUG_FS -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/