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 #define invalidate_all() \
   5 __asm__ __volatile__( \
   6         "lda $16,-2($31)\n\t" \
   7         ".long 51" \
   8         : : :"$1", "$16", "$17", "$22","$23","$24","$25")
   9 
  10 #define invalidate() \
  11 __asm__ __volatile__( \
  12         "lda $16,-1($31)\n\t" \
  13         ".long 51" \
  14         : : :"$1", "$16", "$17", "$22","$23","$24","$25")
  15 
  16                         /* PAGE_SHIFT determines the page size */
  17 #define PAGE_SHIFT                      13
  18 #define PGDIR_SHIFT                     23
  19 #define PAGE_SIZE                       (1UL << PAGE_SHIFT)
  20 #define PGDIR_SIZE                      (1UL << PGDIR_SHIFT)
  21 
  22 #ifdef __KERNEL__
  23 
  24                         /* number of bits that fit into a memory pointer */
  25 #define BITS_PER_PTR                    (8*sizeof(unsigned long))
  26                         /* to mask away the intra-page address bits */
  27 #define PAGE_MASK                       (~(PAGE_SIZE-1))
  28                         /* to mask away the intra-page address bits */
  29 #define PGDIR_MASK                      (~(PGDIR_SIZE-1))
  30                         /* to align the pointer to the (next) page boundary */
  31 #define PAGE_ALIGN(addr)                (((addr)+PAGE_SIZE-1)&PAGE_MASK)
  32                         /* to align the pointer to a pointer address */
  33 #define PTR_MASK                        (~(sizeof(void*)-1))
  34 
  35                                         /* sizeof(void*)==1<<SIZEOF_PTR_LOG2 */
  36                                         /* 64-bit machines, beware!  SRB. */
  37 #define SIZEOF_PTR_LOG2                 4
  38 
  39 /* to find an entry in a page-table-directory */
  40 /*
  41  * XXXXX This isn't right: we shouldn't use the ptbr, but the L2 pointer.
  42  * This is just for getting it through the compiler right now
  43  */
  44 #define PAGE_DIR_OFFSET(tsk,address) \
  45 ((unsigned long *) ((tsk)->tss.ptbr + ((((unsigned long)(address)) >> 21) & PTR_MASK & ~PAGE_MASK)))
  46 
  47 /* to find an entry in a page-table */
  48 #define PAGE_PTR(address)               \
  49   ((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK)
  50 
  51 /* the no. of pointers that fit on a page */
  52 #define PTRS_PER_PAGE                   (PAGE_SIZE/sizeof(void*))
  53 
  54 /* to set the page-dir */
  55 /*
  56  * XXXXX This isn't right: we shouldn't use the ptbr, but the L2 pointer.
  57  * This is just for getting it through the compiler right now
  58  */
  59 #define SET_PAGE_DIR(tsk,pgdir) \
  60 do { \
  61         (tsk)->tss.ptbr = (unsigned long) (pgdir); \
  62         if ((tsk) == current) \
  63                 invalidate(); \
  64 } while (0)
  65 
  66 #endif /* __KERNEL__ */
  67 
  68 #endif /* _ALPHA_PAGE_H */

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