Skip to content

Commit d42ab9a

Browse files
MaxKellermannchenhuacai
authored andcommitted
LoongArch: Move {dmw,tlb}_virt_to_page() definition to page.h
These two functions are implemented in pgtable.c, and they are needed only by the virt_to_page() macro in page.h. Having the prototypes in pgtable.h causes a circular dependency between page.h and pgtable.h, because the virt_to_page() macro in page.h needs pgtable.h for these two functions, while pgtable.h needs various definitions from page.h (e.g. pte_t and pgt_t). Let's avoid this circular dependency by moving the function prototypes to page.h. Signed-off-by: Max Kellermann <max.kellermann@ionos.com> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent c87e12e commit d42ab9a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

arch/loongarch/include/asm/page.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ typedef struct { unsigned long pgprot; } pgprot_t;
8383
#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
8484
#define sym_to_pfn(x) __phys_to_pfn(__pa_symbol(x))
8585

86+
struct page *dmw_virt_to_page(unsigned long kaddr);
87+
struct page *tlb_virt_to_page(unsigned long kaddr);
88+
8689
#define virt_to_pfn(kaddr) PFN_DOWN(PHYSADDR(kaddr))
8790

8891
#define virt_to_page(kaddr) \

arch/loongarch/include/asm/pgtable.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,6 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *pt
363363
extern pgd_t swapper_pg_dir[];
364364
extern pgd_t invalid_pg_dir[];
365365

366-
struct page *dmw_virt_to_page(unsigned long kaddr);
367-
struct page *tlb_virt_to_page(unsigned long kaddr);
368-
369366
/*
370367
* The following only work if pte_present() is true.
371368
* Undefined behaviour if not..

0 commit comments

Comments
 (0)