root/include/asm-mips/page.h

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

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. page_colour

   1 #ifndef __ASM_MIPS_PAGE_H
   2 #define __ASM_MIPS_PAGE_H
   3 
   4 /* PAGE_SHIFT determines the page size */
   5 #define PAGE_SHIFT      12
   6 #define PAGE_SIZE       (1UL << PAGE_SHIFT)
   7 #define PAGE_MASK       (~(PAGE_SIZE-1))
   8 
   9 #ifdef __KERNEL__
  10 
  11 #define STRICT_MM_TYPECHECKS
  12 
  13 #ifndef __LANGUAGE_ASSEMBLY__
  14 
  15 #ifdef STRICT_MM_TYPECHECKS
  16 /*
  17  * These are used to make use of C type-checking..
  18  */
  19 typedef struct { unsigned long pte; } pte_t;
  20 typedef struct { unsigned long pmd; } pmd_t;
  21 typedef struct { unsigned long pgd; } pgd_t;
  22 typedef struct { unsigned long pgprot; } pgprot_t;
  23 
  24 #define pte_val(x)      ((x).pte)
  25 #define pmd_val(x)      ((x).pmd)
  26 #define pgd_val(x)      ((x).pgd)
  27 #define pgprot_val(x)   ((x).pgprot)
  28 
  29 #define __pte(x)        ((pte_t) { (x) } )
  30 #define __pme(x)        ((pme_t) { (x) } )
  31 #define __pgd(x)        ((pgd_t) { (x) } )
  32 #define __pgprot(x)     ((pgprot_t) { (x) } )
  33 
  34 #else /* !defined (STRICT_MM_TYPECHECKS) */
  35 /*
  36  * .. while these make it easier on the compiler
  37  */
  38 typedef unsigned long pte_t;
  39 typedef unsigned long pmd_t;
  40 typedef unsigned long pgd_t;
  41 typedef unsigned long pgprot_t;
  42 
  43 #define pte_val(x)      (x)
  44 #define pmd_val(x)      (x)
  45 #define pgd_val(x)      (x)
  46 #define pgprot_val(x)   (x)
  47 
  48 #define __pte(x)        (x)
  49 #define __pmd(x)        (x)
  50 #define __pgd(x)        (x)
  51 #define __pgprot(x)     (x)
  52 
  53 #endif /* !defined (STRICT_MM_TYPECHECKS) */
  54 
  55 /*
  56  * We need a special version of copy_page that can handle virtual caches.
  57  * While we're at tweaking with caches we can use that to make it even
  58  * faster.  The R10000 accelerated caching mode will further accelerate it.
  59  */
  60 extern void __copy_page(unsigned long from, unsigned long to);
  61 #define copy_page(from,to) __copy_page((unsigned long)from, (unsigned long)to)
  62 
  63 #endif /* __LANGUAGE_ASSEMBLY__ */
  64 
  65 /* to align the pointer to the (next) page boundary */
  66 #define PAGE_ALIGN(addr)        (((addr)+PAGE_SIZE-1)&PAGE_MASK)
  67 
  68 /* This handles the memory map */
  69 #if __mips == 3
  70 /*
  71  * We handle pages at XKPHYS + 0x1800000000000000 (cachable, noncoherent)
  72  * Pagetables are at  XKPHYS + 0x1000000000000000 (uncached)
  73  */
  74 #define PAGE_OFFSET     0x9800000000000000UL
  75 #define PT_OFFSET       0x9000000000000000UL
  76 #define MAP_MASK        0x07ffffffffffffffUL
  77 #else
  78 /*
  79  * We handle pages at KSEG0 (cachable, noncoherent)
  80  * Pagetables are at  KSEG1 (uncached)
  81  */
  82 #define PAGE_OFFSET     0x80000000
  83 #define PT_OFFSET       0xa0000000
  84 #define MAP_MASK        0x1fffffff
  85 #endif
  86 
  87 #define MAP_NR(addr)    ((((unsigned long)(addr)) & MAP_MASK) >> PAGE_SHIFT)
  88 
  89 #ifndef __LANGUAGE_ASSEMBLY__
  90 
  91 extern unsigned long page_colour_mask;
  92 
  93 extern inline unsigned long
  94 page_colour(unsigned long page)
     /* [previous][next][first][last][top][bottom][index][help] */
  95 {
  96         return page & page_colour_mask;
  97 }
  98 
  99 #endif /* defined (__LANGUAGE_ASSEMBLY__) */
 100 #endif /* defined (__KERNEL__) */
 101 
 102 #endif /* __ASM_MIPS_PAGE_H */

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