Ticket #1925: 1925-page-mapper-debug-output.diff
File 1925-page-mapper-debug-output.diff, 3.0 KB (added by , 15 years ago) |
---|
-
src/system/kernel/arch/x86/x86_physical_page_mapper_large_memory.cpp
480 480 LargeMemoryPhysicalPageMapper::Init(kernel_args* args, 481 481 TranslationMapPhysicalPageMapper*& _kernelPageMapper) 482 482 { 483 dprintf("%p->LargeMemoryPhysicalPageMapper::Init()\n", this); 483 484 // We reserve more, so that we can guarantee to align the base address 484 485 // to page table ranges. 485 486 addr_t virtualBase = vm_allocate_early(args, … … 489 490 "physical page pool space in virtual address space!"); 490 491 return B_ERROR; 491 492 } 493 dprintf(" reserved page pool space: %#" B_PRIxADDR "\n", virtualBase); 492 494 virtualBase = (virtualBase + kPageTableAlignment - 1) 493 495 / kPageTableAlignment * kPageTableAlignment; 496 dprintf(" aligned page pool space: %#" B_PRIxADDR "\n", virtualBase); 494 497 495 498 // allocate memory for the page table and data 496 499 size_t areaSize = B_PAGE_SIZE + sizeof(PhysicalPageSlot[1024]); 497 500 page_table_entry* pageTable = (page_table_entry*)vm_allocate_early(args, 498 501 areaSize, ~0L, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, false); 502 dprintf(" allocated memory for page table and data: %p (%" B_PRIuSIZE 503 " bytes)\n", pageTable, areaSize); 499 504 500 505 // prepare the page table 501 506 x86_early_prepare_page_tables(pageTable, virtualBase, … … 506 511 fNonEmptyPools.Add(&fInitialPool); 507 512 508 513 // get the debug slot 509 GetSlot(true, fDebugSlot); 514 status_t error = GetSlot(true, fDebugSlot); 515 dprintf(" GetSlot() returned: %s, fDebugSlot: %p\n", strerror(error), fDebugSlot); 510 516 511 517 // init the kernel translation map physical page mapper 512 status_terror = fKernelMapper.Init();518 error = fKernelMapper.Init(); 513 519 if (error != B_OK) { 514 520 panic("LargeMemoryPhysicalPageMapper::Init(): Failed to init " 515 521 "kernel translation map physical page mapper!"); … … 522 528 for (int32 i = 0; i < cpuCount; i++) 523 529 fPerCPUData[i].Init(); 524 530 531 dprintf("LargeMemoryPhysicalPageMapper::Init() done\n"); 525 532 return B_OK; 526 533 } 527 534 … … 802 809 PhysicalPageSlot*& slot) 803 810 { 804 811 MutexLocker locker(fLock); 812 dprintf("LargeMemoryPhysicalPageMapper::GetSlot(%d)\n", canWait); 805 813 806 814 PhysicalPageSlotPool* pool = fNonEmptyPools.Head(); 807 815 if (pool == NULL) { 816 dprintf(" no non-empty pool\n"); 808 817 if (!canWait) 809 818 return B_WOULD_BLOCK; 810 819 … … 812 821 locker.Unlock(); 813 822 status_t error = _AllocatePool(pool); 814 823 if (error != B_OK) 824 { 825 dprintf("LargeMemoryPhysicalPageMapper::GetSlot(): failed to allocate new pool: %s\n", strerror(error)); 815 826 return error; 827 } 816 828 locker.Lock(); 829 dprintf(" allocated pool %p\n", pool); 817 830 818 831 fNonEmptyPools.Add(pool); 819 832 pool = fNonEmptyPools.Head(); 820 833 } 821 834 835 dprintf(" got pool %p\n", pool); 836 822 837 slot = pool->GetSlot(); 838 dprintf(" got slot %p\n", slot); 823 839 824 840 if (pool->IsEmpty()) { 825 841 fNonEmptyPools.Remove(pool); 826 842 fEmptyPools.Add(pool); 827 843 } 828 844 845 dprintf("LargeMemoryPhysicalPageMapper::GetSlot() done: %p\n", slot); 829 846 return B_OK; 830 847 } 831 848