hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/arch/xtensa/include/asm/pgtable.h
....@@ -1,9 +1,6 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * include/asm-xtensa/pgtable.h
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.
74 *
85 * Copyright (C) 2001 - 2013 Tensilica Inc.
96 */
....@@ -11,7 +8,6 @@
118 #ifndef _XTENSA_PGTABLE_H
129 #define _XTENSA_PGTABLE_H
1310
14
-#define __ARCH_USE_5LEVEL_HACK
1511 #include <asm/page.h>
1612 #include <asm/kmem_layout.h>
1713 #include <asm-generic/pgtable-nopmd.h>
....@@ -73,7 +69,7 @@
7369 */
7470 #define VMALLOC_START (XCHAL_KSEG_CACHED_VADDR - 0x10000000)
7571 #define VMALLOC_END (VMALLOC_START + 0x07FEFFFF)
76
-#define TLBTEMP_BASE_1 (VMALLOC_END + 1)
72
+#define TLBTEMP_BASE_1 (VMALLOC_START + 0x08000000)
7773 #define TLBTEMP_BASE_2 (TLBTEMP_BASE_1 + DCACHE_WAY_SIZE)
7874 #if 2 * DCACHE_WAY_SIZE > ICACHE_WAY_SIZE
7975 #define TLBTEMP_SIZE (2 * DCACHE_WAY_SIZE)
....@@ -241,7 +237,6 @@
241237 # define swapper_pg_dir NULL
242238 static inline void paging_init(void) { }
243239 #endif
244
-static inline void pgtable_cache_init(void) { }
245240
246241 /*
247242 * The pmd contains the kernel virtual address of the pte page.
....@@ -271,9 +266,8 @@
271266 static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITABLE; }
272267 static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
273268 static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
274
-static inline int pte_special(pte_t pte) { return 0; }
275269
276
-static inline pte_t pte_wrprotect(pte_t pte)
270
+static inline pte_t pte_wrprotect(pte_t pte)
277271 { pte_val(pte) &= ~(_PAGE_WRITABLE | _PAGE_HW_WRITE); return pte; }
278272 static inline pte_t pte_mkclean(pte_t pte)
279273 { pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HW_WRITE); return pte; }
....@@ -285,8 +279,6 @@
285279 { pte_val(pte) |= _PAGE_ACCESSED; return pte; }
286280 static inline pte_t pte_mkwrite(pte_t pte)
287281 { pte_val(pte) |= _PAGE_WRITABLE; return pte; }
288
-static inline pte_t pte_mkspecial(pte_t pte)
289
- { return pte; }
290282
291283 #define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) & ~_PAGE_CA_MASK))
292284
....@@ -367,25 +359,6 @@
367359 update_pte(ptep, pte_wrprotect(pte));
368360 }
369361
370
-/* to find an entry in a kernel page-table-directory */
371
-#define pgd_offset_k(address) pgd_offset(&init_mm, address)
372
-
373
-/* to find an entry in a page-table-directory */
374
-#define pgd_offset(mm,address) ((mm)->pgd + pgd_index(address))
375
-
376
-#define pgd_index(address) ((address) >> PGDIR_SHIFT)
377
-
378
-/* Find an entry in the second-level page table.. */
379
-#define pmd_offset(dir,address) ((pmd_t*)(dir))
380
-
381
-/* Find an entry in the third-level page table.. */
382
-#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
383
-#define pte_offset_kernel(dir,addr) \
384
- ((pte_t*) pmd_page_vaddr(*(dir)) + pte_index(addr))
385
-#define pte_offset_map(dir,addr) pte_offset_kernel((dir),(addr))
386
-#define pte_unmap(pte) do { } while (0)
387
-
388
-
389362 /*
390363 * Encode and decode a swap and file entry.
391364 */
....@@ -448,7 +421,5 @@
448421 * SHM area cache aliasing for userland.
449422 */
450423 #define HAVE_ARCH_UNMAPPED_AREA
451
-
452
-#include <asm-generic/pgtable.h>
453424
454425 #endif /* _XTENSA_PGTABLE_H */