Commit 6a9b28dd authored by Miles Bader's avatar Miles Bader Committed by Linus Torvalds

[PATCH] v850: Add show_mem

Signed-off-by: default avatarMiles Bader <miles@gnu.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 20216fc8
...@@ -294,3 +294,33 @@ init_mem_alloc (unsigned long ram_start, unsigned long ram_len) ...@@ -294,3 +294,33 @@ init_mem_alloc (unsigned long ram_start, unsigned long ram_len)
free_area_init_node (0, NODE_DATA(0), zones_size, free_area_init_node (0, NODE_DATA(0), zones_size,
ADDR_TO_PAGE (PAGE_OFFSET), 0); ADDR_TO_PAGE (PAGE_OFFSET), 0);
} }
/* Taken from m68knommu */
void show_mem(void)
{
unsigned long i;
int free = 0, total = 0, reserved = 0, shared = 0;
int cached = 0;
printk(KERN_INFO "\nMem-info:\n");
show_free_areas();
i = max_mapnr;
while (i-- > 0) {
total++;
if (PageReserved(mem_map+i))
reserved++;
else if (PageSwapCache(mem_map+i))
cached++;
else if (!page_count(mem_map+i))
free++;
else
shared += page_count(mem_map+i) - 1;
}
printk(KERN_INFO "%d pages of RAM\n",total);
printk(KERN_INFO "%d free pages\n",free);
printk(KERN_INFO "%d reserved pages\n",reserved);
printk(KERN_INFO "%d pages shared\n",shared);
printk(KERN_INFO "%d pages swap cached\n",cached);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment