Changeset 165 for soft/giet_vm/memo/src/memo.cpp
- Timestamp:
- Jul 4, 2012, 2:51:18 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/memo/src/memo.cpp
r163 r165 39 39 #include "memo.h" 40 40 41 42 41 //#define MOVER_DEBUG 43 42 … … 56 55 #ifdef MOVER_DEBUG 57 56 std::cout << "Binary file path: " << m_path << std::endl; 58 //print_mapping_info(m_data);57 print_mapping_info(m_data); 59 58 #endif 60 59 … … 141 140 } 142 141 142 ////////////////////////////////////////// 143 143 void* MeMo::load_bin(std::string filename) 144 144 { … … 167 167 } 168 168 169 169 ///////////// 170 170 MeMo::~MeMo() 171 171 { … … 216 216 MAPPING_CLUSTER_SIZE*header->clusters + 217 217 MAPPING_PSEG_SIZE*header->psegs + 218 MAPPING_VSPACE_SIZE*header->vs egs +219 MAPPING_VS PACE_SIZE*header->vspaces);218 MAPPING_VSPACE_SIZE*header->vspaces + 219 MAPPING_VSEG_SIZE*header->vsegs); 220 220 } 221 221 … … 233 233 234 234 // header 235 std::cout << std::hex << "mapping_info" << std:: endl235 std::cout << std::hex << "mapping_info" << std::dec << std::endl 236 236 << " + signature = " << header->signature << std::endl 237 << " + name = " << header->name << std::endl 238 << " + clusters = " << header->clusters << std::endl 239 << " + psegs = " << header->psegs << std::endl 240 << " + ttys = " << header->ttys << std::endl 241 << " + vspaces = " << header->vspaces << std::endl 242 << " + globals = " << header->globals << std::endl 243 << " + vsegs = " << header->vsegs << std::endl 244 << " + tasks = " << header->tasks << std::endl; 237 << " + name = " << header->name << std::endl 238 << " + clusters = " << header->clusters << std::endl 239 << " + psegs = " << header->psegs << std::endl 240 << " + ttys = " << header->ttys << std::endl 241 << " + fbs = " << header->fbs << std::endl 242 << " + vspaces = " << header->vspaces << std::endl 243 << " + globals = " << header->globals << std::endl 244 << " + vsegs = " << header->vsegs << std::endl 245 << " + vobjs = " << header->vsegs << std::endl 246 << " + tasks = " << header->tasks << std::endl; 245 247 246 248 // psegs 247 249 for ( size_t pseg_id = 0 ; pseg_id < header->psegs ; pseg_id++ ) 248 250 { 249 std::cout << "pseg " << pseg_id << std::endl 250 << " + name = " << pseg[pseg_id].name << std::endl 251 << " + base = " << pseg[pseg_id].base << std::endl 252 << " + length = " << pseg[pseg_id].length << std::endl ; 251 std::cout << "pseg " << pseg[pseg_id].name << std::hex << std::endl 252 << " + base = " << pseg[pseg_id].base << std::endl 253 << " + length = " << pseg[pseg_id].length << std::endl ; 253 254 } 254 255 … … 256 257 for ( size_t vseg_id = 0 ; vseg_id < header->globals ; vseg_id++ ) 257 258 { 258 std::cout << "global vseg: " << vseg_id << std::endl 259 << " + name = " << vseg[vseg_id].name << std::endl 260 << " + vbase = " << vseg[vseg_id].vbase << std::endl 261 << " + length = " << vseg[vseg_id].length << std::endl 262 << " + mode = " << (size_t)vseg[vseg_id].mode << std::endl 263 << " + ident = " << (bool)vseg[vseg_id].ident << std::endl 264 << " + psegname" << pseg[vseg[vseg_id].psegid].name << std::endl; 265 for(size_t vobj_id = vseg[vseg_id].vobj_offset ; vobj_id < vseg[vseg_id].vobj_offset + vseg[vseg_id].vobjs ; vobj_id++ ) 266 { 267 std::cout << "\t vobjs = "<< vobj[vobj_id].name << std::endl; 268 std::cout<<"\t name =" << vobj[vobj_id].name <<std::endl; 269 std::cout<<"\t type =" << vobj[vobj_id].type <<std::endl; 270 std::cout<<"\t length =" << vobj[vobj_id].length <<std::endl; 271 std::cout<<"\t align =" << vobj[vobj_id].align <<std::endl; 272 std::cout<<"\t binpath =" << vobj[vobj_id].binpath <<std::endl; 273 std::cout<<"\t \n"; 274 } 275 } 276 259 std::cout << std::endl; 260 std::cout << "global vseg " << vseg[vseg_id].name << std::hex << std::endl 261 << " + vbase = " << vseg[vseg_id].vbase << std::endl 262 << " + length = " << vseg[vseg_id].length << std::endl 263 << " + mode = " << (size_t)vseg[vseg_id].mode << std::endl 264 << " + ident = " << (bool)vseg[vseg_id].ident << std::endl 265 << " + psegname = " << pseg[vseg[vseg_id].psegid].name << std::endl; 266 for( size_t vobj_id = vseg[vseg_id].vobj_offset ; 267 vobj_id < vseg[vseg_id].vobj_offset + vseg[vseg_id].vobjs ; 268 vobj_id++ ) 269 { 270 std::cout << "\t vobj " << vobj[vobj_id].name << std::endl 271 << "\t + index = " << std::dec << vobj_id << std::endl 272 << "\t + type = " << vobj[vobj_id].type << std::endl 273 << "\t + length = " << vobj[vobj_id].length << std::endl 274 << "\t + align = " << vobj[vobj_id].align << std::endl 275 << "\t + binpath = " << vobj[vobj_id].binpath << std::endl 276 << "\t + init = " << vobj[vobj_id].init << std::endl; 277 } 278 } 277 279 278 280 // vspaces 279 281 for ( size_t vspace_id = 0 ; vspace_id < header->vspaces ; vspace_id++ ) 280 282 { 281 std::cout << "***vspace: " << vspace_id << "***" << std::endl 282 << " + name = " << vspace[vspace_id].name << std::endl 283 << " + ttys = " << vspace[vspace_id].ttys << std::endl; 283 std::cout << "***vspace " << vspace[vspace_id].name << std::endl 284 << " + vsegs = " << vspace[vspace_id].vsegs << std::endl 285 << " + vobjs = " << vspace[vspace_id].vobjs << std::endl 286 << " + tasks = " << vspace[vspace_id].tasks << std::endl; 284 287 285 288 for ( size_t vseg_id = vspace[vspace_id].vseg_offset ; … … 287 290 vseg_id++ ) 288 291 { 289 std::cout << " private vseg: ";290 std::cout << vseg_id<< std::endl291 << " + name = " << vseg[vseg_id].name<< std::endl292 << " + vbase = " << vseg[vseg_id].vbase<< std::endl293 << " + length = " << vseg[vseg_id].length<< std::endl294 << " + mode = " << (size_t)vseg[vseg_id].mode << std::endl295 << " + ident = " << (bool)vseg[vseg_id].ident << std::endl296 << " + psegname = " << pseg[vseg[vseg_id].psegid].name << std::endl << std::endl;297 for(size_t vobj_id = vseg[vseg_id].vobj_offset ; vobj_id < vseg[vseg_id].vobj_offset + vseg[vseg_id].vobjs ;vobj_id++ )292 std::cout << "\t vseg " << vseg[vseg_id].name << std::endl 293 << "\t + vbase = " << vseg[vseg_id].vbase << std::endl 294 << "\t + length = " << vseg[vseg_id].length << std::endl 295 << "\t + mode = " << (size_t)vseg[vseg_id].mode << std::endl 296 << "\t + ident = " << (bool)vseg[vseg_id].ident << std::endl 297 << "\t + psegname = " << pseg[vseg[vseg_id].psegid].name << std::endl; 298 for(size_t vobj_id = vseg[vseg_id].vobj_offset ; 299 vobj_id < vseg[vseg_id].vobj_offset + vseg[vseg_id].vobjs ; 300 vobj_id++ ) 298 301 { 299 std::cout<<"\t\t vobjs =" << vobj[vobj_id].name <<std::endl; 300 std::cout<<"\t\t name =" << vobj[vobj_id].name <<std::endl; 301 std::cout<<"\t\t type =" << vobj[vobj_id].type <<std::endl; 302 std::cout<<"\t\t length =" << vobj[vobj_id].length <<std::endl; 303 std::cout<<"\t\t align =" << vobj[vobj_id].align <<std::endl; 304 std::cout<<"\t\t binpath =" << vobj[vobj_id].binpath <<std::endl; 302 std::cout << "\t\t vobj " << vobj[vobj_id].name << std::endl 303 << "\t\t + index = " << std::dec << vobj_id << std::endl 304 << "\t\t + type = " << vobj[vobj_id].type << std::endl 305 << "\t\t + length = " << vobj[vobj_id].length << std::endl 306 << "\t\t + align = " << vobj[vobj_id].align << std::endl 307 << "\t\t + binpath = " << vobj[vobj_id].binpath << std::endl 308 << "\t\t + init = " << vobj[vobj_id].init << std::endl; 305 309 } 306 310 } … … 309 313 } // end print_mapping_info() 310 314 311 ////////////////////////////////////////// /////////////////////////////////315 ////////////////////////////////////////// 312 316 void MeMo::pseg_map( mapping_pseg_t* pseg) 313 317 { … … 317 321 318 322 319 ////////////////////////////////////////// /////////////////////////////////323 ////////////////////////////////////////// 320 324 void MeMo::vseg_map( mapping_vseg_t* vseg) 321 325 { 322 323 326 mapping_vobj_t* vobj = get_vobj_base( (mapping_header_t*) m_data ); 324 327 PSeg *ps = &(m_psegh.get(vseg->psegid));// get physical segment pointer(PSegHandler::get) … … 354 357 #endif 355 358 356 if(cur_vobj->type == ELF)359 if(cur_vobj->type == VOBJ_TYPE_ELF) 357 360 { 358 361 if(!first) … … 475 478 476 479 477 /////////////////////////////// //////////////////////////////////////480 /////////////////////////////// 478 481 void MeMo::buildMap(void* desc) 479 482 { … … 485 488 486 489 // get the psegs 490 487 491 #ifdef MOVER_DEBUG 488 492 std::cout << "\n******* Storing Pseg information *********\n" << std::endl; 489 493 #endif 494 490 495 for ( size_t pseg_id = 0 ; pseg_id < header->psegs ; pseg_id++ ) 491 496 { … … 494 499 495 500 // map global vsegs 501 496 502 #ifdef MOVER_DEBUG 497 503 std::cout << "\n******* mapping global vsegs *********\n" << std::endl; 498 504 #endif 505 499 506 for ( size_t vseg_id = 0 ; vseg_id < header->globals ; vseg_id++ ) 500 507 { … … 502 509 } 503 510 504 // secondloop on virtual spaces to map private vsegs511 // loop on virtual spaces to map private vsegs 505 512 for (size_t vspace_id = 0 ; vspace_id < header->vspaces ; vspace_id++ ) 506 513 {
Note: See TracChangeset
for help on using the changeset viewer.