git: 794a55592a53 - stable/13 - linuxkpi: pgtable: Add more defines

From: Emmanuel Vadot <manu_at_FreeBSD.org>
Date: Wed, 07 Sep 2022 15:10:27 UTC
The branch stable/13 has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=794a55592a53d6b412303a74aa20b582a2536328

commit 794a55592a53d6b412303a74aa20b582a2536328
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2022-08-09 09:36:44 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2022-09-07 15:09:05 +0000

    linuxkpi: pgtable: Add more defines
    
    Needed by drm-kmod
    
    Reviewed by:    bz
    Obtained from:  drm-kmod
    Sponsored by:   Beckhoff Automation GmbH & Co. KG
    Differential Revision:  https://reviews.freebsd.org/D36101
    
    (cherry picked from commit fd62b3fa1e82c8de3a1abacd4587fe4142e34d96)
---
 sys/compat/linuxkpi/common/include/asm/pgtable.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/asm/pgtable.h b/sys/compat/linuxkpi/common/include/asm/pgtable.h
index 9e66fab8eae4..93e1bbef9a12 100644
--- a/sys/compat/linuxkpi/common/include/asm/pgtable.h
+++ b/sys/compat/linuxkpi/common/include/asm/pgtable.h
@@ -42,4 +42,19 @@ typedef struct page *pgtable_t;
 
 #define	pgprot_decrypted(prot)	(prot)
 
+#if defined(__i386__) || defined(__amd64__)
+#define	_PAGE_BIT_PRESENT	0
+#define	_PAGE_BIT_RW		1
+#define	_PAGE_BIT_USER		2
+#define	_PAGE_BIT_PWT		3
+#define	_PAGE_BIT_PCD		4
+#define	_PAGE_BIT_PAT		7
+
+#define	_PAGE_PRESENT	(((pteval_t) 1) << _PAGE_BIT_PRESENT)
+#define	_PAGE_RW	(((pteval_t) 1) << _PAGE_BIT_RW)
+#define	_PAGE_PWT	(((pteval_t) 1) << _PAGE_BIT_PWT)
+#define	_PAGE_PCD	(((pteval_t) 1) << _PAGE_BIT_PCD)
+#define	_PAGE_PAT	(((pteval_t) 1) << _PAGE_BIT_PAT)
+#endif
+
 #endif	/* _LINUXKPI_ASM_PGTABLE_H_ */