mirror of https://gitee.com/openkylin/qemu.git
Merge remote-tracking branch 'jliu/or32' into staging
# By Jia Liu # Via Jia Liu * jliu/or32: hw/openrisc: Avoid undefined shift in openrisc_pic_cpu_handler() hw/openrisc: Fix masking in openrisc_pic_cpu_handler() hw/openrisc: Avoid using uninitialised variable 'entry' Message-id: 1377050811-11116-1-git-send-email-proljc@gmail.com Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
This commit is contained in:
commit
9fe480695a
|
@ -86,9 +86,8 @@ static void cpu_openrisc_load_kernel(ram_addr_t ram_size,
|
|||
kernel_filename);
|
||||
exit(1);
|
||||
}
|
||||
cpu->env.pc = entry;
|
||||
}
|
||||
|
||||
cpu->env.pc = entry;
|
||||
}
|
||||
|
||||
static void openrisc_sim_init(QEMUMachineInitArgs *args)
|
||||
|
|
|
@ -26,26 +26,25 @@ static void openrisc_pic_cpu_handler(void *opaque, int irq, int level)
|
|||
{
|
||||
OpenRISCCPU *cpu = (OpenRISCCPU *)opaque;
|
||||
CPUState *cs = CPU(cpu);
|
||||
int i;
|
||||
uint32_t irq_bit = 1 << irq;
|
||||
uint32_t irq_bit;
|
||||
|
||||
if (irq > 31 || irq < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
irq_bit = 1U << irq;
|
||||
|
||||
if (level) {
|
||||
cpu->env.picsr |= irq_bit;
|
||||
} else {
|
||||
cpu->env.picsr &= ~irq_bit;
|
||||
}
|
||||
|
||||
for (i = 0; i < 32; i++) {
|
||||
if ((cpu->env.picsr && (1 << i)) && (cpu->env.picmr && (1 << i))) {
|
||||
cpu_interrupt(cs, CPU_INTERRUPT_HARD);
|
||||
} else {
|
||||
cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD);
|
||||
cpu->env.picsr &= ~(1 << i);
|
||||
}
|
||||
if (cpu->env.picsr & cpu->env.picmr) {
|
||||
cpu_interrupt(cs, CPU_INTERRUPT_HARD);
|
||||
} else {
|
||||
cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD);
|
||||
cpu->env.picsr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue