From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amit Shah Subject: Re: [PATCH 3/7] qemu: piix: Introduce functions to get pin number from irq and vice versa Date: Wed, 24 Sep 2008 09:58:00 +0530 Message-ID: <200809240958.00379.amit.shah@redhat.com> References: <1222181695-23418-1-git-send-email-amit.shah@redhat.com> <1222181695-23418-4-git-send-email-amit.shah@redhat.com> <48D915A6.4080706@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: avi@redhat.com, kvm@vger.kernel.org, muli@il.ibm.com, benami@il.ibm.com, weidong.han@intel.com, allen.m.kay@intel.com To: Anthony Liguori Return-path: Received: from mx1.redhat.com ([66.187.233.31]:43535 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751239AbYIXEag (ORCPT ); Wed, 24 Sep 2008 00:30:36 -0400 In-Reply-To: <48D915A6.4080706@codemonkey.ws> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: * On Tuesday 23 Sep 2008 21:43:26 Anthony Liguori wrote: > Amit Shah wrote: > > Signed-off-by: Amit Shah > > --- > > qemu/hw/piix_pci.c | 19 +++++++++++++++++++ > > 1 files changed, 19 insertions(+), 0 deletions(-) > > > > diff --git a/qemu/hw/piix_pci.c b/qemu/hw/piix_pci.c > > index 6fbf47b..dc12c8a 100644 > > --- a/qemu/hw/piix_pci.c > > +++ b/qemu/hw/piix_pci.c > > @@ -243,6 +243,25 @@ static void piix3_set_irq(qemu_irq *pic, int > > irq_num, int level) } > > } > > > > +int piix3_get_pin(int pic_irq) > > +{ > > + int i; > > + for (i = 0; i < 4; i++) > > + if (piix3_dev->config[0x60+i] == pic_irq) > > + return i; > > + return -1; > > +} > > + > > +int piix_get_irq(int pin) > > +{ > > + if (piix3_dev) > > + return piix3_dev->config[0x60+pin]; > > + if (piix4_dev) > > + return piix4_dev->config[0x60+pin]; > > + > > + return 0; > > +} > > + > > If these are being exported, don't they need to be declared in a header? I'll put then in a header.