BOOL CConfigData::bGetData(void*& lpData, int& nStreamLength, std::string strSectionName) { BOOL bRetVal = FALSE; // is the configuration loaded? // if((m_bConfigInfoLoaded == TRUE) && (bRetVal == TRUE)) { SectionData tempSecData; tempSecData.sectionName = strSectionName; bRetVal = getSectionData(m_strCurrProjName, tempSecData.sectionName, tempSecData); if (bRetVal != FALSE) { bRetVal = FALSE; BYTE* pbNewDat = new BYTE[tempSecData.blobLen]; if (pbNewDat != NULL) { memcpy(pbNewDat, tempSecData.blob, tempSecData.blobLen); nStreamLength = tempSecData.blobLen; lpData = (void*) pbNewDat; bRetVal = TRUE; } else { } } } return bRetVal; }
void EhFrame::moveInputFragments(EhFrame& pInFrame, CIE& pInCIE, CIE* pOutCIE) { SectionData& in_sd = *pInFrame.getSectionData(); SectionData::FragmentListType& in_frag_list = in_sd.getFragmentList(); SectionData& out_sd = *getSectionData(); SectionData::FragmentListType& out_frag_list = out_sd.getFragmentList(); if (!pOutCIE) { // Newly inserted Fragment* frag = in_frag_list.remove(SectionData::iterator(pInCIE)); out_frag_list.push_back(frag); frag->setParent(&out_sd); for (fde_iterator i = pInCIE.begin(), e = pInCIE.end(); i != e; ++i) { frag = in_frag_list.remove(SectionData::iterator(**i)); out_frag_list.push_back(frag); frag->setParent(&out_sd); } return; } SectionData::iterator cur_iter(*pOutCIE); assert(cur_iter != out_frag_list.end()); for (fde_iterator i = pInCIE.begin(), e = pInCIE.end(); i != e; ++i) { Fragment* frag = in_frag_list.remove(SectionData::iterator(**i)); cur_iter = out_frag_list.insertAfter(cur_iter, frag); frag->setParent(&out_sd); } }
void EhFrame::moveInputFragments(EhFrame& pInFrame) { SectionData& in_sd = *pInFrame.getSectionData(); SectionData::FragmentListType& in_frag_list = in_sd.getFragmentList(); SectionData& out_sd = *getSectionData(); SectionData::FragmentListType& out_frag_list = out_sd.getFragmentList(); while (!in_frag_list.empty()) { Fragment* frag = in_frag_list.remove(in_frag_list.begin()); out_frag_list.push_back(frag); frag->setParent(&out_sd); } }
size_t EhFrame::computeOffsetSize() { size_t offset = 0u; SectionData::FragmentListType& frag_list = getSectionData()->getFragmentList(); for (SectionData::iterator i = frag_list.begin(), e = frag_list.end(); i != e; ++i) { Fragment& frag = *i; frag.setOffset(offset); offset += frag.size(); } getSection().setSize(offset); return offset; }
errlHndl_t AttributeSync::syncSectionToFsp( TARGETING::SECTION_TYPE i_section_to_sync ) { errlHndl_t l_errl = NULL; msg_t * msg = NULL; iv_section_to_sync = i_section_to_sync; do{ // set up the pointers to the data area getSectionData(); for( iv_current_page = 0; iv_current_page < iv_total_pages; iv_current_page++ ) { msg = msg_allocate(); msg->type = ATTR_SYNC_SECTION_TO_FSP; msg->data[0] = 0; ATTR_SYNC_ADD_SECTION_ID( iv_section_to_sync, msg->data[0] ); ATTR_SYNC_ADD_PAGE_NUMBER( iv_current_page, msg->data[0] ); // set the 2nd data word to the buffer size msg->data[1] = PAGESIZE; // allocated storage will always be 4k msg->extra_data = MBOX::allocate( PAGESIZE ); // copy the attributes from mem to our buffer. memcpy( msg->extra_data, iv_pages[iv_current_page].dataPtr, PAGESIZE ); TARG_INF("syncSectionToFsp() - copy %d bytes from %p to %p", PAGESIZE, iv_pages[iv_current_page].dataPtr, msg->extra_data); // mailbox code will free both the msg and the extra data // we allocated above for an async message. l_errl = sendMboxMessage( ASYNCHRONOUS, msg ); if( l_errl ) { TARG_ERR("failed sending sync message"); break; } } if(( l_errl == NULL ) && ( iv_total_pages != 0 )) { // tell fsp to commit the last section of data we sent l_errl = sendSyncCompleteMessage(); if( l_errl ) { TARG_ERR("failed sending sync complete message"); } } }while(0); return l_errl; }