From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8TxS-0006Jf-9t for qemu-devel@nongnu.org; Fri, 26 Jun 2015 09:46:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8TxR-0001dB-De for qemu-devel@nongnu.org; Fri, 26 Jun 2015 09:46:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8TxR-0001d7-61 for qemu-devel@nongnu.org; Fri, 26 Jun 2015 09:46:17 -0400 Date: Fri, 26 Jun 2015 15:46:14 +0200 From: "Michael S. Tsirkin" Message-ID: <1435326248-24291-13-git-send-email-mst@redhat.com> References: <1435326248-24291-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1435326248-24291-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 12/17] hw/pci: introduce shpc_present() helper function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Peter Maydell , Laszlo Ersek From: Laszlo Ersek It follows msi_present() in "include/hw/pci/msi.h". Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Signed-off-by: Laszlo Ersek Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- 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 -- MST