diff --git a/headers/private/kernel/vm/vm_types.h b/headers/private/kernel/vm/vm_types.h index 4922e1636e..2113a9d038 100644 --- a/headers/private/kernel/vm/vm_types.h +++ b/headers/private/kernel/vm/vm_types.h @@ -94,21 +94,16 @@ struct vm_page { vint32 accessing_thread; #endif - uint8 type : 2; + uint8 is_dummy : 1; uint8 state : 3; uint8 busy_writing : 1; - uint8 unused : 2; // used in VMAnonymousCache::Merge() + uint8 unused : 3; int8 usage_count; uint16 wired_count; }; -enum { - PAGE_TYPE_PHYSICAL = 0, - PAGE_TYPE_DUMMY, - PAGE_TYPE_GUARD -}; enum { PAGE_STATE_ACTIVE = 0, diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp index e9f0a20735..2a827f710b 100644 --- a/src/system/kernel/vm/vm.cpp +++ b/src/system/kernel/vm/vm.cpp @@ -2767,16 +2767,15 @@ dump_cache(int argc, char** argv) if (showPages) { for (VMCachePagesTree::Iterator it = cache->pages.GetIterator(); vm_page* page = it.Next();) { - if (page->type == PAGE_TYPE_PHYSICAL) { - kprintf("\t%p ppn 0x%lx offset 0x%lx type %u state %u (%s) " + if (!page->is_dummy) { + kprintf("\t%p ppn 0x%lx offset 0x%lx state %u (%s) " "wired_count %u\n", page, page->physical_page_number, - page->cache_offset, page->type, page->state, + page->cache_offset, page->state, page_state_to_string(page->state), page->wired_count); - } else if(page->type == PAGE_TYPE_DUMMY) { + } else { kprintf("\t%p DUMMY PAGE state %u (%s)\n", page, page->state, page_state_to_string(page->state)); - } else - kprintf("\t%p UNKNOWN PAGE type %u\n", page, page->type); + } } } else kprintf("\t%ld in cache\n", cache->page_count); diff --git a/src/system/kernel/vm/vm_page.cpp b/src/system/kernel/vm/vm_page.cpp index adeddc471f..49f9f1af40 100644 --- a/src/system/kernel/vm/vm_page.cpp +++ b/src/system/kernel/vm/vm_page.cpp @@ -408,7 +408,7 @@ dump_page(int argc, char **argv) kprintf("cache: %p\n", page->cache); kprintf("cache_offset: %ld\n", page->cache_offset); kprintf("cache_next: %p\n", page->cache_next); - kprintf("type: %d\n", page->type); + kprintf("is dummy: %d\n", page->is_dummy); kprintf("state: %s\n", page_state_to_string(page->state)); kprintf("wired_count: %d\n", page->wired_count); kprintf("usage_count: %d\n", page->usage_count); @@ -861,7 +861,7 @@ page_scrubber(void *unused) static inline bool is_marker_page(struct vm_page *page) { - return page->type == PAGE_TYPE_DUMMY; + return page->is_dummy; } @@ -1359,7 +1359,7 @@ page_writer(void* /*unused*/) } vm_page marker; - marker.type = PAGE_TYPE_DUMMY; + marker.is_dummy = true; marker.cache = NULL; marker.state = PAGE_STATE_UNUSED; #if DEBUG_PAGE_QUEUE @@ -1586,7 +1586,7 @@ steal_pages(vm_page **pages, size_t count) { while (true) { vm_page marker; - marker.type = PAGE_TYPE_DUMMY; + marker.is_dummy = true; marker.cache = NULL; marker.state = PAGE_STATE_UNUSED; #if DEBUG_PAGE_QUEUE @@ -1884,7 +1884,7 @@ vm_page_init(kernel_args *args) // initialize the free page table for (uint32 i = 0; i < sNumPages; i++) { sPages[i].physical_page_number = sPhysicalPageOffset + i; - sPages[i].type = PAGE_TYPE_PHYSICAL; + sPages[i].is_dummy = false; sPages[i].state = PAGE_STATE_FREE; new(&sPages[i].mappings) vm_page_mappings(); sPages[i].wired_count = 0;