src/kernel/trap/trap.c
/*!
 * @note unregister trap handler
 * @warning there is not a lock to ensuring
 *         the safety of critical section.
 * @param cpu_id
 * @param number
 * @param is_irq
 * @return
 */
@note unregister trap handler
@warning there is not a lock to ensuring
the safety of critical section.
@note unregister trap handler @warning there is not a lock to ensuring the safety of critical section .
int trap_unregister(int cpu_id,int number, bool is_irq){
    if(number<0){
        return -1;
    }
    if(is_irq){
        if(number>=PLATFORM_S_MAX_IRQ_NO){
            return -1;
        }
        trap_irq_table[cpu_id][number] = trap_default_handler;
    }
    else{
        if(number>=PLATFORM_S_MAX_EXC_NO){
            return -1;
        }
        trap_exc_table[cpu_id][number] = trap_default_handler;
    }
    return 1;
}
int trap_unregister ( int cpu_id , int number , bool is_irq ) { if ( number < 0 ) { return -1 ; } if ( is_irq ) { if ( number >= PLATFORM_S_MAX_IRQ_NO ) { return -1 ; } trap_irq_table [ cpu_id ] [ number ] = trap_default_handler ; } else { if ( number >= PLATFORM_S_MAX_EXC_NO ) { return -1 ; } trap_exc_table [ cpu_id ] [ number ] = trap_default_handler ; } return 1 ; }
@note unregister trap handler
 @warning there is not a lock to ensuring
         the safety of critical section.
@note unregister trap handler @warning there is not a lock to ensuring the safety of critical section .