]> xenbits.xensource.com Git - osstest/qemu.git/commitdiff
hw/pci: introduce shpc_present() helper function
authorLaszlo Ersek <lersek@redhat.com>
Fri, 19 Jun 2015 02:40:12 +0000 (04:40 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 23 Jun 2015 20:57:48 +0000 (22:57 +0200)
It follows msi_present() in "include/hw/pci/msi.h".

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
include/hw/pci/shpc.h

index 14015afd06034afc93b4ba2697e82c6da27b752b..2c871b947b80cbfae2d7808bcc837c052f866d20 100644 (file)
@@ -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