xref: /freebsd/sys/compat/linuxkpi/common/include/asm/pgtable.h (revision fd62b3fa1e82c8de3a1abacd4587fe4142e34d96)
18d59ecb2SHans Petter Selasky /*-
28d59ecb2SHans Petter Selasky  * Copyright (c) 2010 Isilon Systems, Inc.
38d59ecb2SHans Petter Selasky  * Copyright (c) 2010 iX Systems, Inc.
48d59ecb2SHans Petter Selasky  * Copyright (c) 2010 Panasas, Inc.
58d59ecb2SHans Petter Selasky  * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
68d59ecb2SHans Petter Selasky  * All rights reserved.
78d59ecb2SHans Petter Selasky  *
88d59ecb2SHans Petter Selasky  * Redistribution and use in source and binary forms, with or without
98d59ecb2SHans Petter Selasky  * modification, are permitted provided that the following conditions
108d59ecb2SHans Petter Selasky  * are met:
118d59ecb2SHans Petter Selasky  * 1. Redistributions of source code must retain the above copyright
128d59ecb2SHans Petter Selasky  *    notice unmodified, this list of conditions, and the following
138d59ecb2SHans Petter Selasky  *    disclaimer.
148d59ecb2SHans Petter Selasky  * 2. Redistributions in binary form must reproduce the above copyright
158d59ecb2SHans Petter Selasky  *    notice, this list of conditions and the following disclaimer in the
168d59ecb2SHans Petter Selasky  *    documentation and/or other materials provided with the distribution.
178d59ecb2SHans Petter Selasky  *
188d59ecb2SHans Petter Selasky  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
198d59ecb2SHans Petter Selasky  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
208d59ecb2SHans Petter Selasky  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
218d59ecb2SHans Petter Selasky  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
228d59ecb2SHans Petter Selasky  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
238d59ecb2SHans Petter Selasky  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
248d59ecb2SHans Petter Selasky  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
258d59ecb2SHans Petter Selasky  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
268d59ecb2SHans Petter Selasky  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
278d59ecb2SHans Petter Selasky  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
288d59ecb2SHans Petter Selasky  *
298d59ecb2SHans Petter Selasky  * $FreeBSD$
308d59ecb2SHans Petter Selasky  */
31307f78f3SVladimir Kondratyev #ifndef _LINUXKPI_ASM_PGTABLE_H_
32307f78f3SVladimir Kondratyev #define	_LINUXKPI_ASM_PGTABLE_H_
338d59ecb2SHans Petter Selasky 
3483d5d45eSHans Petter Selasky #include <linux/page.h>
358d59ecb2SHans Petter Selasky 
368186b527SHans Petter Selasky typedef unsigned long	pteval_t;
378186b527SHans Petter Selasky typedef unsigned long	pmdval_t;
388186b527SHans Petter Selasky typedef unsigned long	pudval_t;
398186b527SHans Petter Selasky typedef unsigned long	pgdval_t;
408186b527SHans Petter Selasky typedef unsigned long	pgprotval_t;
418186b527SHans Petter Selasky typedef struct page *pgtable_t;
428186b527SHans Petter Selasky 
433d86f8f1SVladimir Kondratyev #define	pgprot_decrypted(prot)	(prot)
443d86f8f1SVladimir Kondratyev 
45*fd62b3faSEmmanuel Vadot #if defined(__i386__) || defined(__amd64__)
46*fd62b3faSEmmanuel Vadot #define	_PAGE_BIT_PRESENT	0
47*fd62b3faSEmmanuel Vadot #define	_PAGE_BIT_RW		1
48*fd62b3faSEmmanuel Vadot #define	_PAGE_BIT_USER		2
49*fd62b3faSEmmanuel Vadot #define	_PAGE_BIT_PWT		3
50*fd62b3faSEmmanuel Vadot #define	_PAGE_BIT_PCD		4
51*fd62b3faSEmmanuel Vadot #define	_PAGE_BIT_PAT		7
52*fd62b3faSEmmanuel Vadot 
53*fd62b3faSEmmanuel Vadot #define	_PAGE_PRESENT	(((pteval_t) 1) << _PAGE_BIT_PRESENT)
54*fd62b3faSEmmanuel Vadot #define	_PAGE_RW	(((pteval_t) 1) << _PAGE_BIT_RW)
55*fd62b3faSEmmanuel Vadot #define	_PAGE_PWT	(((pteval_t) 1) << _PAGE_BIT_PWT)
56*fd62b3faSEmmanuel Vadot #define	_PAGE_PCD	(((pteval_t) 1) << _PAGE_BIT_PCD)
57*fd62b3faSEmmanuel Vadot #define	_PAGE_PAT	(((pteval_t) 1) << _PAGE_BIT_PAT)
58*fd62b3faSEmmanuel Vadot #endif
59*fd62b3faSEmmanuel Vadot 
60307f78f3SVladimir Kondratyev #endif	/* _LINUXKPI_ASM_PGTABLE_H_ */
61