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]

Small change to hal_if.c:hal_ctrlc_check fixed my ethernet debugging problems


Hi

I had to make the following change the
hal\common\current\src\hal_if.c:hal_ctrlc_check() in order to get ethernet
debugging on my custom MPC860 based board.

Before this change, the hal_ctrlc_check would steal all ethernet interrupts
and the TCP/IP stack would not get any data is the application was started
via GDB. (I am using redboot and my RAM image uses the stubs in redboot)

Now ethernet debugging works perfectly.

I am doing something wrong with my configuration to require this ?

Modified code follows:

cyg_bool
hal_ctrlc_check(CYG_ADDRWORD vector, CYG_ADDRWORD data)
{
    hal_virtual_comm_table_t* chan = CYGACC_CALL_IF_DEBUG_PROCS();
    int gdb_vector = -1;
    int isr_ret, ctrlc = 0;

    // This check only to avoid crash on older stubs in case of unhandled
    // interrupts. It is a bit messy, but required in a transition period.
    if (CYGNUM_CALL_IF_TABLE_VERSION+1 == CYGACC_CALL_IF_VERSION()) {
        gdb_vector = CYGACC_COMM_IF_CONTROL(*chan,
__COMMCTL_DBG_ISR_VECTOR);
    }
    if (vector == gdb_vector) {
        isr_ret = CYGACC_COMM_IF_DBG_ISR(*chan, &ctrlc, vector, data);
        if (ctrlc)
            cyg_hal_user_break( (CYG_ADDRWORD *)hal_saved_interrupt_state );
        return ctrlc; // <- CHANGE HERE!! this used to be "return true;"
    }
    return false;
}

Alex Brown
agb@cea.com.au


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