aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-avr32/pgalloc.h
diff options
context:
space:
mode:
authorHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-01-14 16:15:05 -0500
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-07-02 05:01:28 -0400
commitcfd23e93a0289cf6711fd3877c5226658d87240a (patch)
tree1030f0ee5ccd59d1d80b2b5fdc892987f90fac8e /include/asm-avr32/pgalloc.h
parentebe74597a55fef00edc80a414ef5c6477d035e0a (diff)
avr32: Store virtual addresses in the PGD
Instead of storing physical addresses along with page flags in the PGD, store virtual addresses and use NULL to indicate a not present second-level page table. A non-page-aligned page table indicates a bad PMD. This simplifies the TLB miss handler since it no longer has to check the Present bit and no longer has to convert the PGD entry from physical to virtual address. Instead, it has to check for a NULL entry, which is slightly cheaper than either. Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Diffstat (limited to 'include/asm-avr32/pgalloc.h')
-rw-r--r--include/asm-avr32/pgalloc.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/include/asm-avr32/pgalloc.h b/include/asm-avr32/pgalloc.h
index 51fc1f6e4b17..5b768fc2388e 100644
--- a/include/asm-avr32/pgalloc.h
+++ b/include/asm-avr32/pgalloc.h
@@ -8,25 +8,27 @@
8#ifndef __ASM_AVR32_PGALLOC_H 8#ifndef __ASM_AVR32_PGALLOC_H
9#define __ASM_AVR32_PGALLOC_H 9#define __ASM_AVR32_PGALLOC_H
10 10
11#include <asm/processor.h>
12#include <linux/threads.h>
13#include <linux/slab.h>
14#include <linux/mm.h> 11#include <linux/mm.h>
12#include <linux/sched.h>
13#include <linux/slab.h>
15 14
16#define pmd_populate_kernel(mm, pmd, pte) \ 15static inline void pmd_populate_kernel(struct mm_struct *mm,
17 set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte))) 16 pmd_t *pmd, pte_t *pte)
17{
18 set_pmd(pmd, __pmd((unsigned long)pte));
19}
18 20
19static __inline__ void pmd_populate(struct mm_struct *mm, pmd_t *pmd, 21static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
20 pgtable_t pte) 22 pgtable_t pte)
21{ 23{
22 set_pmd(pmd, __pmd(_PAGE_TABLE + page_to_phys(pte))); 24 set_pmd(pmd, __pmd((unsigned long)page_address(pte)));
23} 25}
24#define pmd_pgtable(pmd) pmd_page(pmd) 26#define pmd_pgtable(pmd) pmd_page(pmd)
25 27
26/* 28/*
27 * Allocate and free page tables 29 * Allocate and free page tables
28 */ 30 */
29static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm) 31static inline pgd_t *pgd_alloc(struct mm_struct *mm)
30{ 32{
31 return kcalloc(USER_PTRS_PER_PGD, sizeof(pgd_t), GFP_KERNEL); 33 return kcalloc(USER_PTRS_PER_PGD, sizeof(pgd_t), GFP_KERNEL);
32} 34}