Linux kernel & device driver programming

Cross-Referenced Linux and Device Driver Code

[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ]
Version: [ 2.6.11.8 ] [ 2.6.25 ] [ 2.6.25.8 ] [ 2.6.31.13 ] Architecture: [ i386 ]
  1 #ifndef _PGTABLE_NOPMD_H
  2 #define _PGTABLE_NOPMD_H
  3 
  4 #ifndef __ASSEMBLY__
  5 
  6 #include <asm-generic/pgtable-nopud.h>
  7 
  8 /*
  9  * Having the pmd type consist of a pud gets the size right, and allows
 10  * us to conceptually access the pud entry that this pmd is folded into
 11  * without casting.
 12  */
 13 typedef struct { pud_t pud; } pmd_t;
 14 
 15 #define PMD_SHIFT       PUD_SHIFT
 16 #define PTRS_PER_PMD    1
 17 #define PMD_SIZE        (1UL << PMD_SHIFT)
 18 #define PMD_MASK        (~(PMD_SIZE-1))
 19 
 20 /*
 21  * The "pud_xxx()" functions here are trivial for a folded two-level
 22  * setup: the pmd is never bad, and a pmd always exists (as it's folded
 23  * into the pud entry)
 24  */
 25 static inline int pud_none(pud_t pud)           { return 0; }
 26 static inline int pud_bad(pud_t pud)            { return 0; }
 27 static inline int pud_present(pud_t pud)        { return 1; }
 28 static inline void pud_clear(pud_t *pud)        { }
 29 #define pmd_ERROR(pmd)                          (pud_ERROR((pmd).pud))
 30 
 31 #define pud_populate(mm, pmd, pte)              do { } while (0)
 32 
 33 /*
 34  * (pmds are folded into puds so this doesn't get actually called,
 35  * but the define is needed for a generic inline function.)
 36  */
 37 #define set_pud(pudptr, pudval)                 set_pmd((pmd_t *)(pudptr), (pmd_t) { pudval })
 38 
 39 static inline pmd_t * pmd_offset(pud_t * pud, unsigned long address)
 40 {
 41         return (pmd_t *)pud;
 42 }
 43 
 44 #define pmd_val(x)                              (pud_val((x).pud))
 45 #define __pmd(x)                                ((pmd_t) { __pud(x) } )
 46 
 47 #define pud_page(pud)                           (pmd_page((pmd_t){ pud }))
 48 #define pud_page_kernel(pud)                    (pmd_page_kernel((pmd_t){ pud }))
 49 
 50 /*
 51  * allocating and freeing a pmd is trivial: the 1-entry pmd is
 52  * inside the pud, so has no extra memory associated with it.
 53  */
 54 #define pmd_alloc_one(mm, address)              NULL
 55 #define pmd_free(x)                             do { } while (0)
 56 #define __pmd_free_tlb(tlb, x)                  do { } while (0)
 57 
 58 #endif /* __ASSEMBLY__ */
 59 
 60 #endif /* _PGTABLE_NOPMD_H */
 61 
  This page was automatically generated by the LXR engine.