The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/include/asm-alpha/page.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 #ifndef _ALPHA_PAGE_H
    2 #define _ALPHA_PAGE_H
    3 
    4 #include <asm/pal.h>
    5 
    6 /* PAGE_SHIFT determines the page size */
    7 #define PAGE_SHIFT      13
    8 #define PAGE_SIZE       (1UL << PAGE_SHIFT)
    9 #define PAGE_MASK       (~(PAGE_SIZE-1))
   10 
   11 #ifdef __KERNEL__
   12 
   13 #ifndef __ASSEMBLY__
   14 
   15 #define STRICT_MM_TYPECHECKS
   16 
   17 extern void clear_page(void *page);
   18 #define clear_user_page(page, vaddr)    clear_page(page)
   19 
   20 extern void copy_page(void * _to, void * _from);
   21 #define copy_user_page(to, from, vaddr) copy_page(to, from)
   22 
   23 #ifdef STRICT_MM_TYPECHECKS
   24 /*
   25  * These are used to make use of C type-checking..
   26  */
   27 typedef struct { unsigned long pte; } pte_t;
   28 typedef struct { unsigned long pmd; } pmd_t;
   29 typedef struct { unsigned long pgd; } pgd_t;
   30 typedef struct { unsigned long pgprot; } pgprot_t;
   31 
   32 #define pte_val(x)      ((x).pte)
   33 #define pmd_val(x)      ((x).pmd)
   34 #define pgd_val(x)      ((x).pgd)
   35 #define pgprot_val(x)   ((x).pgprot)
   36 
   37 #define __pte(x)        ((pte_t) { (x) } )
   38 #define __pmd(x)        ((pmd_t) { (x) } )
   39 #define __pgd(x)        ((pgd_t) { (x) } )
   40 #define __pgprot(x)     ((pgprot_t) { (x) } )
   41 
   42 #else
   43 /*
   44  * .. while these make it easier on the compiler
   45  */
   46 typedef unsigned long pte_t;
   47 typedef unsigned long pmd_t;
   48 typedef unsigned long pgd_t;
   49 typedef unsigned long pgprot_t;
   50 
   51 #define pte_val(x)      (x)
   52 #define pmd_val(x)      (x)
   53 #define pgd_val(x)      (x)
   54 #define pgprot_val(x)   (x)
   55 
   56 #define __pte(x)        (x)
   57 #define __pgd(x)        (x)
   58 #define __pgprot(x)     (x)
   59 
   60 #endif /* STRICT_MM_TYPECHECKS */
   61 
   62 #define BUG()                                                                   \
   63 do {                                                                            \
   64         printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__);                   \
   65         __asm__ __volatile__("call_pal %0  # bugchk" : : "i" (PAL_bugchk));     \
   66 } while (0)
   67 #define PAGE_BUG(page)  BUG()
   68 
   69 /* Pure 2^n version of get_order */
   70 extern __inline__ int get_order(unsigned long size)
   71 {
   72         int order;
   73 
   74         size = (size-1) >> (PAGE_SHIFT-1);
   75         order = -1;
   76         do {
   77                 size >>= 1;
   78                 order++;
   79         } while (size);
   80         return order;
   81 }
   82 
   83 #endif /* !__ASSEMBLY__ */
   84 
   85 /* to align the pointer to the (next) page boundary */
   86 #define PAGE_ALIGN(addr)        (((addr)+PAGE_SIZE-1)&PAGE_MASK)
   87 
   88 #ifdef USE_48_BIT_KSEG
   89 #define PAGE_OFFSET             0xffff800000000000
   90 #else
   91 #define PAGE_OFFSET             0xfffffc0000000000
   92 #endif
   93 
   94 #define __pa(x)                 ((unsigned long) (x) - PAGE_OFFSET)
   95 #define __va(x)                 ((void *)((unsigned long) (x) + PAGE_OFFSET))
   96 #ifndef CONFIG_DISCONTIGMEM
   97 #define virt_to_page(kaddr)     (mem_map + (__pa(kaddr) >> PAGE_SHIFT))
   98 #define VALID_PAGE(page)        (((page) - mem_map) < max_mapnr)
   99 #endif /* CONFIG_DISCONTIGMEM */
  100 
  101 #define VM_DATA_DEFAULT_FLAGS           (VM_READ | VM_WRITE | VM_EXEC | \
  102                                          VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
  103 
  104 #endif /* __KERNEL__ */
  105 
  106 #endif /* _ALPHA_PAGE_H */

Cache object: 53e0729c44a09c1e946bb7ad6f1c399b


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.