17 #include <linux/module.h>
20 #include <asm/pgtable.h>
55 # ifdef CONFIG_HIGHMEM
66 { 0x8000000000000000
UL,
"Kernel Space" },
75 { 0,
"vmalloc() Area" },
76 { 0,
"vmalloc() End" },
77 # ifdef CONFIG_HIGHMEM
78 { 0,
"Persisent kmap() Area" },
86 #define PTE_LEVEL_MULT (PAGE_SIZE)
87 #define PMD_LEVEL_MULT (PTRS_PER_PTE * PTE_LEVEL_MULT)
88 #define PUD_LEVEL_MULT (PTRS_PER_PMD * PMD_LEVEL_MULT)
89 #define PGD_LEVEL_MULT (PTRS_PER_PUD * PUD_LEVEL_MULT)
97 static const char *
const level_name[] =
98 {
"cr3",
"pgd",
"pud",
"pmd",
"pte" };
148 static unsigned long normalize_addr(
unsigned long u)
151 return (
signed long)(u << 16) >> 16;
166 static const char units[] =
"KMGTPE";
180 st->
marker = address_markers;
182 }
else if (prot != cur || level != st->
level ||
184 const char *
unit = units;
196 while (!(delta & 1023) && unit[1]) {
230 note_page(m, st, prot, 4);
250 note_page(m, st,
__pgprot(prot), 3);
252 walk_pte_level(m, st, *start,
261 #define walk_pmd_level(m,s,a,p) walk_pte_level(m,s,__pmd(pud_val(a)),p)
262 #define pud_large(a) pmd_large(__pmd(pud_val(a)))
263 #define pud_none(a) pmd_none(__pmd(pud_val(a)))
282 note_page(m, st,
__pgprot(prot), 2);
285 P + i * PUD_LEVEL_MULT);
294 #define walk_pud_level(m,s,a,p) walk_pmd_level(m,s,__pud(pgd_val(a)),p)
295 #define pgd_large(a) pud_large(__pud(pgd_val(a)))
296 #define pgd_none(a) pud_none(__pud(pgd_val(a)))
299 static void walk_pgd_level(
struct seq_file *m)
309 memset(&st, 0,
sizeof(st));
317 note_page(m, &st,
__pgprot(prot), 1);
332 static int ptdump_show(
struct seq_file *m,
void *
v)
350 static int pt_dump_init(
void)
358 # ifdef CONFIG_HIGHMEM