예제 #1
0
externC void cyg_drv_dsr_unlock()
{
    CYG_REPORT_FUNCTION();

    do
    {
        if( dsr_disable_counter == 1 )
        {
            call_dsrs();
        }

        HAL_REORDER_BARRIER();
        
        dsr_disable_counter = 0;

        HAL_REORDER_BARRIER();

        // Check that no DSRs have been posted between calling
        // call_dsrs() and zeroing dsr_disable_counter. If so,
        // loop back and call them.
        
        if( dsr_list != NULL )
        {
            dsr_disable_counter = 1;
            continue;
        }

        CYG_REPORT_RETURN();
        
        return;
        
    } while(1);

    CYG_FAIL( "Should not be executed" );
}
예제 #2
0
void hal_reset(void)
{
    // Do any variant-specific reset initialization
    var_reset();

    // Do any platform-specific reset initialization
    plf_reset();

    // Initialize the RAM sections that the rest of the C code requires
    hal_init_ram_sections();

    // All program sections are now in place

    // Make sure that every instruction above this one has been output by
    // the compiler
    HAL_REORDER_BARRIER();

    // Now it is safe to use a stack in RAM
    asm volatile ("lea cyg_interrupt_stack, %sp");
   
    // It is now safe to call C functions which may rely on initialized
    // data
    hal_vsr_init();
    hal_isr_init();

    // Initialize variant HAL private data
    var_init_data();

    // Initialize platform HAL private data
    plf_init_data();

    // Initialize the virtual vector table
    hal_if_init();

    // Call C++ constructors
    cyg_hal_invoke_constructors();

#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
    initialize_stub();
#endif

    // Init Ctrl-C debug ISR
#if defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT) \
    || defined(CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT)
    hal_ctrlc_isr_init();
#endif

    // Call cyg_start. This routine should not return.
    cyg_start();
}