hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/arch/hexagon/include/asm/pgtable.h
....@@ -1,21 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Page table support for the Hexagon architecture
34 *
45 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 and
8
- * only version 2 as published by the Free Software Foundation.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, write to the Free Software
17
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18
- * 02110-1301, USA.
196 */
207
218 #ifndef _ASM_PGTABLE_H
....@@ -25,7 +12,6 @@
2512 * Page table definitions for Qualcomm Hexagon processor.
2613 */
2714 #include <asm/page.h>
28
-#define __ARCH_USE_5LEVEL_HACK
2915 #include <asm-generic/pgtable-nopmd.h>
3016
3117 /* A handy thing to have if one has the RAM. Declared in head.S */
....@@ -171,8 +157,6 @@
171157
172158 /* Seems to be zero even in architectures where the zero page is firewalled? */
173159 #define FIRST_USER_ADDRESS 0UL
174
-#define pte_special(pte) 0
175
-#define pte_mkspecial(pte) (pte)
176160
177161 /* HUGETLB not working currently */
178162 #ifdef CONFIG_HUGETLB_PAGE
....@@ -221,33 +205,6 @@
221205 {
222206 pte_val(*ptep) = _NULL_PTE;
223207 }
224
-
225
-#ifdef NEED_PMD_INDEX_DESPITE_BEING_2_LEVEL
226
-/**
227
- * pmd_index - returns the index of the entry in the PMD page
228
- * which would control the given virtual address
229
- */
230
-#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
231
-
232
-#endif
233
-
234
-/**
235
- * pgd_index - returns the index of the entry in the PGD page
236
- * which would control the given virtual address
237
- *
238
- * This returns the *index* for the address in the pgd_t
239
- */
240
-#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
241
-
242
-/*
243
- * pgd_offset - find an offset in a page-table-directory
244
- */
245
-#define pgd_offset(mm, addr) ((mm)->pgd + pgd_index(addr))
246
-
247
-/*
248
- * pgd_offset_k - get kernel (init_mm) pgd entry pointer for addr
249
- */
250
-#define pgd_offset_k(address) pgd_offset(&init_mm, address)
251208
252209 /**
253210 * pmd_none - check if pmd_entry is mapped
....@@ -419,33 +376,13 @@
419376 */
420377 #define set_pte_at(mm, addr, ptep, pte) set_pte(ptep, pte)
421378
422
-/*
423
- * May need to invoke the virtual machine as well...
424
- */
425
-#define pte_unmap(pte) do { } while (0)
426
-#define pte_unmap_nested(pte) do { } while (0)
427
-
428
-/*
429
- * pte_offset_map - returns the linear address of the page table entry
430
- * corresponding to an address
431
- */
432
-#define pte_offset_map(dir, address) \
433
- ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
434
-
435
-#define pte_offset_map_nested(pmd, addr) pte_offset_map(pmd, addr)
436
-
437
-/* pte_offset_kernel - kernel version of pte_offset */
438
-#define pte_offset_kernel(dir, address) \
439
- ((pte_t *) (unsigned long) __va(pmd_val(*dir) & PAGE_MASK) \
440
- + __pte_offset(address))
379
+static inline unsigned long pmd_page_vaddr(pmd_t pmd)
380
+{
381
+ return (unsigned long)__va(pmd_val(pmd) & PAGE_MASK);
382
+}
441383
442384 /* ZERO_PAGE - returns the globally shared zero page */
443385 #define ZERO_PAGE(vaddr) (virt_to_page(&empty_zero_page))
444
-
445
-#define __pte_offset(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
446
-
447
-/* I think this is in case we have page table caches; needed by init/main.c */
448
-#define pgtable_cache_init() do { } while (0)
449386
450387 /*
451388 * Swap/file PTE definitions. If _PAGE_PRESENT is zero, the rest of the PTE is
....@@ -478,8 +415,5 @@
478415 ((swp_entry_t) { \
479416 ((type << 1) | \
480417 ((offset & 0x7ffff0) << 9) | ((offset & 0xf) << 6)) })
481
-
482
-/* Oh boy. There are a lot of possible arch overrides found in this file. */
483
-#include <asm-generic/pgtable.h>
484418
485419 #endif