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 #define PAGE_DIR_OFFSET(base,address)   ((unsigned long*)((base)+\
  41   ((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)*2&PTR_MASK&~PAGE_MASK)))
  42                         /* to find an entry in a page-table */
  43 #define PAGE_PTR(address)               \
  44   ((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK)
  45                         /* the no. of pointers that fit on a page */
  46 #define PTRS_PER_PAGE                   (PAGE_SIZE/sizeof(void*))
  47 
  48 #endif /* __KERNEL__ */
  49 
  50 #endif /* _ALPHA_PAGE_H */

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