aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2010-05-12 19:27:23 +0000
committerBlue Swirl <blauwirbel@gmail.com>2010-05-12 19:27:23 +0000
commit9c0afd0e1df092e0d8a3cefdcb81e664cf18d97c (patch)
tree94d5e74958d903f708c2e111fceaa4689388b373
parent113c61069cb46f871f9c976f6b99097ec3a3cb8f (diff)
apb: don't use any static state
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rw-r--r--hw/apb_pci.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/hw/apb_pci.c b/hw/apb_pci.c
index 095f3b7990..65d8ba610f 100644
--- a/hw/apb_pci.c
+++ b/hw/apb_pci.c
@@ -73,10 +73,9 @@ typedef struct APBState {
uint32_t obio_irq_map[32];
qemu_irq pci_irqs[32];
uint32_t reset_control;
+ unsigned int nr_resets;
} APBState;
-static unsigned int nr_resets;
-
static void apb_config_writel (void *opaque, target_phys_addr_t addr,
uint32_t val)
{
@@ -108,7 +107,7 @@ static void apb_config_writel (void *opaque, target_phys_addr_t addr,
s->reset_control &= ~(val & RESET_WCMASK);
s->reset_control |= val & RESET_WMASK;
if (val & SOFT_POR) {
- nr_resets = 0;
+ s->nr_resets = 0;
qemu_system_reset_request();
} else if (val & SOFT_XIR) {
qemu_system_reset_request();
@@ -374,7 +373,7 @@ static void pci_pbm_reset(DeviceState *d)
s->pci_irq_map[i] &= PBM_PCI_IMR_MASK;
}
- if (nr_resets++ == 0) {
+ if (s->nr_resets++ == 0) {
/* Power on reset */
s->reset_control = POR;
}