mirror of https://gitee.com/openkylin/qemu.git
i8257: remove cpu_request_exit irq
This is unused. cpu_exit now is almost exclusively an internal function to the CPU execution loop. In a few patches, we'll change the remaining occurrences to qemu_cpu_kick, making it truly internal. Reviewed-by: Richard henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
19d2b5e6ff
commit
5039d6e235
|
@ -38,7 +38,6 @@ do { fprintf(stderr, "i82374 ERROR: " fmt , ## __VA_ARGS__); } while (0)
|
|||
|
||||
typedef struct I82374State {
|
||||
uint8_t commands[8];
|
||||
qemu_irq out;
|
||||
PortioList port_list;
|
||||
} I82374State;
|
||||
|
||||
|
@ -101,7 +100,7 @@ static uint32_t i82374_read_descriptor(void *opaque, uint32_t nport)
|
|||
|
||||
static void i82374_realize(I82374State *s, Error **errp)
|
||||
{
|
||||
DMA_init(1, &s->out);
|
||||
DMA_init(1);
|
||||
memset(s->commands, 0, sizeof(s->commands));
|
||||
}
|
||||
|
||||
|
@ -145,8 +144,6 @@ static void i82374_isa_realize(DeviceState *dev, Error **errp)
|
|||
isa->iobase);
|
||||
|
||||
i82374_realize(s, errp);
|
||||
|
||||
qdev_init_gpio_out(dev, &s->out, 1);
|
||||
}
|
||||
|
||||
static Property i82374_properties[] = {
|
||||
|
|
|
@ -59,7 +59,6 @@ static struct dma_cont {
|
|||
uint8_t flip_flop;
|
||||
int dshift;
|
||||
struct dma_regs regs[4];
|
||||
qemu_irq *cpu_request_exit;
|
||||
MemoryRegion channel_io;
|
||||
MemoryRegion cont_io;
|
||||
} dma_controllers[2];
|
||||
|
@ -521,13 +520,11 @@ static const MemoryRegionOps cont_io_ops = {
|
|||
|
||||
/* dshift = 0: 8 bit DMA, 1 = 16 bit DMA */
|
||||
static void dma_init2(struct dma_cont *d, int base, int dshift,
|
||||
int page_base, int pageh_base,
|
||||
qemu_irq *cpu_request_exit)
|
||||
int page_base, int pageh_base)
|
||||
{
|
||||
int i;
|
||||
|
||||
d->dshift = dshift;
|
||||
d->cpu_request_exit = cpu_request_exit;
|
||||
|
||||
memory_region_init_io(&d->channel_io, NULL, &channel_io_ops, d,
|
||||
"dma-chan", 8 << d->dshift);
|
||||
|
@ -591,12 +588,10 @@ static const VMStateDescription vmstate_dma = {
|
|||
}
|
||||
};
|
||||
|
||||
void DMA_init(int high_page_enable, qemu_irq *cpu_request_exit)
|
||||
void DMA_init(int high_page_enable)
|
||||
{
|
||||
dma_init2(&dma_controllers[0], 0x00, 0, 0x80,
|
||||
high_page_enable ? 0x480 : -1, cpu_request_exit);
|
||||
dma_init2(&dma_controllers[1], 0xc0, 1, 0x88,
|
||||
high_page_enable ? 0x488 : -1, cpu_request_exit);
|
||||
dma_init2(&dma_controllers[0], 0x00, 0, 0x80, high_page_enable ? 0x480 : -1);
|
||||
dma_init2(&dma_controllers[1], 0xc0, 1, 0x88, high_page_enable ? 0x488 : -1);
|
||||
vmstate_register (NULL, 0, &vmstate_dma, &dma_controllers[0]);
|
||||
vmstate_register (NULL, 1, &vmstate_dma, &dma_controllers[1]);
|
||||
|
||||
|
|
13
hw/i386/pc.c
13
hw/i386/pc.c
|
@ -1446,15 +1446,6 @@ DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus)
|
|||
return dev;
|
||||
}
|
||||
|
||||
static void cpu_request_exit(void *opaque, int irq, int level)
|
||||
{
|
||||
CPUState *cpu = current_cpu;
|
||||
|
||||
if (cpu && level) {
|
||||
cpu_exit(cpu);
|
||||
}
|
||||
}
|
||||
|
||||
static const MemoryRegionOps ioport80_io_ops = {
|
||||
.write = ioport80_write,
|
||||
.read = ioport80_read,
|
||||
|
@ -1489,7 +1480,6 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
|
|||
qemu_irq rtc_irq = NULL;
|
||||
qemu_irq *a20_line;
|
||||
ISADevice *i8042, *port92, *vmmouse, *pit = NULL;
|
||||
qemu_irq *cpu_exit_irq;
|
||||
MemoryRegion *ioport80_io = g_new(MemoryRegion, 1);
|
||||
MemoryRegion *ioportF0_io = g_new(MemoryRegion, 1);
|
||||
|
||||
|
@ -1566,8 +1556,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
|
|||
port92 = isa_create_simple(isa_bus, "port92");
|
||||
port92_init(port92, &a20_line[1]);
|
||||
|
||||
cpu_exit_irq = qemu_allocate_irqs(cpu_request_exit, NULL, 1);
|
||||
DMA_init(0, cpu_exit_irq);
|
||||
DMA_init(0);
|
||||
|
||||
for(i = 0; i < MAX_FD; i++) {
|
||||
fd[i] = drive_get(IF_FLOPPY, 0, i);
|
||||
|
|
|
@ -100,7 +100,6 @@ static void i82378_realize(PCIDevice *pci, Error **errp)
|
|||
|
||||
/* 2 82C37 (dma) */
|
||||
isa = isa_create_simple(isabus, "i82374");
|
||||
qdev_connect_gpio_out(DEVICE(isa), 0, s->out[1]);
|
||||
|
||||
/* timer */
|
||||
isa_create_simple(isabus, "mc146818rtc");
|
||||
|
@ -111,7 +110,7 @@ static void i82378_init(Object *obj)
|
|||
DeviceState *dev = DEVICE(obj);
|
||||
I82378State *s = I82378(obj);
|
||||
|
||||
qdev_init_gpio_out(dev, s->out, 2);
|
||||
qdev_init_gpio_out(dev, s->out, 1);
|
||||
qdev_init_gpio_in(dev, i82378_request_pic_irq, 16);
|
||||
}
|
||||
|
||||
|
|
|
@ -251,15 +251,6 @@ static void network_init (PCIBus *pci_bus)
|
|||
}
|
||||
}
|
||||
|
||||
static void cpu_request_exit(void *opaque, int irq, int level)
|
||||
{
|
||||
CPUState *cpu = current_cpu;
|
||||
|
||||
if (cpu && level) {
|
||||
cpu_exit(cpu);
|
||||
}
|
||||
}
|
||||
|
||||
static void mips_fulong2e_init(MachineState *machine)
|
||||
{
|
||||
ram_addr_t ram_size = machine->ram_size;
|
||||
|
@ -274,7 +265,6 @@ static void mips_fulong2e_init(MachineState *machine)
|
|||
long bios_size;
|
||||
int64_t kernel_entry;
|
||||
qemu_irq *i8259;
|
||||
qemu_irq *cpu_exit_irq;
|
||||
PCIBus *pci_bus;
|
||||
ISABus *isa_bus;
|
||||
I2CBus *smbus;
|
||||
|
@ -375,8 +365,7 @@ static void mips_fulong2e_init(MachineState *machine)
|
|||
|
||||
/* init other devices */
|
||||
pit = pit_init(isa_bus, 0x40, 0, NULL);
|
||||
cpu_exit_irq = qemu_allocate_irqs(cpu_request_exit, NULL, 1);
|
||||
DMA_init(0, cpu_exit_irq);
|
||||
DMA_init(0);
|
||||
|
||||
/* Super I/O */
|
||||
isa_create_simple(isa_bus, "i8042");
|
||||
|
|
|
@ -104,15 +104,6 @@ static const MemoryRegionOps dma_dummy_ops = {
|
|||
#define MAGNUM_BIOS_SIZE_MAX 0x7e000
|
||||
#define MAGNUM_BIOS_SIZE (BIOS_SIZE < MAGNUM_BIOS_SIZE_MAX ? BIOS_SIZE : MAGNUM_BIOS_SIZE_MAX)
|
||||
|
||||
static void cpu_request_exit(void *opaque, int irq, int level)
|
||||
{
|
||||
CPUState *cpu = current_cpu;
|
||||
|
||||
if (cpu && level) {
|
||||
cpu_exit(cpu);
|
||||
}
|
||||
}
|
||||
|
||||
static CPUUnassignedAccess real_do_unassigned_access;
|
||||
static void mips_jazz_do_unassigned_access(CPUState *cpu, hwaddr addr,
|
||||
bool is_write, bool is_exec,
|
||||
|
@ -150,7 +141,6 @@ static void mips_jazz_init(MachineState *machine,
|
|||
ISADevice *pit;
|
||||
DriveInfo *fds[MAX_FD];
|
||||
qemu_irq esp_reset, dma_enable;
|
||||
qemu_irq *cpu_exit_irq;
|
||||
MemoryRegion *ram = g_new(MemoryRegion, 1);
|
||||
MemoryRegion *bios = g_new(MemoryRegion, 1);
|
||||
MemoryRegion *bios2 = g_new(MemoryRegion, 1);
|
||||
|
@ -234,8 +224,7 @@ static void mips_jazz_init(MachineState *machine,
|
|||
/* ISA devices */
|
||||
i8259 = i8259_init(isa_bus, env->irq[4]);
|
||||
isa_bus_irqs(isa_bus, i8259);
|
||||
cpu_exit_irq = qemu_allocate_irqs(cpu_request_exit, NULL, 1);
|
||||
DMA_init(0, cpu_exit_irq);
|
||||
DMA_init(0);
|
||||
pit = pit_init(isa_bus, 0x40, 0, NULL);
|
||||
pcspk_init(isa_bus, pit);
|
||||
|
||||
|
|
|
@ -905,15 +905,6 @@ static void main_cpu_reset(void *opaque)
|
|||
}
|
||||
}
|
||||
|
||||
static void cpu_request_exit(void *opaque, int irq, int level)
|
||||
{
|
||||
CPUState *cpu = current_cpu;
|
||||
|
||||
if (cpu && level) {
|
||||
cpu_exit(cpu);
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
void mips_malta_init(MachineState *machine)
|
||||
{
|
||||
|
@ -939,7 +930,6 @@ void mips_malta_init(MachineState *machine)
|
|||
MIPSCPU *cpu;
|
||||
CPUMIPSState *env;
|
||||
qemu_irq *isa_irq;
|
||||
qemu_irq *cpu_exit_irq;
|
||||
int piix4_devfn;
|
||||
I2CBus *smbus;
|
||||
int i;
|
||||
|
@ -1175,8 +1165,7 @@ void mips_malta_init(MachineState *machine)
|
|||
smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size);
|
||||
g_free(smbus_eeprom_buf);
|
||||
pit = pit_init(isa_bus, 0x40, 0, NULL);
|
||||
cpu_exit_irq = qemu_allocate_irqs(cpu_request_exit, NULL, 1);
|
||||
DMA_init(0, cpu_exit_irq);
|
||||
DMA_init(0);
|
||||
|
||||
/* Super I/O */
|
||||
isa_create_simple(isa_bus, "i8042");
|
||||
|
|
|
@ -336,15 +336,6 @@ static uint32_t PREP_io_800_readb (void *opaque, uint32_t addr)
|
|||
|
||||
#define NVRAM_SIZE 0x2000
|
||||
|
||||
static void cpu_request_exit(void *opaque, int irq, int level)
|
||||
{
|
||||
CPUState *cpu = current_cpu;
|
||||
|
||||
if (cpu && level) {
|
||||
cpu_exit(cpu);
|
||||
}
|
||||
}
|
||||
|
||||
static void ppc_prep_reset(void *opaque)
|
||||
{
|
||||
PowerPCCPU *cpu = opaque;
|
||||
|
@ -626,8 +617,6 @@ static void ppc_prep_init(MachineState *machine)
|
|||
cpu = POWERPC_CPU(first_cpu);
|
||||
qdev_connect_gpio_out(&pci->qdev, 0,
|
||||
cpu->env.irq_inputs[PPC6xx_INPUT_INT]);
|
||||
qdev_connect_gpio_out(&pci->qdev, 1,
|
||||
qemu_allocate_irq(cpu_request_exit, NULL, 0));
|
||||
sysbus_connect_irq(&pcihost->busdev, 0, qdev_get_gpio_in(&pci->qdev, 9));
|
||||
sysbus_connect_irq(&pcihost->busdev, 1, qdev_get_gpio_in(&pci->qdev, 11));
|
||||
sysbus_connect_irq(&pcihost->busdev, 2, qdev_get_gpio_in(&pci->qdev, 9));
|
||||
|
|
|
@ -111,7 +111,7 @@ void DMA_hold_DREQ (int nchan) {}
|
|||
void DMA_release_DREQ (int nchan) {}
|
||||
void DMA_schedule(void) {}
|
||||
|
||||
void DMA_init(int high_page_enable, qemu_irq *cpu_request_exit)
|
||||
void DMA_init(int high_page_enable)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ void DMA_hold_DREQ (int nchan) {}
|
|||
void DMA_release_DREQ (int nchan) {}
|
||||
void DMA_schedule(void) {}
|
||||
|
||||
void DMA_init(int high_page_enable, qemu_irq *cpu_request_exit)
|
||||
void DMA_init(int high_page_enable)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ int DMA_write_memory (int nchan, void *buf, int pos, int size);
|
|||
void DMA_hold_DREQ (int nchan);
|
||||
void DMA_release_DREQ (int nchan);
|
||||
void DMA_schedule(void);
|
||||
void DMA_init(int high_page_enable, qemu_irq *cpu_request_exit);
|
||||
void DMA_init(int high_page_enable);
|
||||
void DMA_register_channel (int nchan,
|
||||
DMA_transfer_handler transfer_handler,
|
||||
void *opaque);
|
||||
|
|
Loading…
Reference in New Issue