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_NOPUD_H
  2 #define _PGTABLE_NOPUD_H
  3 
  4 #ifndef __ASSEMBLY__
  5 
  6 /*
  7  * Having the pud type consist of a pgd gets the size right, and allows
  8  * us to conceptually access the pgd entry that this pud is folded into
  9  * without casting.
 10  */
 11 typedef struct { pgd_t pgd; } pud_t;
 12 
 13 #define PUD_SHIFT       PGDIR_SHIFT
 14 #define PTRS_PER_PUD    1
 15 #define PUD_SIZE        (1UL << PUD_SHIFT)
 16 #define PUD_MASK        (~(PUD_SIZE-1))
 17 
 18 /*
 19  * The "pgd_xxx()" functions here are trivial for a folded two-level
 20  * setup: the pud is never bad, and a pud always exists (as it's folded
 21  * into the pgd entry)
 22  */
 23 static inline int pgd_none(pgd_t pgd)           { return 0; }
 24 static inline int pgd_bad(pgd_t pgd)            { return 0; }
 25 static inline int pgd_present(pgd_t pgd)        { return 1; }
 26 static inline void pgd_clear(pgd_t *pgd)        { }
 27 #define pud_ERROR(pud)                          (pgd_ERROR((pud).pgd))
 28 
 29 #define pgd_populate(mm, pgd, pud)              do { } while (0)
 30 /*
 31  * (puds are folded into pgds so this doesn't get actually called,
 32  * but the define is needed for a generic inline function.)
 33  */
 34 #define set_pgd(pgdptr, pgdval)                 set_pud((pud_t *)(pgdptr), (pud_t) { pgdval })
 35 
 36 static inline pud_t * pud_offset(pgd_t * pgd, unsigned long address)
 37 {
 38         return (pud_t *)pgd;
 39 }
 40 
 41 #define pud_val(x)                              (pgd_val((x).pgd))
 42 #define __pud(x)                                ((pud_t) { __pgd(x) } )
 43 
 44 #define pgd_page(pgd)                           (pud_page((pud_t){ pgd }))
 45 #define pgd_page_kernel(pgd)                    (pud_page_kernel((pud_t){ pgd }))
 46 
 47 /*
 48  * allocating and freeing a pud is trivial: the 1-entry pud is
 49  * inside the pgd, so has no extra memory associated with it.
 50  */
 51 #define pud_alloc_one(mm, address)              NULL
 52 #define pud_free(x)                             do { } while (0)
 53 #define __pud_free_tlb(tlb, x)                  do { } while (0)
 54 
 55 #endif /* __ASSEMBLY__ */
 56 #endif /* _PGTABLE_NOPUD_H */
 57 
  This page was automatically generated by the LXR engine.