From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34959) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3d3s-0001Ge-VW for qemu-devel@nongnu.org; Sun, 28 Jul 2013 22:19:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3d3k-0001mu-Ct for qemu-devel@nongnu.org; Sun, 28 Jul 2013 22:19:48 -0400 Received: from mail-pa0-x22e.google.com ([2607:f8b0:400e:c03::22e]:61039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3d3k-0001k7-5U for qemu-devel@nongnu.org; Sun, 28 Jul 2013 22:19:40 -0400 Received: by mail-pa0-f46.google.com with SMTP id fa1so5305344pad.33 for ; Sun, 28 Jul 2013 19:19:38 -0700 (PDT) Date: Mon, 29 Jul 2013 10:19:34 +0800 From: "andysycrane@gmail.com" Mime-Version: 1.0 Message-ID: <2013072910193137593912@gmail.com> Content-Type: multipart/alternative; boundary="----=_001_NextPart834575212631_=----" Subject: [Qemu-devel] How to add a IRQ to QEMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Cc: =?GB2312?B?UmVtcGVsLCBDeW50aGlh?= This is a multi-part message in MIME format. ------=_001_NextPart834575212631_=---- Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: base64 SGksIGFsbA0KSSB3YW50IHRvIGFkZCBhIHBjaSBkZXZpY2UganVzdCBsaWtlIHBjaS1zZXJpYWwg dG8gUUVNVSwgdGhlcmUgYXJlIHNvbWUgcWV1c3Rpb24gd2hpbGUgYWRkIGEgSVJRLg0KDQpJbiB0 aGUgaW5pdCgpIGZ1bmN0aW9uLA0KcGNpLT5kZXYuY29uZmlnW1BDSV9JTlRFUlJVUFRfUElOXSA9 IDB4MDE7DQpzLT5pcnEgPSBwY2ktPmRldi5pcnFbMF07DQoNCkluIHRoZSB3cml0ZSgpIGZ1bmN0 aW9uDQpxZW11X2lycV9yYWlzZShzLT5pcnEpOw0KaWYgKHZhbCAmIDB4ZmYpID09IDB4OTkpDQpx ZW11X2lycV9sb3cocy0+aXJxKTsNCg0KV2hhdCBpIHdhbnQgdG8gZG8gaXMgZ2VuZXJhdGUgYW4g aW50ZXJydXB0IHdoZW4gd3JpdGUgdG8gaW8gcG9ydCwgYW5kIHRoZW4gdGhlIGludGVycnVwdCBy b3V0aW5lIGluIExpbnV4IHdpbGwgcmVzcG9uc2UgdGhpcyBJUlEuIEFuZCB3cml0ZSAweDk5ICwg dGhlbiB0aGUgcWVtdV9pcnFfbG93KHMtPmlycSk7IHdpbGwgYmUgY2FsbGVkLiBIb3dldmVyLCB0 aGUgaW50ZXJydXB0IHJvdXRpbmUgaXMgY2FsbGVkIGFsbCB0aGUgdGltZS4NCg0KV2hhdCdzIHRo ZSBwcm9ibGVtPyBXaGF0J3MgdGhlIGNvcnJlY3Qgcm91dGluZSB0byBhZGQgYW4gaW50ZXJydXB0 Pw0KDQpUaGFua3MuDQoNCg0KDQoNCmFuZHlzeWNyYW5lQGdtYWlsLmNvbQ== ------=_001_NextPart834575212631_=---- Content-Type: text/html; charset="GB2312" Content-Transfer-Encoding: quoted-printable
Hi, all
I want to add a pci device just like pci-serial to QEMU, th= ere=20 are some qeustion while add a IRQ.
 
In the init() function,
pci->dev.config[PCI_INTERRUPT_PIN] =3D 0x01;
s->irq =3D pci->dev.irq[0];
 
In the write() function
qemu_irq_raise(s->irq);
if (val & 0xff) =3D=3D 0x99)
qemu_irq_low(s->irq);
 
What i want to do is generate an interrupt when write to io port, and= then=20 the interrupt routine in Linux will response this IRQ. And write 0x99 , th= en the=20 qemu_irq_low(s->irq); will be called. However, the interrupt routine is= =20 called all the time.
 
What's the problem? What's the correct routine to add an interrupt?
 
Thanks.
 

andysycrane@gmail.com
------=_001_NextPart834575212631_=------