Changeset 610 for trunk/kernel/mm/mapper.c
- Timestamp:
- Dec 27, 2018, 7:38:58 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/mapper.c
r606 r610 188 188 { 189 189 190 if( mapper_cxy == local_cxy ) // mapper is local 191 { 192 190 193 #if (DEBUG_MAPPER_GET_PAGE & 1) 191 194 if( DEBUG_MAPPER_GET_PAGE < cycle ) 192 printk("\n[%s] missing page => load it from IOC device\n", __FUNCTION__ ); 193 #endif 194 if( mapper_cxy == local_cxy ) // mapper is local 195 { 195 printk("\n[%s] missing page => load it from FS / local access \n", __FUNCTION__ ); 196 #endif 196 197 error = mapper_handle_miss( mapper_ptr, 197 198 page_id, … … 200 201 else 201 202 { 203 204 #if (DEBUG_MAPPER_GET_PAGE & 1) 205 if( DEBUG_MAPPER_GET_PAGE < cycle ) 206 printk("\n[%s] missing page => load it from FS / RPC access \n", __FUNCTION__ ); 207 #endif 202 208 rpc_mapper_handle_miss_client( mapper_cxy, 203 209 mapper_ptr, … … 253 259 vfs_inode_t * inode = mapper->inode; 254 260 vfs_inode_get_name( XPTR( local_cxy , inode ) , name ); 255 if( DEBUG_MAPPER_HANDLE_MISS < cycle ) 256 printk("\n[%s] enter for page %d in <%s> / cycle %d\n", 261 // if( DEBUG_MAPPER_HANDLE_MISS < cycle ) 262 // if( (page_id == 1) && (cycle > 10000000) ) 263 printk("\n[%s] enter for page %d in <%s> / cycle %d", 257 264 __FUNCTION__, page_id, name, cycle ); 258 265 if( DEBUG_MAPPER_HANDLE_MISS & 1 ) 259 grdxt_display( &mapper->rt, name );260 #endif 261 262 // allocate one page from the mappercluster266 grdxt_display( XPTR( local_cxy , &mapper->rt ) , name ); 267 #endif 268 269 // allocate one page from the local cluster 263 270 req.type = KMEM_PAGE; 264 271 req.size = 0; … … 313 320 #if DEBUG_MAPPER_HANDLE_MISS 314 321 cycle = (uint32_t)hal_get_cycles(); 315 if( DEBUG_MAPPER_HANDLE_MISS < cycle ) 316 printk("\n[%s] exit for page %d in <%s> / ppn %x / cycle %d\n", 322 // if( DEBUG_MAPPER_HANDLE_MISS < cycle ) 323 // if( (page_id == 1) && (cycle > 10000000) ) 324 printk("\n[%s] exit for page %d in <%s> / ppn %x / cycle %d", 317 325 __FUNCTION__, page_id, name, ppm_page2ppn( *page_xp ), cycle ); 318 326 if( DEBUG_MAPPER_HANDLE_MISS & 1 ) 319 grdxt_display( &mapper->rt, name );327 grdxt_display( XPTR( local_cxy , &mapper->rt ) , name ); 320 328 #endif 321 329 … … 348 356 } // end mapper_release_page() 349 357 350 //////////////////////////////////////////// 351 error_t mapper_move_user( mapper_t * mapper,358 /////////////////////////////////////////////// 359 error_t mapper_move_user( xptr_t mapper_xp, 352 360 bool_t to_buffer, 353 361 uint32_t file_offset, … … 355 363 uint32_t size ) 356 364 { 357 xptr_t mapper_xp; // extended pointer on local mapper358 365 uint32_t page_offset; // first byte to move to/from a mapper page 359 366 uint32_t page_count; // number of bytes to move to/from a mapper page … … 371 378 #endif 372 379 373 // build extended pointer on mapper374 mapper_xp = XPTR( local_cxy , mapper );375 376 380 // compute offsets of first and last bytes in file 377 381 uint32_t min_byte = file_offset; … … 384 388 #if (DEBUG_MAPPER_MOVE_USER & 1) 385 389 if( DEBUG_MAPPER_MOVE_USER < cycle ) 386 printk("\n[%s] first_page %d / last_page %d\n", __FUNCTION__, first, last ); 390 printk("\n[%s] thread[%x,%x] : first_page %d / last_page %d\n", 391 __FUNCTION__, this->process->pid, this->trdid, first, last ); 387 392 #endif 388 393 … … 404 409 #if (DEBUG_MAPPER_MOVE_USER & 1) 405 410 if( DEBUG_MAPPER_MOVE_USER < cycle ) 406 printk("\n[%s] page_id = %d / page_offset = %d / page_count = %d\n",407 __FUNCTION__ 411 printk("\n[%s] thread[%x,%x] : page_id = %d / page_offset = %d / page_count = %d\n", 412 __FUNCTION__, this->process->pid, this->trdid, page_id , page_offset , page_count ); 408 413 #endif 409 414 … … 412 417 413 418 if ( page_xp == XPTR_NULL ) return -1; 419 420 #if (DEBUG_MAPPER_MOVE_USER & 1) 421 if( DEBUG_MAPPER_MOVE_USER < cycle ) 422 printk("\n[%s] thread[%x,%x] : get page (%x,%x) from mapper\n", 423 __FUNCTION__, this->process->pid, this->trdid, GET_CXY(page_xp), GET_PTR(page_xp) ); 424 #endif 414 425 415 426 // compute pointer in mapper … … 547 558 } 548 559 560 #if (DEBUG_MAPPER_MOVE_KERNEL & 1) 561 if( DEBUG_MAPPER_MOVE_KERNEL < cycle ) 562 printk("\n[%s] src_cxy %x / src_ptr %x / dst_cxy %x / dst_ptr %x\n", 563 __FUNCTION__, src_cxy, src_ptr, dst_cxy, dst_ptr ); 564 #endif 565 549 566 // move fragment 550 567 hal_remote_memcpy( XPTR( dst_cxy , dst_ptr ), XPTR( src_cxy , src_ptr ), page_count );
Note: See TracChangeset
for help on using the changeset viewer.