ia64/linux-2.6.18-xen.hg

view fs/proc/mmu.c @ 524:7f8b544237bf

netfront: Allow netfront in domain 0.

This is useful if your physical network device is in a utility domain.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Apr 15 15:18:58 2008 +0100 (2008-04-15)
parents 831230e53067
children
line source
1 /* mmu.c: mmu memory info files
2 *
3 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
12 #include <linux/types.h>
13 #include <linux/errno.h>
14 #include <linux/time.h>
15 #include <linux/kernel.h>
16 #include <linux/string.h>
17 #include <linux/mman.h>
18 #include <linux/proc_fs.h>
19 #include <linux/mm.h>
20 #include <linux/mmzone.h>
21 #include <linux/pagemap.h>
22 #include <linux/swap.h>
23 #include <linux/slab.h>
24 #include <linux/smp.h>
25 #include <linux/seq_file.h>
26 #include <linux/hugetlb.h>
27 #include <linux/vmalloc.h>
28 #include <asm/uaccess.h>
29 #include <asm/pgtable.h>
30 #include <asm/tlb.h>
31 #include <asm/div64.h>
32 #include "internal.h"
34 void get_vmalloc_info(struct vmalloc_info *vmi)
35 {
36 struct vm_struct *vma;
37 unsigned long free_area_size;
38 unsigned long prev_end;
40 vmi->used = 0;
42 if (!vmlist) {
43 vmi->largest_chunk = VMALLOC_TOTAL;
44 }
45 else {
46 vmi->largest_chunk = 0;
48 prev_end = VMALLOC_START;
50 read_lock(&vmlist_lock);
52 for (vma = vmlist; vma; vma = vma->next) {
53 unsigned long addr = (unsigned long) vma->addr;
55 /*
56 * Some archs keep another range for modules in vmlist
57 */
58 if (addr < VMALLOC_START)
59 continue;
60 if (addr >= VMALLOC_END)
61 break;
63 vmi->used += vma->size;
65 free_area_size = addr - prev_end;
66 if (vmi->largest_chunk < free_area_size)
67 vmi->largest_chunk = free_area_size;
69 prev_end = vma->size + addr;
70 }
72 if (VMALLOC_END - prev_end > vmi->largest_chunk)
73 vmi->largest_chunk = VMALLOC_END - prev_end;
75 read_unlock(&vmlist_lock);
76 }
77 }