From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkwPI-0004rc-Bh for qemu-devel@nongnu.org; Tue, 18 Dec 2012 07:36:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TkwPB-0005r5-Qv for qemu-devel@nongnu.org; Tue, 18 Dec 2012 07:36:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6629) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkwPB-0005py-I0 for qemu-devel@nongnu.org; Tue, 18 Dec 2012 07:36:17 -0500 Date: Tue, 18 Dec 2012 14:39:25 +0200 From: "Michael S. Tsirkin" Message-ID: <9a971146b768656b8d9d4f7d01ba392d2c4d9989.1355833220.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: [Qemu-devel] [PATCH 2/3] msix: expose access to masked/pending state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Asias He Cc: Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org, Peter Maydell For use by poll handler. Signed-off-by: Michael S. Tsirkin --- hw/pci/msix.c | 6 +++--- hw/pci/msix.h | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/pci/msix.c b/hw/pci/msix.c index 1f31975..9df0ffb 100644 --- a/hw/pci/msix.c +++ b/hw/pci/msix.c @@ -65,7 +65,7 @@ static int msix_is_pending(PCIDevice *dev, int vector) return *msix_pending_byte(dev, vector) & msix_pending_mask(vector); } -static void msix_set_pending(PCIDevice *dev, int vector) +void msix_set_pending(PCIDevice *dev, unsigned int vector) { *msix_pending_byte(dev, vector) |= msix_pending_mask(vector); } @@ -75,13 +75,13 @@ static void msix_clr_pending(PCIDevice *dev, int vector) *msix_pending_byte(dev, vector) &= ~msix_pending_mask(vector); } -static bool msix_vector_masked(PCIDevice *dev, int vector, bool fmask) +static bool msix_vector_masked(PCIDevice *dev, unsigned int vector, bool fmask) { unsigned offset = vector * PCI_MSIX_ENTRY_SIZE + PCI_MSIX_ENTRY_VECTOR_CTRL; return fmask || dev->msix_table[offset] & PCI_MSIX_ENTRY_CTRL_MASKBIT; } -static bool msix_is_masked(PCIDevice *dev, int vector) +bool msix_is_masked(PCIDevice *dev, unsigned int vector) { return msix_vector_masked(dev, vector, dev->msix_function_masked); } diff --git a/hw/pci/msix.h b/hw/pci/msix.h index ea85d02..d0c4429 100644 --- a/hw/pci/msix.h +++ b/hw/pci/msix.h @@ -26,6 +26,9 @@ void msix_load(PCIDevice *dev, QEMUFile *f); int msix_enabled(PCIDevice *dev); int msix_present(PCIDevice *dev); +bool msix_is_masked(PCIDevice *dev, unsigned vector); +void msix_set_pending(PCIDevice *dev, unsigned vector); + int msix_vector_use(PCIDevice *dev, unsigned vector); void msix_vector_unuse(PCIDevice *dev, unsigned vector); void msix_unuse_all_vectors(PCIDevice *dev); -- MST