[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/3] Change qemu_set_irq() to return status info
From: |
Paul Brook |
Subject: |
Re: [Qemu-devel] [PATCH 1/3] Change qemu_set_irq() to return status information. |
Date: |
Sun, 29 Jun 2008 15:53:55 +0100 |
User-agent: |
KMail/1.9.9 |
> >> The return value is less then zero if interrupt is masked, zero if it
> >> is known that interrupt is lost (due to coalescing) or greater then zero
> >> if interrupt is delivered or was successfully queued for delivery by
> >> interrupt controller. Device emulation can use this info as it pleases.
> >> Included patch adds detection of interrupt coalescing into PIC and APIC
> >> code for edge triggered interrupts.
> >
> > Instead of negative/positive/zero, consider returning an enum for
> > readability.
>
> I thought about that, but I sometimes do arithmetics on those values
> (when delivering interrupt to multiple CPUs), so result can be more then
> 1 sometimes.
At minimum you need to document the meaning of these values. Especially as
you've now given two contradictory definitions - "greater than zero" isn't
something you can do arithmetic with. If you require -1/0/+1 then you have to
say that.
Paul
- [Qemu-devel] [PATCH 0/3] Fix guest time drift under heavy load., Gleb Natapov, 2008/06/23
- Re: [Qemu-devel] [PATCH 1/3] Change qemu_set_irq() to return status information., Paul Brook, 2008/06/29
- Re: [Qemu-devel] [PATCH 1/3] Change qemu_set_irq() to return status information., Gleb Natapov, 2008/06/29
- Re: [Qemu-devel] [PATCH 1/3] Change qemu_set_irq() to return status information., Paul Brook, 2008/06/29
- Re: [Qemu-devel] [PATCH 1/3] Change qemu_set_irq() to return status information., Gleb Natapov, 2008/06/29
- Re: [Qemu-devel] [PATCH 1/3] Change qemu_set_irq() to return status information., Paul Brook, 2008/06/29
- Re: [Qemu-devel] [PATCH 1/3] Change qemu_set_irq() to return status information., Gleb Natapov, 2008/06/29
- Re: [Qemu-devel] [PATCH 1/3] Change qemu_set_irq() to return status information., Gleb Natapov, 2008/06/30
- Re: [Qemu-devel] [PATCH 1/3] Change qemu_set_irq() to return status information., Paul Brook, 2008/06/30
- Re: [Qemu-devel] [PATCH 1/3] Change qemu_set_irq() to return status information., Gleb Natapov, 2008/06/30