mirror of
https://github.com/qemu/qemu.git
synced 2024-11-26 04:13:39 +08:00
Sparc32: use qemu_irq for system_powerdown
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
74ff8d90a1
commit
b2b6f6ec39
@ -95,7 +95,7 @@ static void slavio_misc_reset(void *opaque)
|
||||
s->config = s->aux1 = s->aux2 = s->mctrl = 0;
|
||||
}
|
||||
|
||||
void slavio_set_power_fail(void *opaque, int power_failing)
|
||||
static void slavio_set_power_fail(void *opaque, int irq, int power_failing)
|
||||
{
|
||||
MiscState *s = opaque;
|
||||
|
||||
@ -492,6 +492,8 @@ static void slavio_misc_init1(SysBusDevice *dev)
|
||||
slavio_aux2_mem_write, s);
|
||||
sysbus_init_mmio(dev, MISC_SIZE, io);
|
||||
|
||||
qdev_init_gpio_in(&dev->qdev, slavio_set_power_fail, 1);
|
||||
|
||||
register_savevm("slavio_misc", -1, 1, slavio_misc_save, slavio_misc_load,
|
||||
s);
|
||||
qemu_register_reset(slavio_misc_reset, s);
|
||||
|
34
hw/sun4m.c
34
hw/sun4m.c
@ -268,13 +268,6 @@ static void dummy_cpu_set_irq(void *opaque, int irq, int level)
|
||||
{
|
||||
}
|
||||
|
||||
static void *slavio_misc;
|
||||
|
||||
void qemu_system_powerdown(void)
|
||||
{
|
||||
slavio_set_power_fail(slavio_misc, 1);
|
||||
}
|
||||
|
||||
static void main_cpu_reset(void *opaque)
|
||||
{
|
||||
CPUState *env = opaque;
|
||||
@ -458,10 +451,17 @@ static void slavio_timer_init_all(target_phys_addr_t addr, qemu_irq master_irq,
|
||||
#define MISC_MDM 0x01b00000
|
||||
#define MISC_SYS 0x01f00000
|
||||
|
||||
static void *slavio_misc_init(target_phys_addr_t base,
|
||||
target_phys_addr_t aux1_base,
|
||||
target_phys_addr_t aux2_base, qemu_irq irq,
|
||||
qemu_irq fdc_tc)
|
||||
static qemu_irq slavio_powerdown;
|
||||
|
||||
void qemu_system_powerdown(void)
|
||||
{
|
||||
qemu_irq_raise(slavio_powerdown);
|
||||
}
|
||||
|
||||
static void slavio_misc_init(target_phys_addr_t base,
|
||||
target_phys_addr_t aux1_base,
|
||||
target_phys_addr_t aux2_base, qemu_irq irq,
|
||||
qemu_irq fdc_tc)
|
||||
{
|
||||
DeviceState *dev;
|
||||
SysBusDevice *s;
|
||||
@ -494,8 +494,7 @@ static void *slavio_misc_init(target_phys_addr_t base,
|
||||
}
|
||||
sysbus_connect_irq(s, 0, irq);
|
||||
sysbus_connect_irq(s, 1, fdc_tc);
|
||||
|
||||
return s;
|
||||
slavio_powerdown = qdev_get_gpio_in(dev, 0);
|
||||
}
|
||||
|
||||
static void ecc_init(target_phys_addr_t base, qemu_irq irq, uint32_t version)
|
||||
@ -826,9 +825,9 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size,
|
||||
serial_hds[0], serial_hds[1], ESCC_CLOCK, 1);
|
||||
|
||||
cpu_halt = qemu_allocate_irqs(cpu_halt_signal, NULL, 1);
|
||||
slavio_misc = slavio_misc_init(hwdef->slavio_base,
|
||||
hwdef->aux1_base, hwdef->aux2_base,
|
||||
slavio_irq[30], fdc_tc);
|
||||
slavio_misc_init(hwdef->slavio_base, hwdef->aux1_base, hwdef->aux2_base,
|
||||
slavio_irq[30], fdc_tc);
|
||||
|
||||
if (hwdef->apc_base) {
|
||||
apc_init(hwdef->apc_base, cpu_halt[0]);
|
||||
}
|
||||
@ -1615,8 +1614,7 @@ static void sun4c_hw_init(const struct sun4c_hwdef *hwdef, ram_addr_t RAM_size,
|
||||
slavio_irq[1], serial_hds[0], serial_hds[1],
|
||||
ESCC_CLOCK, 1);
|
||||
|
||||
slavio_misc = slavio_misc_init(0, hwdef->aux1_base, 0,
|
||||
slavio_irq[1], fdc_tc);
|
||||
slavio_misc_init(0, hwdef->aux1_base, 0, slavio_irq[1], fdc_tc);
|
||||
|
||||
if (hwdef->fd_base != (target_phys_addr_t)-1) {
|
||||
/* there is zero or one floppy drive */
|
||||
|
@ -30,9 +30,6 @@ void slavio_irq_info(Monitor *mon, void *opaque);
|
||||
void sun4c_pic_info(Monitor *mon, void *opaque);
|
||||
void sun4c_irq_info(Monitor *mon, void *opaque);
|
||||
|
||||
/* slavio_misc.c */
|
||||
void slavio_set_power_fail(void *opaque, int power_failing);
|
||||
|
||||
/* sparc32_dma.c */
|
||||
#include "sparc32_dma.h"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user