mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
target/xtensa: rearrange access to external interrupts
Replace xtensa_get_extint that returns single external IRQ descriptor with xtensa_get_extints that returns a vector of all external IRQs. Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
This commit is contained in:
parent
3f75038a33
commit
66f03d7e13
3 changed files with 20 additions and 19 deletions
|
@ -88,11 +88,11 @@ static void xtensa_ccompare_cb(void *opaque)
|
|||
|
||||
void xtensa_irq_init(CPUXtensaState *env)
|
||||
{
|
||||
env->irq_inputs = (void **)qemu_allocate_irqs(
|
||||
xtensa_set_irq, env, env->config->ninterrupt);
|
||||
if (xtensa_option_enabled(env->config, XTENSA_OPTION_TIMER_INTERRUPT)) {
|
||||
unsigned i;
|
||||
unsigned i;
|
||||
|
||||
env->irq_inputs = qemu_allocate_irqs(xtensa_set_irq, env,
|
||||
env->config->ninterrupt);
|
||||
if (xtensa_option_enabled(env->config, XTENSA_OPTION_TIMER_INTERRUPT)) {
|
||||
env->time_base = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
|
||||
env->ccount_base = env->sregs[CCOUNT];
|
||||
for (i = 0; i < env->config->nccompare; ++i) {
|
||||
|
@ -101,16 +101,14 @@ void xtensa_irq_init(CPUXtensaState *env)
|
|||
xtensa_ccompare_cb, env->ccompare + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (i = 0; i < env->config->nextint; ++i) {
|
||||
unsigned irq = env->config->extint[i];
|
||||
|
||||
void *xtensa_get_extint(CPUXtensaState *env, unsigned extint)
|
||||
{
|
||||
if (extint < env->config->nextint) {
|
||||
unsigned irq = env->config->extint[extint];
|
||||
return env->irq_inputs[irq];
|
||||
} else {
|
||||
qemu_log("%s: trying to acquire invalid external interrupt %d\n",
|
||||
__func__, extint);
|
||||
return NULL;
|
||||
env->ext_irq_inputs[i] = env->irq_inputs[irq];
|
||||
}
|
||||
}
|
||||
|
||||
qemu_irq *xtensa_get_extints(CPUXtensaState *env)
|
||||
{
|
||||
return env->ext_irq_inputs;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue