From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Subject: [PATCH v3 03/10] irq: add irq__get_nr_allocated_lines Date: Wed, 17 Jun 2015 12:21:54 +0100 Message-ID: <1434540121-21283-4-git-send-email-andre.przywara@arm.com> References: <1434540121-21283-1-git-send-email-andre.przywara@arm.com> Cc: penberg@kernel.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org To: will.deacon@arm.com, marc.zyngier@arm.com Return-path: Received: from foss.arm.com ([217.140.101.70]:39169 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753098AbbFQLVx (ORCPT ); Wed, 17 Jun 2015 07:21:53 -0400 In-Reply-To: <1434540121-21283-1-git-send-email-andre.przywara@arm.com> Sender: kvm-owner@vger.kernel.org List-ID: From: Marc Zyngier The ARM GIC emulation needs to be told the number of interrupts it has to support. As commit 1c262fa1dc7bc ("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 --- include/kvm/irq.h | 1 + irq.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/kvm/irq.h b/include/kvm/irq.h index 4cec6f0..8a78e43 100644 --- a/include/kvm/irq.h +++ b/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/irq.c b/irq.c index 33ea8d2..71eaa05 100644 --- a/irq.c +++ b/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; +} -- 2.3.5 From mboxrd@z Thu Jan 1 00:00:00 1970 From: andre.przywara@arm.com (Andre Przywara) Date: Wed, 17 Jun 2015 12:21:54 +0100 Subject: [PATCH v3 03/10] irq: add irq__get_nr_allocated_lines In-Reply-To: <1434540121-21283-1-git-send-email-andre.przywara@arm.com> References: <1434540121-21283-1-git-send-email-andre.przywara@arm.com> Message-ID: <1434540121-21283-4-git-send-email-andre.przywara@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org From: Marc Zyngier The ARM GIC emulation needs to be told the number of interrupts it has to support. As commit 1c262fa1dc7bc ("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 --- include/kvm/irq.h | 1 + irq.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/kvm/irq.h b/include/kvm/irq.h index 4cec6f0..8a78e43 100644 --- a/include/kvm/irq.h +++ b/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/irq.c b/irq.c index 33ea8d2..71eaa05 100644 --- a/irq.c +++ b/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; +} -- 2.3.5