This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


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

variant rm7000 interrupt masking


In the file
.../packages/hal/mips/rm7000/ocelot/current/include/plf_intr.h.
should the "else if" comparison be (_vector_ <= CYGNUM_UART2)
in the following macro?

#define HAL_INTERRUPT_MASK( _vector_
)                                      \
   
CYG_MACRO_START                                                        
\
    if( (_vector_) <= CYGNUM_HAL_INTERRUPT_COMPARE
)                        \
   
{                                                                      
\
        asm volatile
(                                                      \
            "mfc0  
$3,$12\n"                                               \
            "la    
$2,0x00000400\n"                                        \
            "sllv  
$2,$2,%0\n"                                             \
            "nor   
$2,$2,$0\n"                                             \
            "and   
$3,$3,$2\n"                                             \
            "mtc0  
$3,$12\n"                                               \
            "nop; nop;
nop\n"                                               \
           
:                                                               \
            :
"r"(_vector_)                                                 \
            : "$2",
"$3"                                                    \
           
);                                                              \
   
}                                                                      
\
    else if ((_vector_) >=
CYGNUM_HAL_INTERRUPT_UART2)                      \
   
{                                                                      
\
        /* int 6:9 are masked in the Interrupt Control register
*/          \
        asm volatile
(                                                      \
            "mfc1  
$3,$20\n"                                               \
            "la    
$2,0x00000100\n"                                        \
            "sllv  
$2,$2,%0\n"                                             \
            "nor   
$2,$2,$0\n"                                             \
            "and   
$3,$3,$2\n"                                             \
            "mtc1  
$3,$20\n"                                               \
            "nop; nop;
nop\n"                                               \
           
:                                                               \
            : "r"((_vector_) -
CYGNUM_HAL_INTERRUPT_PMC1)                   \
            : "$2",
"$3"                                                    \
           
);                                                              \
   
}                                                                      
\
    CYG_MACRO_END

The same problem exists in the UNMASK macro.

Also, I believe rm7000 variants need a custom hal_intc_decode macro to
deal with the rm7000's interrupt control register.

Is there any reason not to place these macros in
.../packages/hal/mips/rm7000/var/current/include/{variant.inc,var_intr.h}

Chris Morrow	YottaYotta Inc. email: cmorrow@yottayotta.com
phone: (780) 989 6814 web:	http:  //www.yottayotta.com


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