hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/hexagon/include/asm/pgalloc.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_PGALLOC_H
....@@ -24,7 +11,7 @@
2411 #include <asm/mem-layout.h>
2512 #include <asm/atomic.h>
2613
27
-#define check_pgt_cache() do {} while (0)
14
+#include <asm-generic/pgalloc.h>
2815
2916 extern unsigned long long kmap_generation;
3017
....@@ -52,45 +39,6 @@
5239 mm->context.ptbase = __pa(pgd);
5340
5441 return pgd;
55
-}
56
-
57
-static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
58
-{
59
- free_page((unsigned long) pgd);
60
-}
61
-
62
-static inline struct page *pte_alloc_one(struct mm_struct *mm,
63
- unsigned long address)
64
-{
65
- struct page *pte;
66
-
67
- pte = alloc_page(GFP_KERNEL | __GFP_ZERO);
68
- if (!pte)
69
- return NULL;
70
- if (!pgtable_page_ctor(pte)) {
71
- __free_page(pte);
72
- return NULL;
73
- }
74
- return pte;
75
-}
76
-
77
-/* _kernel variant gets to use a different allocator */
78
-static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
79
- unsigned long address)
80
-{
81
- gfp_t flags = GFP_KERNEL | __GFP_ZERO;
82
- return (pte_t *) __get_free_page(flags);
83
-}
84
-
85
-static inline void pte_free(struct mm_struct *mm, struct page *pte)
86
-{
87
- pgtable_page_dtor(pte);
88
- __free_page(pte);
89
-}
90
-
91
-static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
92
-{
93
- free_page((unsigned long)pte);
9442 }
9543
9644 static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
....@@ -141,7 +89,7 @@
14189
14290 #define __pte_free_tlb(tlb, pte, addr) \
14391 do { \
144
- pgtable_page_dtor((pte)); \
92
+ pgtable_pte_page_dtor((pte)); \
14593 tlb_remove_page((tlb), (pte)); \
14694 } while (0)
14795