aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/mmiotrace/mmio-mod.c
diff options
context:
space:
mode:
authorPekka Paalanen <pq@iki.fi>2008-05-12 15:20:56 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-24 05:21:32 -0400
commit75bb88350e0501b3cf5ac096a1008757844414a9 (patch)
tree13b836138e77455fa0f188a01c0a10b641ddc266 /arch/x86/kernel/mmiotrace/mmio-mod.c
parent8b7d89d02ef3c6a7c73d6596f28cea7632850af4 (diff)
x86 mmiotrace: use lookup_address()
Use lookup_address() from pageattr.c instead of doing the same manually. Also had to EXPORT_SYMBOL_GPL(lookup_address) to make this work for modules. This also fixes "undefined symbol 'init_mm'" compile error for x86_32. Signed-off-by: Pekka Paalanen <pq@iki.fi> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/mmiotrace/mmio-mod.c')
-rw-r--r--arch/x86/kernel/mmiotrace/mmio-mod.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/arch/x86/kernel/mmiotrace/mmio-mod.c b/arch/x86/kernel/mmiotrace/mmio-mod.c
index 73561fe85f03..e43947d218a5 100644
--- a/arch/x86/kernel/mmiotrace/mmio-mod.c
+++ b/arch/x86/kernel/mmiotrace/mmio-mod.c
@@ -120,19 +120,24 @@ static int write_marker(struct file *file, const char __user *buffer,
120 120
121static void print_pte(unsigned long address) 121static void print_pte(unsigned long address)
122{ 122{
123 pgd_t *pgd = pgd_offset_k(address); 123 int level;
124 pud_t *pud = pud_offset(pgd, address); 124 pte_t *pte = lookup_address(address, &level);
125 pmd_t *pmd = pmd_offset(pud, address); 125
126 if (pmd_large(*pmd)) { 126 if (!pte) {
127 printk(KERN_ERR "Error in %s: no pte for page 0x%08lx\n",
128 __FUNCTION__, address);
129 return;
130 }
131
132 if (level == PG_LEVEL_2M) {
127 printk(KERN_EMERG MODULE_NAME ": 4MB pages are not " 133 printk(KERN_EMERG MODULE_NAME ": 4MB pages are not "
128 "currently supported: %lx\n", 134 "currently supported: %lx\n",
129 address); 135 address);
130 BUG(); 136 BUG();
131 } 137 }
132 printk(KERN_DEBUG MODULE_NAME ": pte for 0x%lx: 0x%lx 0x%lx\n", 138 printk(KERN_DEBUG MODULE_NAME ": pte for 0x%lx: 0x%lx 0x%lx\n",
133 address, 139 address, pte_val(*pte),
134 pte_val(*pte_offset_kernel(pmd, address)), 140 pte_val(*pte) & _PAGE_PRESENT);
135 pte_val(*pte_offset_kernel(pmd, address)) & _PAGE_PRESENT);
136} 141}
137 142
138/* 143/*