static void callBackCtorFlag( // CALL-BACK FOR CTOR-FLAG AFTER CTORING void* data ) // - patch entry { CTOR_FLAG_SET* cfs = data; // - patch entry if( ctorTestReqd( FstabActualPosn(), cfs->se ) ) { FN_CTL* fctl = FnCtlTop(); unsigned mask = 1 << ( FnCtlCondFlagCtor( fctl ) & 7 ); BEPatchInteger( cfs->ph_clr, 255 - mask ); } else { BEPatchInteger( cfs->ph_clr, -1 ); } BEFiniPatch( cfs->ph_clr ); CarveFree( carve_ctor_flag, cfs ); }
static cg_name ctorFlagSet( // SET/RESET CTOR FLAG FN_CTL* fctl, // - function info cg_op opcode, // - set/reset opcode patch_handle* a_ph ) // - addr[ patch_handle ] { unsigned offset; // - offset of flag byte unsigned mask; // - mask for byte cg_name op_flg; // - expression for code-gen mask = FnCtlCondFlagCtor( fctl ); offset = mask / 8; mask &= 7; op_flg = CgSymbolPlusOffset( FstabRw(), offset + CgbkInfo.size_rw_base ); *a_ph = BEPatch(); op_flg = CGLVPreGets( opcode , op_flg , CGPatchNode( *a_ph, TY_UINT_1 ) , TY_UINT_1 ); return op_flg; }
void CondInfoSetCtorTest( // SET/RESET FLAG FOR CTOR-TEST FN_CTL* fctl, // - function control bool set_flag ) // - true ==> set the flag; false ==> clear { CGDone( condSet( FnCtlCondFlagCtor( fctl ), set_flag, fctl ) ); }