xref: /openbsd/sys/dev/pci/drm/include/asm/pgtable.h (revision 9f6b7c50)
1 /* Public domain. */
2 
3 #ifndef _ASM_PGTABLE_H
4 #define _ASM_PGTABLE_H
5 
6 #include <machine/pmap.h>
7 #include <machine/pte.h>
8 #include <linux/types.h>
9 
10 #define pgprot_val(p)		(p)
11 #define pgprot_decrypted(p)	(p)
12 #define PAGE_KERNEL	0
13 #define PAGE_KERNEL_IO	0
14 
15 static inline pgprot_t
pgprot_writecombine(pgprot_t prot)16 pgprot_writecombine(pgprot_t prot)
17 {
18 #if PMAP_WC != 0
19 	return prot | PMAP_WC;
20 #else
21 	return prot | PMAP_NOCACHE;
22 #endif
23 }
24 
25 static inline pgprot_t
pgprot_noncached(pgprot_t prot)26 pgprot_noncached(pgprot_t prot)
27 {
28 #if PMAP_DEVICE != 0
29 	return prot | PMAP_DEVICE;
30 #else
31 	return prot | PMAP_NOCACHE;
32 #endif
33 }
34 
35 #if defined(__i386__) || defined(__amd64__)
36 #define _PAGE_PRESENT	PG_V
37 #define _PAGE_RW	PG_RW
38 #define _PAGE_PAT	PG_PAT
39 #define _PAGE_PWT	PG_WT
40 #define _PAGE_PCD	PG_N
41 #endif
42 
43 #endif
44