Ticket #1958: 0001-sparc-leon3-LEON_Is_interrupt_masked-for-Leon3-in-le.patch

File 0001-sparc-leon3-LEON_Is_interrupt_masked-for-Leon3-in-le.patch, 1.1 KB (added by Jiri Gaisler, on 11/23/14 at 22:09:18)
  • c/src/lib/libbsp/sparc/leon3/include/leon.h

    From 7111ec287983b5f4604bd830f8cb5d3a9f2b9aeb Mon Sep 17 00:00:00 2001
    From: Jiri Gaisler <jiri@gaisler.se>
    Date: Sun, 23 Nov 2014 22:38:53 +0100
    Subject: [PATCH 1/2] sparc/leon3: LEON_Is_interrupt_masked for Leon3 in leon.h
     wrongly defined
    
    Condition needs to be inverted, as a 1 in the mask register means
    that the interrupt is enabled. Solves ticket #1958 in trac.
    ---
     c/src/lib/libbsp/sparc/leon3/include/leon.h | 4 +---
     1 file changed, 1 insertion(+), 3 deletions(-)
    
    diff --git a/c/src/lib/libbsp/sparc/leon3/include/leon.h b/c/src/lib/libbsp/sparc/leon3/include/leon.h
    index 92c36b7..c7270cf 100644
    a b extern rtems_interrupt_lock LEON3_IrqCtrl_Lock; 
    158158  (LEON3_IrqCtrl_Regs->ipend & (1 << (_source)))
    159159
    160160#define LEON_Cpu_Is_interrupt_masked( _source, _cpu ) \
    161   do {\
    162      (LEON3_IrqCtrl_Regs->mask[_cpu] & (1 << (_source))); \
    163    } while (0)
     161     (!(LEON3_IrqCtrl_Regs->mask[_cpu] & (1 << (_source))))
    164162
    165163#define LEON_Cpu_Mask_interrupt( _source, _cpu ) \
    166164  do { \