hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/openrisc/include/asm/pgalloc.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 #ifndef __ASM_OPENRISC_PGALLOC_H
....@@ -23,6 +19,9 @@
2319 #include <linux/threads.h>
2420 #include <linux/mm.h>
2521 #include <linux/memblock.h>
22
+
23
+#define __HAVE_ARCH_PTE_ALLOC_ONE_KERNEL
24
+#include <asm-generic/pgalloc.h>
2625
2726 extern int mem_init_done;
2827
....@@ -65,47 +64,14 @@
6564 }
6665 #endif
6766
68
-static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
69
-{
70
- free_page((unsigned long)pgd);
71
-}
72
-
73
-extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address);
74
-
75
-static inline struct page *pte_alloc_one(struct mm_struct *mm,
76
- unsigned long address)
77
-{
78
- struct page *pte;
79
- pte = alloc_pages(GFP_KERNEL, 0);
80
- if (!pte)
81
- return NULL;
82
- clear_page(page_address(pte));
83
- if (!pgtable_page_ctor(pte)) {
84
- __free_page(pte);
85
- return NULL;
86
- }
87
- return pte;
88
-}
89
-
90
-static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
91
-{
92
- free_page((unsigned long)pte);
93
-}
94
-
95
-static inline void pte_free(struct mm_struct *mm, struct page *pte)
96
-{
97
- pgtable_page_dtor(pte);
98
- __free_page(pte);
99
-}
67
+extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm);
10068
10169 #define __pte_free_tlb(tlb, pte, addr) \
10270 do { \
103
- pgtable_page_dtor(pte); \
71
+ pgtable_pte_page_dtor(pte); \
10472 tlb_remove_page((tlb), (pte)); \
10573 } while (0)
10674
10775 #define pmd_pgtable(pmd) pmd_page(pmd)
108
-
109
-#define check_pgt_cache() do { } while (0)
11076
11177 #endif