Skip to content

Commit 0cebbb6

Browse files
djbwIngo Molnar
authored andcommitted
generic/pgtable: Introduce {p4d,pgd}_same()
In preparation for introducing '_safe' versions of page table entry 'set' helpers, introduce generic versions of p4d_same() and pgd_same(). Signed-off-by: Dan Williams <dan.j.williams@intel.com> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rik van Riel <riel@surriel.com> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/154395943153.32119.1733586547359626311.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent c683c37 commit 0cebbb6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

include/asm-generic/pgtable.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,20 @@ static inline int pud_same(pud_t pud_a, pud_t pud_b)
386386
}
387387
#endif
388388

389+
#ifndef __HAVE_ARCH_P4D_SAME
390+
static inline int p4d_same(p4d_t p4d_a, p4d_t p4d_b)
391+
{
392+
return p4d_val(p4d_a) == p4d_val(p4d_b);
393+
}
394+
#endif
395+
396+
#ifndef __HAVE_ARCH_PGD_SAME
397+
static inline int pgd_same(pgd_t pgd_a, pgd_t pgd_b)
398+
{
399+
return pgd_val(pgd_a) == pgd_val(pgd_b);
400+
}
401+
#endif
402+
389403
#ifndef __HAVE_ARCH_DO_SWAP_PAGE
390404
/*
391405
* Some architectures support metadata associated with a page. When a

0 commit comments

Comments
 (0)