Ejemplo n.º 1
0
void SetProgState( unsigned run_conditions )
{
    ReadDbgRegs();
    if( run_conditions & COND_THREAD_EXTRA ) {
        _SwitchOn( SW_THREAD_EXTRA_CHANGED );
    }
    if( run_conditions & COND_THREAD ) {
        DbgRegs->tid = RemoteSetThread( 0 );
        CheckForNewThreads( TRUE );
    }
    if( run_conditions & COND_ALIASING ) CheckSegAlias();
}
Ejemplo n.º 2
0
unsigned MakeAsyncRun( bool single )
{
    async_go_req        acc;
    async_go_ret        ret;
    addr_ptr            tmp;

    if( SuppAsyncId == 0 ) return( 0 );

    acc.supp.core_req = REQ_PERFORM_SUPPLEMENTARY_SERVICE;
    acc.supp.id = SuppAsyncId;

    if( single )
        acc.req = REQ_ASYNC_STEP;
    else
        acc.req = REQ_ASYNC_GO;

    OnAnotherThreadSimpAccess( sizeof( acc ), &acc, sizeof( ret ), &ret );
    CONV_LE_16( ret.conditions );

    if( ret.conditions & COND_RUNNING ) {
        ret.stack_pointer.offset = 0;
        ret.stack_pointer.segment = 0;
        ret.program_counter.offset = 0;
        ret.program_counter.segment = 0;
    } else {
        CONV_LE_32( ret.stack_pointer.offset );
        CONV_LE_16( ret.stack_pointer.segment );
        CONV_LE_32( ret.program_counter.offset );
        CONV_LE_16( ret.program_counter.segment );
        if( ret.conditions & COND_CONFIG ) {
            GetSysConfig();
            CheckMADChange();
        }
        DbgRegs->mad = SysConfig.mad;
        /* Use 'tmp' because of alignment problems */
        tmp = ret.stack_pointer;
        MADRegSpecialSet( MSR_SP, &DbgRegs->mr, &tmp );
        tmp = ret.program_counter;
        MADRegSpecialSet( MSR_IP, &DbgRegs->mr, &tmp );
        if( ret.conditions & COND_THREAD ) {
            DbgRegs->tid = RemoteSetThread( 0 );
        }
    }
    return( ret.conditions );
}