Ejemplo n.º 1
0
static SYMBOL registerHandler(  // REGISTER THE HANDLER
    SYMBOL rw,                  // - symbol for R/W block
    unsigned rtn_code )         // - R/T handler code
{
#if 0
    CgAssignPtr( CgSymbolPlusOffset( rw, CgbkInfo.size_data_ptr )
               , CgAddrSymbol( RunTimeCallSymbol( rtn_code ) ) );
#else
    CgAssign( CgSymbolPlusOffset( rw, CgbkInfo.size_data_ptr )
            , CgAddrSymbol( RunTimeCallSymbol( rtn_code ) )
            , TY_CODE_PTR );
#endif
    return rw;
}
Ejemplo n.º 2
0
void CgFunRegister(             // REGISTER A FUNCTION
    FN_CTL* fctl,               // - function information
    SYMBOL rw,                  // - symbol for R/W block
    SYMBOL ro )                 // - symbol for R/O block
{
    SE* se;                     // - current position

#if _CPU == _AXP
    CgAssignPtr( CgSymbolPlusOffset( rw, 0 ), CgAddrSymbol( ro ) );
    CompFlags.inline_fun_reg = TRUE;
#else
    RT_DEF def;                 // - R/T call control
    cg_name opt_thr;            // - optimized expression for addr[THREAD_CTL]

    DbgVerify( CompFlags.rw_registration, "not R/W Registration" );
    if( CompFlags.fs_registration ) {
        CompFlags.inline_fun_reg = TRUE;
        CgRtCallInit( &def, RTF_FS_PUSH );
        CgRtParamAddrSym( &def, rw );
        CgRtCallExecDone( &def );
        rw = registerHandler( rw, RTF_FS_HANDLER );
    } else {
        opt_thr = pointOptSym( &optFuncReg );
        if( opt_thr == NULL ) {
            rtRegister( rw, ro );
        } else {
            CompFlags.inline_fun_reg = TRUE;
            CgAssignPtr( CgSymbolPlusOffset( rw, 0 )
                       , CgFetchPtr( opt_thr ) );
            CgAssignPtr( CgSymbol( optFuncReg.sym )
                       , CgAddrSymbol( rw ) );
            rw = registerHandler( rw, RTF_FS_HANDLER_RTN );
        }
    }
    CgAssignPtr( CgSymbolPlusOffset
                    ( rw, CgbkInfo.size_data_ptr + CgbkInfo.size_fs_hand )
               , CgAddrSymbol( ro ) );
#endif
    if( fctl->is_dtor ) {
        se = BlkPosnCurr();
    } else {
        se = NULL;
    }
    FstabAssignStateVar( se );
}
Ejemplo n.º 3
0
void CgRtParamAddrSym(          // SET UP PARAMETER: ADDR( SYMBOL )
    RT_DEF *def,                // - definition for call
    SYMBOL sym )                // - symbol
{
    CgRtParam( CgAddrSymbol( sym ), def, TY_POINTER );
}
Ejemplo n.º 4
0
cg_name CgSymbolPlusOffset(     // GENERATE SYMBOL + OFFSET
    SYMBOL sym,                 // - symbol
    target_offset_t offset )    // - offset
{
    return CgOffsetExpr( CgAddrSymbol( sym ), offset, CgTypePtrSym( sym ) );
}