From patchwork Fri Jan 23 16:35:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 5696301 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9B1D3C058D for ; Fri, 23 Jan 2015 16:36:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D475A202F0 for ; Fri, 23 Jan 2015 16:36:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A0C8202E5 for ; Fri, 23 Jan 2015 16:36:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755979AbbAWQfy (ORCPT ); Fri, 23 Jan 2015 11:35:54 -0500 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:40590 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756058AbbAWQfa (ORCPT ); Fri, 23 Jan 2015 11:35:30 -0500 Received: from e106785-lin.cambridge.arm.com ([10.1.203.153]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id t0NGZAws018471; Fri, 23 Jan 2015 16:35:17 GMT From: Andre Przywara To: penberg@kernel.org, will.deacon@arm.com Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com Subject: [PATCH 04/11] kvmtool: irq: add irq__get_nr_allocated_lines Date: Fri, 23 Jan 2015 16:35:03 +0000 Message-Id: <1422030910-17881-5-git-send-email-andre.przywara@arm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1422030910-17881-1-git-send-email-andre.przywara@arm.com> References: <1422030910-17881-1-git-send-email-andre.przywara@arm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marc Zyngier The ARM GIC emulation needs to be told the number of interrupts it has to support. As commit 1c262fa1dc7b ("kvm tools: irq: make irq__alloc_line generic") made the interrupt counter private, add a new accessor returning the number of interrupt lines we've allocated so far. Signed-off-by: Marc Zyngier Signed-off-by: Andre Przywara --- tools/kvm/include/kvm/irq.h | 1 + tools/kvm/irq.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/tools/kvm/include/kvm/irq.h b/tools/kvm/include/kvm/irq.h index 4cec6f0..8a78e43 100644 --- a/tools/kvm/include/kvm/irq.h +++ b/tools/kvm/include/kvm/irq.h @@ -11,6 +11,7 @@ struct kvm; int irq__alloc_line(void); +int irq__get_nr_allocated_lines(void); int irq__init(struct kvm *kvm); int irq__exit(struct kvm *kvm); diff --git a/tools/kvm/irq.c b/tools/kvm/irq.c index 33ea8d2..71eaa05 100644 --- a/tools/kvm/irq.c +++ b/tools/kvm/irq.c @@ -7,3 +7,8 @@ int irq__alloc_line(void) { return next_line++; } + +int irq__get_nr_allocated_lines(void) +{ + return next_line - KVM_IRQ_OFFSET; +}