root/include/asm-alpha/page.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 #ifndef _ALPHA_PAGE_H
   2 #define _ALPHA_PAGE_H
   3 
   4 /* PAGE_SHIFT determines the page size */
   5 #define PAGE_SHIFT      13
   6 #define PAGE_SIZE       (1UL << PAGE_SHIFT)
   7 #define PAGE_MASK       (~(PAGE_SIZE-1))
   8 
   9 #ifdef __KERNEL__
  10 
  11 #define CONFIG_STRICT_MM_TYPECHECKS
  12 
  13 #ifdef CONFIG_STRICT_MM_TYPECHECKS
  14 /*
  15  * These are used to make use of C type-checking..
  16  */
  17 typedef struct { unsigned long pte; } pte_t;
  18 typedef struct { unsigned long pmd; } pmd_t;
  19 typedef struct { unsigned long pgd; } pgd_t;
  20 typedef struct { unsigned long pgprot; } pgprot_t;
  21 
  22 #define pte_val(x)      ((x).pte)
  23 #define pmd_val(x)      ((x).pmd)
  24 #define pgd_val(x)      ((x).pgd)
  25 #define pgprot_val(x)   ((x).pgprot)
  26 
  27 #define __pte(x)        ((pte_t) { (x) } )
  28 #define __pgd(x)        ((pgd_t) { (x) } )
  29 #define __pgprot(x)     ((pgprot_t) { (x) } )
  30 
  31 #else
  32 /*
  33  * .. while these make it easier on the compiler
  34  */
  35 typedef unsigned long pte_t;
  36 typedef unsigned long pmd_t;
  37 typedef unsigned long pgd_t;
  38 typedef unsigned long pgprot_t;
  39 
  40 #define pte_val(x)      (x)
  41 #define pmd_val(x)      (x)
  42 #define pgd_val(x)      (x)
  43 #define pgprot_val(x)   (x)
  44 
  45 #define __pte(x)        (x)
  46 #define __pgd(x)        (x)
  47 #define __pgprot(x)     (x)
  48 
  49 #endif
  50 
  51 #define invalidate_all() \
  52 __asm__ __volatile__( \
  53         "lda $16,-2($31)\n\t" \
  54         ".long 51" \
  55         : : :"$1", "$16", "$17", "$22","$23","$24","$25")
  56 
  57 #define invalidate() \
  58 __asm__ __volatile__( \
  59         "lda $16,-1($31)\n\t" \
  60         ".long 51" \
  61         : : :"$1", "$16", "$17", "$22","$23","$24","$25")
  62 
  63 /* Certain architectures need to do special things when pte's
  64  * within a page table are directly modified.  Thus, the following
  65  * hook is made available.
  66  */
  67 #define set_pte(pteptr, pteval) ((*(pteptr)) = (pteval))
  68 
  69 /* to align the pointer to the (next) page boundary */
  70 #define PAGE_ALIGN(addr)                (((addr)+PAGE_SIZE-1)&PAGE_MASK)
  71 
  72 #define PAGE_OFFSET             0xFFFFFC0000000000
  73 #define MAP_NR(addr)            ((((unsigned long) (addr)) - PAGE_OFFSET) >> PAGE_SHIFT)
  74 
  75 typedef struct {
  76         unsigned count:24,
  77                  age:6,
  78                  dirty:1,
  79                  reserved:1;
  80 } mem_map_t;
  81 
  82 
  83 #endif /* __KERNEL__ */
  84 
  85 #endif /* _ALPHA_PAGE_H */

/* [previous][next][first][last][top][bottom][index][help] */