sysinfo: Fixed incorrect memory stats on PAE systems.

Memory statistics were calculated as 32-bit values, so they were incorrect
on machines with more than 4GB RAM (and on x86_64).
This commit is contained in:
Alex Smith 2013-07-10 14:02:05 +01:00
parent 8f5729e1b9
commit d1a2f6371a

View File

@ -686,13 +686,13 @@ dump_cpus(system_info *info)
static void
dump_mem(system_info *info)
{
printf("%10" B_PRIu32 " bytes free (used/max %10" B_PRIu32 " / %10"
B_PRIu32 ")\n",
B_PAGE_SIZE * (uint32)(info->max_pages - info->used_pages),
B_PAGE_SIZE * (uint32)info->used_pages,
B_PAGE_SIZE * (uint32)info->max_pages);
printf(" (cached %10" B_PRIu32 ")\n",
B_PAGE_SIZE * (uint32)info->cached_pages);
printf("%10" B_PRIu64 " bytes free (used/max %10" B_PRIu64 " / %10"
B_PRIu64 ")\n",
B_PAGE_SIZE * (uint64)(info->max_pages - info->used_pages),
B_PAGE_SIZE * (uint64)info->used_pages,
B_PAGE_SIZE * (uint64)info->max_pages);
printf(" (cached %10" B_PRIu64 ")\n",
B_PAGE_SIZE * (uint64)info->cached_pages);
}