hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/openrisc/include/asm/pgtable.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * OpenRISC Linux
34 *
....@@ -9,11 +10,6 @@
910 * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
1011 * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
1112 * et al.
12
- *
13
- * This program is free software; you can redistribute it and/or modify
14
- * it under the terms of the GNU General Public License as published by
15
- * the Free Software Foundation; either version 2 of the License, or
16
- * (at your option) any later version.
1713 */
1814
1915 /* or32 pgtable.h - macros and functions to manipulate page tables
....@@ -25,7 +21,6 @@
2521 #ifndef __ASM_OPENRISC_PGTABLE_H
2622 #define __ASM_OPENRISC_PGTABLE_H
2723
28
-#define __ARCH_USE_5LEVEL_HACK
2924 #include <asm-generic/pgtable-nopmd.h>
3025
3126 #ifndef __ASSEMBLY__
....@@ -101,7 +96,7 @@
10196 /* Define some higher level generic page attributes.
10297 *
10398 * If you change _PAGE_CI definition be sure to change it in
104
- * io.h for ioremap_nocache() too.
99
+ * io.h for ioremap() too.
105100 */
106101
107102 /*
....@@ -240,8 +235,6 @@
240235 static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC; }
241236 static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
242237 static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
243
-static inline int pte_special(pte_t pte) { return 0; }
244
-static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
245238
246239 static inline pte_t pte_wrprotect(pte_t pte)
247240 {
....@@ -370,38 +363,15 @@
370363 }
371364
372365 #define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
373
-#define pmd_page_kernel(pmd) ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
374366
375
-/* to find an entry in a page-table-directory. */
376
-#define pgd_index(address) ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
377
-
378
-#define __pgd_offset(address) pgd_index(address)
379
-
380
-#define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address))
381
-
382
-/* to find an entry in a kernel page-table-directory */
383
-#define pgd_offset_k(address) pgd_offset(&init_mm, address)
367
+static inline unsigned long pmd_page_vaddr(pmd_t pmd)
368
+{
369
+ return ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK));
370
+}
384371
385372 #define __pmd_offset(address) \
386373 (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
387374
388
-/*
389
- * the pte page can be thought of an array like this: pte_t[PTRS_PER_PTE]
390
- *
391
- * this macro returns the index of the entry in the pte page which would
392
- * control the given virtual address
393
- */
394
-#define __pte_offset(address) \
395
- (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
396
-#define pte_offset_kernel(dir, address) \
397
- ((pte_t *) pmd_page_kernel(*(dir)) + __pte_offset(address))
398
-#define pte_offset_map(dir, address) \
399
- ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
400
-#define pte_offset_map_nested(dir, address) \
401
- pte_offset_map(dir, address)
402
-
403
-#define pte_unmap(pte) do { } while (0)
404
-#define pte_unmap_nested(pte) do { } while (0)
405375 #define pte_pfn(x) ((unsigned long)(((x).pte)) >> PAGE_SHIFT)
406376 #define pfn_pte(pfn, prot) __pte((((pfn) << PAGE_SHIFT)) | pgprot_val(prot))
407377
....@@ -444,13 +414,6 @@
444414 #define __swp_entry_to_pte(x) ((pte_t) { (x).val })
445415
446416 #define kern_addr_valid(addr) (1)
447
-
448
-#include <asm-generic/pgtable.h>
449
-
450
-/*
451
- * No page table caches to initialise
452
- */
453
-#define pgtable_cache_init() do { } while (0)
454417
455418 typedef pte_t *pte_addr_t;
456419