Esempio n. 1
0
externC hal_mpc5xx_arbitration_data *
hal_mpc5xx_remove_arbitration_isr(cyg_uint32 apriority)
{
  hal_mpc5xx_arbitration_data * result = 0;
  
  // Find the SIU vector from the priority
  CYG_ADDRWORD vector = 2*(1 + apriority);
  if(vector < CYGNUM_HAL_INTERRUPT_SIU_LVL7)
  {
    result = (hal_mpc5xx_arbitration_data *)(hal_interrupt_objects[vector]);
	HAL_INTERRUPT_DETACH(vector, hal_interrupt_handlers[vector]);
  }
  else
  {
#ifdef CYGSEM_HAL_POWERPC_MPC5XX_IMB3_ARBITER  
    // Prevent anything from coming through while manipulating the list
    HAL_INTERRUPT_MASK(CYGNUM_HAL_INTERRUPT_SIU_LVL7);
	result = mpc5xx_remove(imb3_data_head, apriority);
	
	// If something was removed, update the list.
	if(result) imb3_data_head = result->reserved;
    HAL_INTERRUPT_UNMASK(CYGNUM_HAL_INTERRUPT_SIU_LVL7);
#else
    result = (hal_mpc5xx_arbitration_data *)(hal_interrupt_objects[CYGNUM_HAL_INTERRUPT_SIU_LVL7]);
	HAL_INTERRUPT_DETACH(CYGNUM_HAL_INTERRUPT_SIU_LVL7, hal_interrupt_handlers[CYGNUM_HAL_INTERRUPT_SIU_LVL7]); 
#endif
  }

  return result;
}
Esempio n. 2
0
externC void cyg_drv_interrupt_detach( cyg_handle_t interrupt )
{
    cyg_interrupt *intr = (cyg_interrupt *)interrupt;
    
    CYG_REPORT_FUNCTION();

    CYG_ASSERT( intr->vector >= CYGNUM_HAL_ISR_MIN, "Invalid vector");    
    CYG_ASSERT( intr->vector <= CYGNUM_HAL_ISR_MAX, "Invalid vector");

#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN

    // Remove the interrupt object from the vector chain.

    {    
        cyg_uint32 index;
        cyg_interrupt **p;

        HAL_TRANSLATE_VECTOR( intr->vector, index );

        p = &chain_list[index];

        while( *p != NULL )
        {
            cyg_interrupt *n = *p;
            
            if( n == intr )
            {
                *p = intr->next;
                break;
            }
            
            p = &n->next;
        }

        // If this was the last one, detach the vector.
    
        if( chain_list[index] == NULL )
            HAL_INTERRUPT_DETACH( intr->vector, chain_isr );
    }
    
#else
    
    HAL_INTERRUPT_DETACH( intr->vector, intr->isr );

#endif
    
    CYG_REPORT_RETURN();    
}
Esempio n. 3
0
void sparc_ex_main( void )
{
    int i;

    CYG_TEST_INIT();

    for ( i = CYGNUM_HAL_EXCEPTION_MIN; i <= CYGNUM_HAL_EXCEPTION_MAX; i++ ){
        int j;
        HAL_TRANSLATE_VECTOR( i, j );
        HAL_INTERRUPT_ATTACH( j, &fail_exception_handler, j, 0 );
        // we must also ensure that eCos handles the exception;
        // do not drop into CygMon or equivalent.
        // Leave USER_TRAP undisturbed so that breakpoints work.
        if ( CYGNUM_HAL_VECTOR_USER_TRAP != i ) {
            extern void hal_default_exception_vsr( void );
            HAL_VSR_SET( i, (CYG_ADDRESS)hal_default_exception_vsr, NULL );
        }
    }

    HAL_TRANSLATE_VECTOR( CYGNUM_HAL_VECTOR_UNALIGNED, i );
    HAL_INTERRUPT_DETACH( i, &fail_exception_handler );
    HAL_INTERRUPT_ATTACH( i, &skip_exception_handler, i, 0 );

    CYG_TEST_INFO( "Vectors attached OK; calling do_test" );

    do_test();

    CYG_TEST_EXIT( "Done" );
}