~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/score/include/asm/page.h

Version: ~ [ linux-5.9 ] ~ [ linux-5.8.14 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.70 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.150 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.200 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.238 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.238 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef _ASM_SCORE_PAGE_H
  2 #define _ASM_SCORE_PAGE_H
  3 
  4 #include <linux/pfn.h>
  5 #include <linux/const.h>
  6 
  7 /* PAGE_SHIFT determines the page size */
  8 #define PAGE_SHIFT      (12)
  9 #define PAGE_SIZE       (_AC(1,UL) << PAGE_SHIFT)
 10 #define PAGE_MASK       (~(PAGE_SIZE-1))
 11 
 12 #ifdef __KERNEL__
 13 
 14 #ifndef __ASSEMBLY__
 15 
 16 #define PAGE_UP(addr)   (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1)))
 17 #define PAGE_DOWN(addr) ((addr)&(~((PAGE_SIZE)-1)))
 18 
 19 /* align addr on a size boundary - adjust address up/down if needed */
 20 #define _ALIGN_UP(addr, size)   (((addr)+((size)-1))&(~((size)-1)))
 21 #define _ALIGN_DOWN(addr, size) ((addr)&(~((size)-1)))
 22 
 23 /* align addr on a size boundary - adjust address up if needed */
 24 #define _ALIGN(addr, size)      _ALIGN_UP(addr, size)
 25 
 26 /*
 27  * PAGE_OFFSET -- the first address of the first page of memory. When not
 28  * using MMU this corresponds to the first free page in physical memory (aligned
 29  * on a page boundary).
 30  */
 31 #define PAGE_OFFSET             (0xA0000000UL)
 32 
 33 #define clear_page(pgaddr)                      memset((pgaddr), 0, PAGE_SIZE)
 34 #define copy_page(to, from)                     memcpy((to), (from), PAGE_SIZE)
 35 
 36 #define clear_user_page(pgaddr, vaddr, page)    memset((pgaddr), 0, PAGE_SIZE)
 37 #define copy_user_page(vto, vfrom, vaddr, topg) \
 38                         memcpy((vto), (vfrom), PAGE_SIZE)
 39 
 40 /*
 41  * These are used to make use of C type-checking..
 42  */
 43 
 44 typedef struct { unsigned long pte; } pte_t;            /* page table entry */
 45 typedef struct { unsigned long pgd; } pgd_t;            /* PGD table entry */
 46 typedef struct { unsigned long pgprot; } pgprot_t;
 47 typedef struct page *pgtable_t;
 48 
 49 #define pte_val(x)      ((x).pte)
 50 #define pgd_val(x)      ((x).pgd)
 51 #define pgprot_val(x)   ((x).pgprot)
 52 
 53 #define __pte(x)        ((pte_t) { (x) })
 54 #define __pgd(x)        ((pgd_t) { (x) })
 55 #define __pgprot(x)     ((pgprot_t) { (x) })
 56 
 57 extern unsigned long max_low_pfn;
 58 extern unsigned long min_low_pfn;
 59 extern unsigned long max_pfn;
 60 
 61 #define __pa(x)         ((unsigned long)(x) - PAGE_OFFSET)
 62 #define __va(x)         ((void *)((unsigned long) (x) + PAGE_OFFSET))
 63 
 64 #define phys_to_pfn(phys)       (PFN_DOWN(phys))
 65 #define pfn_to_phys(pfn)        (PFN_PHYS(pfn))
 66 
 67 #define virt_to_pfn(vaddr)      (phys_to_pfn((__pa(vaddr))))
 68 #define pfn_to_virt(pfn)        __va(pfn_to_phys((pfn)))
 69 
 70 #define virt_to_page(vaddr)     (pfn_to_page(virt_to_pfn(vaddr)))
 71 #define page_to_virt(page)      (pfn_to_virt(page_to_pfn(page)))
 72 
 73 #define page_to_phys(page)      (pfn_to_phys(page_to_pfn(page)))
 74 #define page_to_bus(page)       (page_to_phys(page))
 75 #define phys_to_page(paddr)     (pfn_to_page(phys_to_pfn(paddr)))
 76 
 77 #define pfn_valid(pfn)          (((pfn) >= min_low_pfn) && ((pfn) < max_low_pfn))
 78 
 79 #define ARCH_PFN_OFFSET         (PAGE_OFFSET >> PAGE_SHIFT)
 80 
 81 #endif /* __ASSEMBLY__ */
 82 
 83 #define virt_addr_valid(vaddr)  (pfn_valid(virt_to_pfn(vaddr)))
 84 
 85 #endif /* __KERNEL__ */
 86 
 87 #define VM_DATA_DEFAULT_FLAGS   (VM_READ | VM_WRITE | VM_EXEC | \
 88                                  VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
 89 
 90 #include <asm-generic/memory_model.h>
 91 #include <asm-generic/getorder.h>
 92 
 93 #endif /* _ASM_SCORE_PAGE_H */
 94 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp