diff options
| author | Christoph Hellwig <hch@infradead.org> | 2002-05-05 02:56:32 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-05-05 02:56:32 -0700 |
| commit | ac0f5e76ba898ca47d40c0fe65be2801fa9fab64 (patch) | |
| tree | 5b646e5bdc14950c6b1560b5c118a670f7a02f70 /mm/page_alloc.c | |
| parent | bf0f0f39b3bf80fe08c7f848101316cfa4a1e7e9 (diff) | |
[PATCH] architecture-independand si_meminfo
Si_meminfo() is basically the same for all architectures (mips is a little
different by providing a value for the shared field that is different from
the originial intent, I will come back to this later), so it makes to have just
one instance of it:
Diffstat (limited to 'mm/page_alloc.c')
| -rw-r--r-- | mm/page_alloc.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index b896e28f0dda..17ced9e5f903 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -23,6 +23,8 @@ #include <linux/compiler.h> #include <linux/module.h> +unsigned long totalram_pages; +unsigned long totalhigh_pages; int nr_swap_pages; int nr_active_pages; int nr_inactive_pages; @@ -606,6 +608,22 @@ unsigned long get_page_cache_size(void) return ps.nr_pagecache; } +void si_meminfo(struct sysinfo *val) +{ + val->totalram = totalram_pages; + val->sharedram = 0; + val->freeram = nr_free_pages(); + val->bufferram = atomic_read(&buffermem_pages); +#ifdef CONFIG_HIGHMEM + val->totalhigh = totalhigh_pages; + val->freehigh = nr_free_highpages(); +#else + val->totalhigh = 0; + val->freehigh = 0; +#endif + val->mem_unit = PAGE_SIZE; +} + #define K(x) ((x) << (PAGE_SHIFT-10)) /* |
