This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
gdb/771: psim external interrupt delivery masked by pending decrementer interrupt
- From: jtl at bothan dot net
- To: gdb-gnats at sources dot redhat dot com
- Date: 30 Sep 2002 16:54:29 -0000
- Subject: gdb/771: psim external interrupt delivery masked by pending decrementer interrupt
- Reply-to: jtl at bothan dot net
>Number: 771
>Category: gdb
>Synopsis: psim external interrupt delivery masked by pending decrementer interrupt
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Sep 30 09:58:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Joshua LeVasseur
>Release: gdb-5.1.1
>Organization:
>Environment:
psim PowerPC simulator
>Description:
Found a bug in gdb/sim/ppc/interrupts.c in function external_interrupt(). The bug prevents delivery of external interrupts when a cpu has a pending decrementer interrupt.
The offending line:
if (!ints->pending_interrupts & external_interrupt_pending)
{ ... }
Look closely and you'll see that the if-clause uses a logical inversion rather than a bitwise inversion.
>How-To-Repeat:
>Fix:
When written as intended, the if-else-clause is superfluous, so I suggest to excise the if-else-clause, and simplify the external_interrupt() function to:
INLINE_INTERRUPTS\
(void)
external_interrupt(cpu *processor,
int is_asserted)
{
interrupts *ints = cpu_interrupts(processor);
if (is_asserted) {
ints->pending_interrupts |= external_interrupt_pending;
if (cpu_registers(processor)->msr & msr_external_interrupt_enable)
schedule_hardware_interrupt_delivery(processor);
}
else {
ints->pending_interrupts &= ~external_interrupt_pending;
}
}
>Release-Note:
>Audit-Trail:
>Unformatted: