root/include/asm-i386/page.h

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

INCLUDED FROM


   1 #ifndef _I386_PAGE_H
   2 #define _I386_PAGE_H
   3 
   4 #define invalidate() \
   5 __asm__ __volatile__("movl %%cr3,%%eax\n\tmovl %%eax,%%cr3": : :"ax")
   6 
   7                         /* PAGE_SHIFT determines the page size */
   8 #define PAGE_SHIFT                      12
   9 #define PGDIR_SHIFT                     22
  10 #define PAGE_SIZE                       (1UL << PAGE_SHIFT)
  11 #define PGDIR_SIZE                      (1UL << PGDIR_SHIFT)
  12 
  13 #ifdef __KERNEL__
  14 
  15                         /* number of bits that fit into a memory pointer */
  16 #define BITS_PER_PTR                    (8*sizeof(unsigned long))
  17                         /* to mask away the intra-page address bits */
  18 #define PAGE_MASK                       (~(PAGE_SIZE-1))
  19                         /* to mask away the intra-page address bits */
  20 #define PGDIR_MASK                      (~(PGDIR_SIZE-1))
  21                         /* to align the pointer to the (next) page boundary */
  22 #define PAGE_ALIGN(addr)                (((addr)+PAGE_SIZE-1)&PAGE_MASK)
  23                         /* to align the pointer to a pointer address */
  24 #define PTR_MASK                        (~(sizeof(void*)-1))
  25 
  26                                         /* sizeof(void*)==1<<SIZEOF_PTR_LOG2 */
  27                                         /* 64-bit machines, beware!  SRB. */
  28 #define SIZEOF_PTR_LOG2                 2
  29 
  30                         /* to find an entry in a page-table-directory */
  31 #define PAGE_DIR_OFFSET(base,address)   ((unsigned long*)((base)+\
  32   ((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)*2&PTR_MASK&~PAGE_MASK)))
  33                         /* to find an entry in a page-table */
  34 #define PAGE_PTR(address)               \
  35   ((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK)
  36                         /* the no. of pointers that fit on a page */
  37 #define PTRS_PER_PAGE                   (PAGE_SIZE/sizeof(void*))
  38 
  39 #endif /* __KERNEL__ */
  40 
  41 #endif /* _I386_PAGE_H */

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