1 /* SPDX-License-Identifier: GPL-2.0 */ 1 2 #ifndef _PARISC_PAGE_H 3 #define _PARISC_PAGE_H 4 5 #include <linux/const.h> 6 7 #define PAGE_SHIFT CONFIG_PAGE_SHIFT 8 #define PAGE_SIZE (_AC(1,UL) << PAGE_SHI 9 #define PAGE_MASK (~(PAGE_SIZE-1)) 10 11 #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA 12 13 #ifndef __ASSEMBLY__ 14 15 #include <asm/types.h> 16 #include <asm/cache.h> 17 18 #define clear_page(page) clear_page_asm 19 #define copy_page(to, from) copy_page_asm( 20 21 struct page; 22 struct vm_area_struct; 23 24 void clear_page_asm(void *page); 25 void copy_page_asm(void *to, void *from); 26 #define clear_user_page(vto, vaddr, page) clea 27 void copy_user_highpage(struct page *to, struc 28 struct vm_area_struct *vma); 29 #define __HAVE_ARCH_COPY_USER_HIGHPAGE 30 31 /* 32 * These are used to make use of C type-checki 33 */ 34 #define STRICT_MM_TYPECHECKS 35 #ifdef STRICT_MM_TYPECHECKS 36 typedef struct { unsigned long pte; } pte_t; / 37 38 /* NOTE: even on 64 bits, these entries are __ 39 * the pmd and pgd in ZONE_DMA (i.e. under 4GB 40 typedef struct { __u32 pgd; } pgd_t; 41 typedef struct { unsigned long pgprot; } pgpro 42 43 #if CONFIG_PGTABLE_LEVELS == 3 44 typedef struct { __u32 pmd; } pmd_t; 45 #define __pmd(x) ((pmd_t) { (x) } ) 46 /* pXd_val() do not work as lvalues, so make s 47 #define pmd_val(x) ((x).pmd + 0) 48 #endif 49 50 #define pte_val(x) ((x).pte) 51 #define pgd_val(x) ((x).pgd + 0) 52 #define pgprot_val(x) ((x).pgprot) 53 54 #define __pte(x) ((pte_t) { (x) } ) 55 #define __pgd(x) ((pgd_t) { (x) } ) 56 #define __pgprot(x) ((pgprot_t) { (x) } ) 57 58 #else 59 /* 60 * .. while these make it easier on the compil 61 */ 62 typedef unsigned long pte_t; 63 64 #if CONFIG_PGTABLE_LEVELS == 3 65 typedef __u32 pmd_t; 66 #define pmd_val(x) (x) 67 #define __pmd(x) (x) 68 #endif 69 70 typedef __u32 pgd_t; 71 typedef unsigned long pgprot_t; 72 73 #define pte_val(x) (x) 74 #define pgd_val(x) (x) 75 #define pgprot_val(x) (x) 76 77 #define __pte(x) (x) 78 #define __pgd(x) (x) 79 #define __pgprot(x) (x) 80 81 #endif /* STRICT_MM_TYPECHECKS */ 82 83 #define set_pmd(pmdptr, pmdval) (*(pmdptr) = ( 84 #if CONFIG_PGTABLE_LEVELS == 3 85 #define set_pud(pudptr, pudval) (*(pudptr) = ( 86 #endif 87 88 typedef struct page *pgtable_t; 89 90 typedef struct __physmem_range { 91 unsigned long start_pfn; 92 unsigned long pages; /* PAGE_SIZ 93 } physmem_range_t; 94 95 extern physmem_range_t pmem_ranges[]; 96 extern int npmem_ranges; 97 98 #endif /* !__ASSEMBLY__ */ 99 100 /* WARNING: The definitions below must match e 101 * etc 102 */ 103 #ifdef CONFIG_64BIT 104 #define BITS_PER_PTE_ENTRY 3 105 #define BITS_PER_PMD_ENTRY 2 106 #define BITS_PER_PGD_ENTRY 2 107 #else 108 #define BITS_PER_PTE_ENTRY 2 109 #define BITS_PER_PMD_ENTRY 2 110 #define BITS_PER_PGD_ENTRY 2 111 #endif 112 #define PGD_ENTRY_SIZE (1UL << BITS_PER_PGD_E 113 #define PMD_ENTRY_SIZE (1UL << BITS_PER_PMD_E 114 #define PTE_ENTRY_SIZE (1UL << BITS_PER_PTE_E 115 116 #define LINUX_GATEWAY_SPACE 0 117 118 /* This governs the relationship between virtu 119 * If you alter it, make sure to take care of 120 * segments in fixmap.h */ 121 #ifdef CONFIG_64BIT 122 #define __PAGE_OFFSET_DEFAULT (0x40000000) 123 #else 124 #define __PAGE_OFFSET_DEFAULT (0x10000000) 125 #endif 126 127 #if defined(BOOTLOADER) 128 #define __PAGE_OFFSET (0) /* bootloader 129 #else 130 #define __PAGE_OFFSET __PAGE_OFFSET_DEFAULT 131 #endif /* BOOTLOADER */ 132 133 #define PAGE_OFFSET ((unsigned lon 134 135 /* The size of the gateway page (we leave lots 136 #define GATEWAY_PAGE_SIZE 0x4000 137 138 /* The start of the actual kernel binary---use 139 * Leave some space after __PAGE_OFFSET for de 140 * ptr derefs */ 141 #define KERNEL_BINARY_TEXT_START (__PAG 142 143 /* These macros don't work for 64-bit C code - 144 #ifdef __ASSEMBLY__ 145 # define PA(x) ((x)-__PAGE_OFFSET) 146 # define VA(x) ((x)+__PAGE_OFFSET) 147 #endif 148 #define __pa(x) ((unsigned lon 149 #define __va(x) ((void *)((uns 150 151 #ifdef CONFIG_HUGETLB_PAGE 152 #define HPAGE_SHIFT PMD_SHIFT /* f 153 #define HPAGE_SIZE ((1UL) << HPAG 154 #define HPAGE_MASK (~(HPAGE_SIZE 155 #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - 156 157 #if defined(CONFIG_64BIT) && defined(CONFIG_PA 158 # define REAL_HPAGE_SHIFT 20 /* 20 = 1MB 159 # define _HUGE_PAGE_SIZE_ENCODING_DEFAULT _PAG 160 #elif !defined(CONFIG_64BIT) && defined(CONFIG 161 # define REAL_HPAGE_SHIFT 22 /* 22 = 4MB 162 # define _HUGE_PAGE_SIZE_ENCODING_DEFAULT _PAG 163 #else 164 # define REAL_HPAGE_SHIFT 24 /* 24 = 16M 165 # define _HUGE_PAGE_SIZE_ENCODING_DEFAULT _PAG 166 #endif 167 #endif /* CONFIG_HUGETLB_PAGE */ 168 169 #define virt_addr_valid(kaddr) pfn_valid(__pa 170 171 #define page_to_phys(page) (page_to_pfn(p 172 #define virt_to_page(kaddr) pfn_to_page(__ 173 174 #include <asm-generic/memory_model.h> 175 #include <asm-generic/getorder.h> 176 #include <asm/pdc.h> 177 178 #define PAGE0 ((struct zeropage *)absolute_p 179 180 /* DEFINITION OF THE ZERO-PAGE (PAG0) */ 181 /* based on work by Jason Eckhardt (jason@equa 182 183 #endif /* _PARISC_PAGE_H */ 184
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.