OSDN Git Service

openpic: Reset IRQ source private members
authorPaul Janzen <pcj@pauljanzen.org>
Thu, 22 May 2014 06:09:45 +0000 (23:09 -0700)
committerAlexander Graf <agraf@suse.de>
Mon, 16 Jun 2014 11:24:36 +0000 (13:24 +0200)
commitffd5e9fe02763a0e943dbb76fa78100ef5513e48
tree0b29eb8f21ba6285caf5a07f3c9a9d4ccc3102e9
parent8ebe65f3611b265ed093bdc3300624aa11990503
openpic: Reset IRQ source private members

The openpic emulation code maintains an allowable-CPU's bitmap
("destmask") for each IRQ source which is calculated from the IDR
register value whenever the guest OS writes to it.  However, if the
guest OS relies on the system to set the IDR register to a default
value at reset, and does not write IDR, then destmask does not get
updated, and interrupts do not get propagated to the guest.
Additionally, if an IRQ source is marked as critical, the source's
internal "output" and "nomask" fields are not correctly reset when the
PIC is reset.

Fix both these issues by calling write_IRQreg_idr from within
openpic_reset, instead of simply setting the IDR register to the
specified idr_reset value.

Signed-off-by: Paul Janzen <pcj@pauljanzen.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/intc/openpic.c