[PATCH 1/2] sparc/leon3: LEON_Is_interrupt_masked for Leon3 in leon.h wrongly defined

Jiri Gaisler jiri at gaisler.se
Sun Nov 23 21:53:34 UTC 2014


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/c/src/lib/libbsp/sparc/leon3/include/leon.h
+++ b/c/src/lib/libbsp/sparc/leon3/include/leon.h
@@ -158,9 +158,7 @@ extern rtems_interrupt_lock LEON3_IrqCtrl_Lock;
   (LEON3_IrqCtrl_Regs->ipend & (1 << (_source)))
 
 #define LEON_Cpu_Is_interrupt_masked( _source, _cpu ) \
-  do {\
-     (LEON3_IrqCtrl_Regs->mask[_cpu] & (1 << (_source))); \
-   } while (0)
+     (!(LEON3_IrqCtrl_Regs->mask[_cpu] & (1 << (_source))))
 
 #define LEON_Cpu_Mask_interrupt( _source, _cpu ) \
   do { \
-- 
1.9.1



More information about the devel mailing list