Changeset 407 for trunk/kernel/mm/mapper.c
- Timestamp:
- Nov 7, 2017, 3:08:12 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/mapper.c
r406 r407 143 143 error_t error; 144 144 145 mapper_dmsg("\n[DMSG] %s :enters for page %d / mapper %x\n",146 __FUNCTION__, index , mapper );145 mapper_dmsg("\n[DBG] %s : core[%x,%d] enters for page %d / mapper %x\n", 146 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , index , mapper ); 147 147 148 148 thread_t * this = CURRENT_THREAD; … … 170 170 if ( page == NULL ) // missing page => create it and load it from file system 171 171 { 172 mapper_dmsg("\n[DMSG] %s : missing page => load from device\n", __FUNCTION__ ); 172 173 mapper_dmsg("\n[DBG] %s : core[%x,%d] missing page => load from device\n", 174 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid ); 173 175 174 176 // allocate one page from PPM … … 188 190 // initialize the page descriptor 189 191 page_init( page ); 190 page_set_flag( page , PG_INIT ); 191 page_set_flag( page , PG_INLOAD ); 192 page_set_flag( page , PG_INIT | PG_INLOAD ); 192 193 page_refcount_up( page ); 193 194 page->mapper = mapper; … … 215 216 error = vfs_mapper_move_page( page, 216 217 true ); // to mapper 217 218 218 if( error ) 219 219 { … … 231 231 page_clear_flag( page , PG_INLOAD ); 232 232 233 mapper_dmsg("\n[DBG] %s : missing page loaded / ppn = %x\n", 234 __FUNCTION__ , ppm_page2ppn(XPTR(local_cxy,page)) ); 235 233 236 } 234 237 else if( page_is_flag( page , PG_INLOAD ) ) // page is loaded by another thread … … 244 247 245 248 // deschedule 246 sched_yield( NULL);249 sched_yield(); 247 250 } 248 251 } … … 254 257 } 255 258 256 mapper_dmsg("\n[DMSG] %s : exit for page %d / mapper %x / page_desc = %x\n",257 259 mapper_dmsg("\n[DBG] %s : exit for page %d / mapper %x / page_desc = %x\n", 260 __FUNCTION__ , index , mapper , page ); 258 261 259 262 return page; … … 310 313 uint8_t * buf_ptr; // current buffer address 311 314 312 mapper_dmsg("\n[D MSG] %s : enters / to_buf = %d / buffer = %x\n",315 mapper_dmsg("\n[DBG] %s : enters / to_buf = %d / buffer = %x\n", 313 316 __FUNCTION__ , to_buffer , buffer ); 314 317 … … 336 339 else page_count = CONFIG_PPM_PAGE_SIZE; 337 340 338 mapper_dmsg("\n[D MSG] %s : index = %d / offset = %d / count = %d\n",341 mapper_dmsg("\n[DBG] %s : index = %d / offset = %d / count = %d\n", 339 342 __FUNCTION__ , index , page_offset , page_count ); 340 343 … … 351 354 buf_ptr = (uint8_t *)buffer + done; 352 355 353 mapper_dmsg("\n[D MSG] %s : index = %d / buf_ptr = %x / map_ptr = %x\n",356 mapper_dmsg("\n[DBG] %s : index = %d / buf_ptr = %x / map_ptr = %x\n", 354 357 __FUNCTION__ , index , buf_ptr , map_ptr ); 355 358 … … 368 371 } 369 372 370 mapper_dmsg("\n[D MSG] %s : exit for buffer %x\n",373 mapper_dmsg("\n[DBG] %s : exit for buffer %x\n", 371 374 __FUNCTION__, buffer ); 372 375 … … 397 400 uint8_t * buffer_ptr = (uint8_t *)GET_PTR( buffer_xp ); 398 401 399 mapper_dmsg("\n[DMSG] %s :to_buf = %d / buf_cxy = %x / buf_ptr = %x / size = %x\n",400 __FUNCTION__ , to_buffer , buffer_cxy , buffer_ptr, size );402 mapper_dmsg("\n[DBG] %s : core[%x,%d] / to_buf = %d / buf_cxy = %x / buf_ptr = %x / size = %x\n", 403 __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, to_buffer, buffer_cxy, buffer_ptr, size ); 401 404 402 405 // compute offsets of first and last bytes in file … … 408 411 uint32_t last = max_byte >> CONFIG_PPM_PAGE_SHIFT; 409 412 410 mapper_dmsg("\n[DMSG] %s :first_page = %d / last_page = %d\n",411 __FUNCTION__ , first, last );413 mapper_dmsg("\n[DBG] %s : core[%x,%d] / first_page = %d / last_page = %d\n", 414 __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, first, last ); 412 415 413 416 // compute source and destination clusters … … 438 441 else page_count = CONFIG_PPM_PAGE_SIZE; 439 442 440 mapper_dmsg("\n[DMSG] %s :page_index = %d / offset = %d / bytes = %d\n",441 __FUNCTION__ , index , page_offset, page_count );443 mapper_dmsg("\n[DBG] %s : core[%x;%d] / page_index = %d / offset = %d / bytes = %d\n", 444 __FUNCTION__ , local_cxy, CURRENT_THREAD->core->lid, index, page_offset, page_count ); 442 445 443 446 // get page descriptor … … 470 473 } 471 474 472 mapper_dmsg("\n[DMSG] %s :exit / buf_cxy = %x / buf_ptr = %x / size = %x\n",473 __FUNCTION__ , buffer_cxy , buffer_ptr, size );475 mapper_dmsg("\n[DBG] %s : core_cxy[%x,%d] / exit / buf_cxy = %x / buf_ptr = %x / size = %x\n", 476 __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, buffer_cxy, buffer_ptr, size ); 474 477 475 478 return 0;
Note: See TracChangeset
for help on using the changeset viewer.