mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-09 02:51:11 +01:00
The replacement of <asm/pgrable.h> with <linux/pgtable.h> made the include
of the latter in the middle of asm includes. Fix this up with the aid of
the below script and manual adjustments here and there.
import sys
import re
if len(sys.argv) is not 3:
print "USAGE: %s <file> <header>" % (sys.argv[0])
sys.exit(1)
hdr_to_move="#include <linux/%s>" % sys.argv[2]
moved = False
in_hdrs = False
with open(sys.argv[1], "r") as f:
lines = f.readlines()
for _line in lines:
line = _line.rstrip('
')
if line == hdr_to_move:
continue
if line.startswith("#include <linux/"):
in_hdrs = True
elif not moved and in_hdrs:
moved = True
print hdr_to_move
print line
Signed-off-by: Mike Rapoport <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Brian Cain <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Chris Zankel <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Greentime Hu <[email protected]>
Cc: Greg Ungerer <[email protected]>
Cc: Guan Xuetao <[email protected]>
Cc: Guo Ren <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Ley Foon Tan <[email protected]>
Cc: Mark Salter <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Matt Turner <[email protected]>
Cc: Max Filippov <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Nick Hu <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Richard Weinberger <[email protected]>
Cc: Rich Felker <[email protected]>
Cc: Russell King <[email protected]>
Cc: Stafford Horne <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Vincent Chen <[email protected]>
Cc: Vineet Gupta <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Yoshinori Sato <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
79 lines
1.8 KiB
C
79 lines
1.8 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _SPARC_PGALLOC_H
|
|
#define _SPARC_PGALLOC_H
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/sched.h>
|
|
#include <linux/pgtable.h>
|
|
|
|
#include <asm/pgtsrmmu.h>
|
|
#include <asm/vaddrs.h>
|
|
#include <asm/page.h>
|
|
|
|
struct page;
|
|
|
|
void *srmmu_get_nocache(int size, int align);
|
|
void srmmu_free_nocache(void *addr, int size);
|
|
|
|
extern struct resource sparc_iomap;
|
|
|
|
pgd_t *get_pgd_fast(void);
|
|
static inline void free_pgd_fast(pgd_t *pgd)
|
|
{
|
|
srmmu_free_nocache(pgd, SRMMU_PGD_TABLE_SIZE);
|
|
}
|
|
|
|
#define pgd_free(mm, pgd) free_pgd_fast(pgd)
|
|
#define pgd_alloc(mm) get_pgd_fast()
|
|
|
|
static inline void pud_set(pud_t * pudp, pmd_t * pmdp)
|
|
{
|
|
unsigned long pa = __nocache_pa(pmdp);
|
|
|
|
set_pte((pte_t *)pudp, __pte((SRMMU_ET_PTD | (pa >> 4))));
|
|
}
|
|
|
|
#define pud_populate(MM, PGD, PMD) pud_set(PGD, PMD)
|
|
|
|
static inline pmd_t *pmd_alloc_one(struct mm_struct *mm,
|
|
unsigned long address)
|
|
{
|
|
return srmmu_get_nocache(SRMMU_PMD_TABLE_SIZE,
|
|
SRMMU_PMD_TABLE_SIZE);
|
|
}
|
|
|
|
static inline void free_pmd_fast(pmd_t * pmd)
|
|
{
|
|
srmmu_free_nocache(pmd, SRMMU_PMD_TABLE_SIZE);
|
|
}
|
|
|
|
#define pmd_free(mm, pmd) free_pmd_fast(pmd)
|
|
#define __pmd_free_tlb(tlb, pmd, addr) pmd_free((tlb)->mm, pmd)
|
|
|
|
#define pmd_populate(mm, pmd, pte) pmd_set(pmd, pte)
|
|
#define pmd_pgtable(pmd) (pgtable_t)__pmd_page(pmd)
|
|
|
|
void pmd_set(pmd_t *pmdp, pte_t *ptep);
|
|
#define pmd_populate_kernel pmd_populate
|
|
|
|
pgtable_t pte_alloc_one(struct mm_struct *mm);
|
|
|
|
static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
|
|
{
|
|
return srmmu_get_nocache(SRMMU_PTE_TABLE_SIZE,
|
|
SRMMU_PTE_TABLE_SIZE);
|
|
}
|
|
|
|
|
|
static inline void free_pte_fast(pte_t *pte)
|
|
{
|
|
srmmu_free_nocache(pte, SRMMU_PTE_TABLE_SIZE);
|
|
}
|
|
|
|
#define pte_free_kernel(mm, pte) free_pte_fast(pte)
|
|
|
|
void pte_free(struct mm_struct * mm, pgtable_t pte);
|
|
#define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, pte)
|
|
|
|
#endif /* _SPARC_PGALLOC_H */
|