qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] This is a bug, isn't it?
@ 2012-06-24 19:19 Martin Husemann
  2012-06-24 19:22 ` Martin Husemann
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Husemann @ 2012-06-24 19:19 UTC (permalink / raw)
  To: qemu-devel

Can somebody explain this code sniplet from hw/sparc32_dma.c to me?
Either it is some hidden threaded gem (in which case s->dmaregs need to be
volatile at least), or some tests are a bit confused and any reasonably
optimizing compiler will create code that apparently the author did not
intend:

static void dma_set_irq(void *opaque, int irq, int level)
{
    DMAState *s = opaque;
    if (level) {
        s->dmaregs[0] |= DMA_INTR;
        if (s->dmaregs[0] & DMA_INTREN) {
            trace_sparc32_dma_set_irq_raise();
            qemu_irq_raise(s->irq);
        }   
    } else {
        if (s->dmaregs[0] & DMA_INTR) {
            s->dmaregs[0] &= ~DMA_INTR;
            if (s->dmaregs[0] & DMA_INTREN) {
                trace_sparc32_dma_set_irq_lower();
                qemu_irq_lower(s->irq);
            }
        }
    }
}


Thanks,

Martin

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] This is a bug, isn't it?
  2012-06-24 19:19 [Qemu-devel] This is a bug, isn't it? Martin Husemann
@ 2012-06-24 19:22 ` Martin Husemann
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Husemann @ 2012-06-24 19:22 UTC (permalink / raw)
  To: qemu-devel

Ah, my eyes get bad - please disregard, foudn the DMA_INTREN vs. DMA_INTR
differences :-(

Martin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-24 19:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-24 19:19 [Qemu-devel] This is a bug, isn't it? Martin Husemann
2012-06-24 19:22 ` Martin Husemann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).