ia64/linux-2.6.18-xen.hg

view include/asm-generic/pgtable-nopmd.h @ 782:9ab1c319531f

merge with linux-2.6.18-xen.hg
author Isaku Yamahata <yamahata@valinux.co.jp>
date Wed Jan 28 13:07:23 2009 +0900 (2009-01-28)
parents 831230e53067
children
line source
1 #ifndef _PGTABLE_NOPMD_H
2 #define _PGTABLE_NOPMD_H
4 #ifndef __ASSEMBLY__
6 #include <asm-generic/pgtable-nopud.h>
8 #define __PAGETABLE_PMD_FOLDED
10 /*
11 * Having the pmd type consist of a pud gets the size right, and allows
12 * us to conceptually access the pud entry that this pmd is folded into
13 * without casting.
14 */
15 typedef struct { pud_t pud; } pmd_t;
17 #define PMD_SHIFT PUD_SHIFT
18 #define PTRS_PER_PMD 1
19 #define PMD_SIZE (1UL << PMD_SHIFT)
20 #define PMD_MASK (~(PMD_SIZE-1))
22 /*
23 * The "pud_xxx()" functions here are trivial for a folded two-level
24 * setup: the pmd is never bad, and a pmd always exists (as it's folded
25 * into the pud entry)
26 */
27 static inline int pud_none(pud_t pud) { return 0; }
28 static inline int pud_bad(pud_t pud) { return 0; }
29 static inline int pud_present(pud_t pud) { return 1; }
30 static inline void pud_clear(pud_t *pud) { }
31 #define pmd_ERROR(pmd) (pud_ERROR((pmd).pud))
33 #define pud_populate(mm, pmd, pte) do { } while (0)
35 /*
36 * (pmds are folded into puds so this doesn't get actually called,
37 * but the define is needed for a generic inline function.)
38 */
39 #define set_pud(pudptr, pudval) set_pmd((pmd_t *)(pudptr), (pmd_t) { pudval })
41 static inline pmd_t * pmd_offset(pud_t * pud, unsigned long address)
42 {
43 return (pmd_t *)pud;
44 }
46 #define pmd_val(x) (pud_val((x).pud))
47 #define __pmd(x) ((pmd_t) { __pud(x) } )
49 #define pud_page(pud) (pmd_page((pmd_t){ pud }))
50 #define pud_page_kernel(pud) (pmd_page_kernel((pmd_t){ pud }))
52 /*
53 * allocating and freeing a pmd is trivial: the 1-entry pmd is
54 * inside the pud, so has no extra memory associated with it.
55 */
56 #define pmd_alloc_one(mm, address) NULL
57 #define pmd_free(x) do { } while (0)
58 #define __pmd_free_tlb(tlb, x) do { } while (0)
60 #undef pmd_addr_end
61 #define pmd_addr_end(addr, end) (end)
63 #endif /* __ASSEMBLY__ */
65 #endif /* _PGTABLE_NOPMD_H */