kern_return_t default_pager_info( memory_object_default_t pager, default_pager_info_t *infop) { uint64_t pages_total, pages_free; if (pager != default_pager_object) return KERN_INVALID_ARGUMENT; bs_global_info(&pages_total, &pages_free); infop->dpi_total_space = (vm_size_t) ptoa_64(pages_total); infop->dpi_free_space = (vm_size_t) ptoa_64(pages_free); infop->dpi_page_size = vm_page_size; return KERN_SUCCESS; }
kern_return_t default_pager_info( mach_port_t pager, default_pager_info_t *infop) { vm_size_t pages_total, pages_free; if (pager != default_pager_default_port) return KERN_INVALID_ARGUMENT; bs_global_info(&pages_total, &pages_free); infop->dpi_total_space = ptoa(pages_total); infop->dpi_free_space = ptoa(pages_free); infop->dpi_page_size = vm_page_size; return KERN_SUCCESS; }
kern_return_t default_pager_info_64( memory_object_default_t pager, default_pager_info_64_t *infop) { uint64_t pages_total, pages_free; if (pager != default_pager_object) return KERN_INVALID_ARGUMENT; bs_global_info(&pages_total, &pages_free); infop->dpi_total_space = ptoa_64(pages_total); infop->dpi_free_space = ptoa_64(pages_free); infop->dpi_page_size = vm_page_size; infop->dpi_flags = 0; if (dp_encryption_inited && dp_encryption == TRUE) { infop->dpi_flags |= DPI_ENCRYPTED; } return KERN_SUCCESS; }