Merge tag 'locking-urgent-2020-08-15' of git://git.kernel.org/pub/scm/linux/kernel...
[linux/fpc-iii.git] / arch / um / include / asm / pgalloc.h
blob5393e13e07e0a9108addf8dfa2e05c1343a290e7
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
4 * Copyright 2003 PathScale, Inc.
5 * Derived from include/asm-i386/pgalloc.h and include/asm-i386/pgtable.h
6 */
8 #ifndef __UM_PGALLOC_H
9 #define __UM_PGALLOC_H
11 #include <linux/mm.h>
13 #include <asm-generic/pgalloc.h>
15 #define pmd_populate_kernel(mm, pmd, pte) \
16 set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) __pa(pte)))
18 #define pmd_populate(mm, pmd, pte) \
19 set_pmd(pmd, __pmd(_PAGE_TABLE + \
20 ((unsigned long long)page_to_pfn(pte) << \
21 (unsigned long long) PAGE_SHIFT)))
22 #define pmd_pgtable(pmd) pmd_page(pmd)
25 * Allocate and free page tables.
27 extern pgd_t *pgd_alloc(struct mm_struct *);
29 #define __pte_free_tlb(tlb,pte, address) \
30 do { \
31 pgtable_pte_page_dtor(pte); \
32 tlb_remove_page((tlb),(pte)); \
33 } while (0)
35 #ifdef CONFIG_3_LEVEL_PGTABLES
36 #define __pmd_free_tlb(tlb,x, address) tlb_remove_page((tlb),virt_to_page(x))
37 #endif
39 #endif