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

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

Version: ~ [ linux-5.18-rc6 ] ~ [ linux-5.17.6 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.38 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.114 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.192 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.241 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.277 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.312 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.302 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
  3  *
  4  * This program is free software; you can redistribute it and/or modify
  5  * it under the terms of the GNU General Public License version 2 as
  6  * published by the Free Software Foundation.
  7  */
  8 #ifndef __ASM_ARC_PAGE_H
  9 #define __ASM_ARC_PAGE_H
 10 
 11 #include <uapi/asm/page.h>
 12 
 13 #ifndef __ASSEMBLY__
 14 
 15 #define clear_page(paddr)               memset((paddr), 0, PAGE_SIZE)
 16 #define copy_page(to, from)             memcpy((to), (from), PAGE_SIZE)
 17 
 18 struct vm_area_struct;
 19 struct page;
 20 
 21 #define __HAVE_ARCH_COPY_USER_HIGHPAGE
 22 
 23 void copy_user_highpage(struct page *to, struct page *from,
 24                         unsigned long u_vaddr, struct vm_area_struct *vma);
 25 void clear_user_page(void *to, unsigned long u_vaddr, struct page *page);
 26 
 27 #undef STRICT_MM_TYPECHECKS
 28 
 29 #ifdef STRICT_MM_TYPECHECKS
 30 /*
 31  * These are used to make use of C type-checking..
 32  */
 33 typedef struct {
 34 #ifdef CONFIG_ARC_HAS_PAE40
 35         unsigned long long pte;
 36 #else
 37         unsigned long pte;
 38 #endif
 39 } pte_t;
 40 typedef struct {
 41         unsigned long pgd;
 42 } pgd_t;
 43 typedef struct {
 44         unsigned long pgprot;
 45 } pgprot_t;
 46 
 47 #define pte_val(x)      ((x).pte)
 48 #define pgd_val(x)      ((x).pgd)
 49 #define pgprot_val(x)   ((x).pgprot)
 50 
 51 #define __pte(x)        ((pte_t) { (x) })
 52 #define __pgd(x)        ((pgd_t) { (x) })
 53 #define __pgprot(x)     ((pgprot_t) { (x) })
 54 
 55 #define pte_pgprot(x) __pgprot(pte_val(x))
 56 
 57 #else /* !STRICT_MM_TYPECHECKS */
 58 
 59 #ifdef CONFIG_ARC_HAS_PAE40
 60 typedef unsigned long long pte_t;
 61 #else
 62 typedef unsigned long pte_t;
 63 #endif
 64 typedef unsigned long pgd_t;
 65 typedef unsigned long pgprot_t;
 66 
 67 #define pte_val(x)      (x)
 68 #define pgd_val(x)      (x)
 69 #define pgprot_val(x)   (x)
 70 #define __pte(x)        (x)
 71 #define __pgd(x)        (x)
 72 #define __pgprot(x)     (x)
 73 #define pte_pgprot(x)   (x)
 74 
 75 #endif
 76 
 77 typedef pte_t * pgtable_t;
 78 
 79 /*
 80  * Use virt_to_pfn with caution:
 81  * If used in pte or paddr related macros, it could cause truncation
 82  * in PAE40 builds
 83  * As a rule of thumb, only use it in helpers starting with virt_
 84  * You have been warned !
 85  */
 86 #define virt_to_pfn(kaddr)      (__pa(kaddr) >> PAGE_SHIFT)
 87 
 88 #define ARCH_PFN_OFFSET         virt_to_pfn(CONFIG_LINUX_RAM_BASE)
 89 
 90 #ifdef CONFIG_FLATMEM
 91 #define pfn_valid(pfn)          (((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
 92 #endif
 93 
 94 /*
 95  * __pa, __va, virt_to_page (ALERT: deprecated, don't use them)
 96  *
 97  * These macros have historically been misnamed
 98  * virt here means link-address/program-address as embedded in object code.
 99  * And for ARC, link-addr = physical address
100  */
101 #define __pa(vaddr)  ((unsigned long)(vaddr))
102 #define __va(paddr)  ((void *)((unsigned long)(paddr)))
103 
104 #define virt_to_page(kaddr)     pfn_to_page(virt_to_pfn(kaddr))
105 #define virt_addr_valid(kaddr)  pfn_valid(virt_to_pfn(kaddr))
106 
107 /* Default Permissions for stack/heaps pages (Non Executable) */
108 #define VM_DATA_DEFAULT_FLAGS   (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
109 
110 #define WANT_PAGE_VIRTUAL   1
111 
112 #include <asm-generic/memory_model.h>   /* page_to_pfn, pfn_to_page */
113 #include <asm-generic/getorder.h>
114 
115 #endif /* !__ASSEMBLY__ */
116 
117 #endif
118 

~ [ 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