From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5mEN-0004cx-F3 for qemu-devel@nongnu.org; Thu, 18 Jun 2015 22:40:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5mEL-0004LI-Pk for qemu-devel@nongnu.org; Thu, 18 Jun 2015 22:40:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5mEL-0004L7-Kl for qemu-devel@nongnu.org; Thu, 18 Jun 2015 22:40:33 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 452852D1572 for ; Fri, 19 Jun 2015 02:40:33 +0000 (UTC) From: Laszlo Ersek Date: Fri, 19 Jun 2015 04:40:12 +0200 Message-Id: <1434681617-15539-6-git-send-email-lersek@redhat.com> In-Reply-To: <1434681617-15539-1-git-send-email-lersek@redhat.com> References: <1434681617-15539-1-git-send-email-lersek@redhat.com> Subject: [Qemu-devel] [PATCH v7 05/10] hw/pci: introduce shpc_present() helper function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, lersek@redhat.com Cc: Marcel Apfelbaum , "Michael S. Tsirkin" It follows msi_present() in "include/hw/pci/msi.h". Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Signed-off-by: Laszlo Ersek --- Notes: v7: - new in v7 [Michael] include/hw/pci/shpc.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/hw/pci/shpc.h b/include/hw/pci/shpc.h index 14015af..2c871b9 100644 --- a/include/hw/pci/shpc.h +++ b/include/hw/pci/shpc.h @@ -6,6 +6,7 @@ #include "migration/vmstate.h" #include "qapi/error.h" #include "hw/hotplug.h" +#include "hw/pci/pci.h" struct SHPCDevice { /* Capability offset in device's config space */ @@ -55,4 +56,9 @@ extern VMStateInfo shpc_vmstate_info; VMSTATE_BUFFER_UNSAFE_INFO_TEST(_field, _type, _test, 0, \ shpc_vmstate_info, 0) +static inline bool shpc_present(const PCIDevice *dev) +{ + return dev->cap_present & QEMU_PCI_CAP_SHPC; +} + #endif -- 1.8.3.1