From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH 3/7] qemu: piix: Introduce functions to get pin number from irq and vice versa Date: Tue, 23 Sep 2008 11:13:26 -0500 Message-ID: <48D915A6.4080706@codemonkey.ws> References: <1222181695-23418-1-git-send-email-amit.shah@redhat.com> <1222181695-23418-2-git-send-email-amit.shah@redhat.com> <1222181695-23418-3-git-send-email-amit.shah@redhat.com> <1222181695-23418-4-git-send-email-amit.shah@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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: Amit Shah Return-path: Received: from an-out-0708.google.com ([209.85.132.250]:42106 "EHLO an-out-0708.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751909AbYIWQO0 (ORCPT ); Tue, 23 Sep 2008 12:14:26 -0400 Received: by an-out-0708.google.com with SMTP id d40so181219and.103 for ; Tue, 23 Sep 2008 09:14:25 -0700 (PDT) In-Reply-To: <1222181695-23418-4-git-send-email-amit.shah@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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? Regards, Anthony Liguori > static void piix3_reset(PCIDevice *d) > { > uint8_t *pci_conf = d->config; >