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

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

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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 /* SPDX-License-Identifier: GPL-2.0 */
  2 
  3 #ifndef __ASM_CSKY_PAGE_H
  4 #define __ASM_CSKY_PAGE_H
  5 
  6 #include <asm/setup.h>
  7 #include <asm/cache.h>
  8 #include <linux/const.h>
  9 
 10 /*
 11  * PAGE_SHIFT determines the page size: 4KB
 12  */
 13 #define PAGE_SHIFT      CONFIG_PAGE_SHIFT
 14 #define PAGE_SIZE       (_AC(1, UL) << PAGE_SHIFT)
 15 #define PAGE_MASK       (~(PAGE_SIZE - 1))
 16 #define THREAD_SIZE     (PAGE_SIZE * 2)
 17 #define THREAD_MASK     (~(THREAD_SIZE - 1))
 18 #define THREAD_SHIFT    (PAGE_SHIFT + 1)
 19 
 20 
 21 /*
 22  * For C-SKY "User-space:Kernel-space" is "2GB:2GB" fixed by hardware and there
 23  * are two segment registers (MSA0 + MSA1) to mapping 512MB + 512MB physical
 24  * address region. We use them mapping kernel 1GB direct-map address area and
 25  * for more than 1GB of memory we use highmem.
 26  */
 27 #define PAGE_OFFSET     CONFIG_PAGE_OFFSET
 28 #define SSEG_SIZE       0x20000000
 29 #define LOWMEM_LIMIT    (SSEG_SIZE * 2)
 30 
 31 #define PHYS_OFFSET_OFFSET (CONFIG_DRAM_BASE & (SSEG_SIZE - 1))
 32 
 33 #ifndef __ASSEMBLY__
 34 
 35 #include <linux/pfn.h>
 36 
 37 #define virt_addr_valid(kaddr)  ((void *)(kaddr) >= (void *)PAGE_OFFSET && \
 38                         (void *)(kaddr) < high_memory)
 39 
 40 extern void *memset(void *dest, int c, size_t l);
 41 extern void *memcpy(void *to, const void *from, size_t l);
 42 
 43 #define clear_page(page)        memset((page), 0, PAGE_SIZE)
 44 #define copy_page(to, from)     memcpy((to), (from), PAGE_SIZE)
 45 
 46 #define page_to_phys(page)      (page_to_pfn(page) << PAGE_SHIFT)
 47 #define phys_to_page(paddr)     (pfn_to_page(PFN_DOWN(paddr)))
 48 
 49 struct page;
 50 
 51 #include <abi/page.h>
 52 
 53 struct vm_area_struct;
 54 
 55 typedef struct { unsigned long pte_low; } pte_t;
 56 #define pte_val(x)      ((x).pte_low)
 57 
 58 typedef struct { unsigned long pgd; } pgd_t;
 59 typedef struct { unsigned long pgprot; } pgprot_t;
 60 typedef struct page *pgtable_t;
 61 
 62 #define pgd_val(x)      ((x).pgd)
 63 #define pgprot_val(x)   ((x).pgprot)
 64 
 65 #define ptep_buddy(x)   ((pte_t *)((unsigned long)(x) ^ sizeof(pte_t)))
 66 
 67 #define __pte(x)        ((pte_t) { (x) })
 68 #define __pgd(x)        ((pgd_t) { (x) })
 69 #define __pgprot(x)     ((pgprot_t) { (x) })
 70 
 71 extern unsigned long va_pa_offset;
 72 
 73 #define ARCH_PFN_OFFSET PFN_DOWN(va_pa_offset + PHYS_OFFSET_OFFSET)
 74 
 75 #define __pa(x)          ((unsigned long)(x) - PAGE_OFFSET + va_pa_offset)
 76 #define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - va_pa_offset))
 77 
 78 #define __pa_symbol(x)  __pa(RELOC_HIDE((unsigned long)(x), 0))
 79 
 80 static inline unsigned long virt_to_pfn(const void *kaddr)
 81 {
 82         return __pa(kaddr) >> PAGE_SHIFT;
 83 }
 84 
 85 #define MAP_NR(x)       PFN_DOWN((unsigned long)(x) - PAGE_OFFSET - \
 86                                  PHYS_OFFSET_OFFSET)
 87 #define virt_to_page(x) (mem_map + MAP_NR(x))
 88 
 89 #define pfn_to_kaddr(x) __va(PFN_PHYS(x))
 90 
 91 #include <asm-generic/memory_model.h>
 92 #include <asm-generic/getorder.h>
 93 
 94 #endif /* !__ASSEMBLY__ */
 95 #endif /* __ASM_CSKY_PAGE_H */
 96 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php