This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb/771: psim external interrupt delivery masked by pending decrementer interrupt


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]