2 * Copyright (C) 2012 ARM Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #ifndef __ASM_PGTABLE_2LEVEL_TYPES_H
17 #define __ASM_PGTABLE_2LEVEL_TYPES_H
19 #include <asm/types.h>
23 typedef pgdval_t pmdval_t;
25 #undef STRICT_MM_TYPECHECKS
27 #ifdef STRICT_MM_TYPECHECKS
30 * These are used to make use of C type-checking..
32 typedef struct { pteval_t pte; } pte_t;
33 typedef struct { pgdval_t pgd; } pgd_t;
34 typedef struct { pteval_t pgprot; } pgprot_t;
36 #define pte_val(x) ((x).pte)
37 #define pgd_val(x) ((x).pgd)
38 #define pgprot_val(x) ((x).pgprot)
40 #define __pte(x) ((pte_t) { (x) } )
41 #define __pgd(x) ((pgd_t) { (x) } )
42 #define __pgprot(x) ((pgprot_t) { (x) } )
44 #else /* !STRICT_MM_TYPECHECKS */
46 typedef pteval_t pte_t;
47 typedef pgdval_t pgd_t;
48 typedef pteval_t pgprot_t;
50 #define pte_val(x) (x)
51 #define pgd_val(x) (x)
52 #define pgprot_val(x) (x)
56 #define __pgprot(x) (x)
58 #endif /* STRICT_MM_TYPECHECKS */
60 #include <asm-generic/pgtable-nopmd.h>
62 #endif /* __ASM_PGTABLE_2LEVEL_TYPES_H */