others/fw-verif/demo-system/fwsrc/slv.c
/* intHdl: interrupt handling
 * 1. get register data to local copy
 * 2. handle based on the corresponding opcode
 */
interrupt handling
1. get register data to local copy
2. handle based on the corresponding opcode
interrupt handling 1 . get register data to local copy 2 . handle based on the corresponding opcode
void intHdl () {
    if (reg_slv_int == 0) return;
#ifdef CTX_LOCK
#ifdef MUTEX
    pthread_mutex_lock (&ctx_lock);
#else 
    __VERIFIER_atomic_begin ();
#endif 
#endif 
    getMbCtx ();
    handleCmd ();
    reg_slv_int = 0;
#ifdef CTX_LOCK
#ifdef MUTEX
    pthread_mutex_unlock (&ctx_lock);
#else 
    __VERIFIER_atomic_end ();
#endif 
#endif 
    return;
}
void intHdl ( ) { if ( reg_slv_int == 0 ) return ; #ifdef CTX_LOCK #ifdef MUTEX pthread_mutex_lock ( & ctx_lock ) ; #else __VERIFIER_atomic_begin ( ) ; #endif #endif getMbCtx ( ) ; handleCmd ( ) ; reg_slv_int = 0 ; #ifdef CTX_LOCK #ifdef MUTEX pthread_mutex_unlock ( & ctx_lock ) ; #else __VERIFIER_atomic_end ( ) ; #endif #endif return ; }
intHdl: interrupt handling
 1. get register data to local copy
 2. handle based on the corresponding opcode
intHdl : interrupt handling 1 . get register data to local copy 2 . handle based on the corresponding opcode
// Only when interrupted // MUTEX // MUTEX // CTX_LOCK // 1. get register data to local copy // 2. handle based on the corresponding opcode // reset interrupt signal (enable) // MUTEX // MUTEX // CTX_LOCK