Skip to contentSkip to conversation

Hardware interrupts

Qemu-devel Alessandro Corradi 2 participants 2 messages Jul 17, 2006

lore
Share & tools
lore
#0 lore raw

<http://fabrice.bellard.free.fr/qemu/qemu-tech.html#TOC18>
<http://fabrice.bellard.free.fr/qemu/qemu-tech.html#TOC18>

Hi all,

In http://fabrice.bellard.free.fr/qemu/qemu-tech.html:

"In order to be faster, QEMU does not check at every basic block if an hardware interrupt is pending. Instead, the user must asynchrously call a specific function to tell that an interrupt is pending. This function resets the chaining of the currently executing basic block. It ensures that the execution will return soon in the main loop of the CPU emulator. Then the main loop can test if the interrupt is pending and handle it." What means "the user must asynchrously call a specific function..."?

In which sense "user must"?

Which "Specific function"?

How QEMU checks for hardware interrups?

Thanks

#1 lore raw
Quoted 9 lines

"In order to be faster, QEMU does not check at every basic block if an hardware interrupt is pending. Instead, the user must asynchrously call a specific function to tell that an interrupt is pending. This function resets the chaining of the currently executing basic block. It ensures that the execution will return soon in the main loop of the CPU emulator. Then the main loop can test if the interrupt is pending and handle it." What means "the user must asynchrously call a specific function..."?

In which sense "user must"?

Whoever wants to raise the interrupt.

Quoted 1 line

Which "Specific function"?

Usually pic_set_irq_new.

I recommend you look at how the existing hardware devices are implemented. That should answer most of your questions. I'd start with something simple like serial.c or pl050.c

Paul