ARM: 7075/1: LPAE: Factor out 2-level page table definitions into separate files
[deliverable/linux.git] / arch / arm / include / asm / pgtable-2level-types.h
1 /*
2 * arch/arm/include/asm/pgtable-2level-types.h
3 *
4 * Copyright (C) 1995-2003 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 #ifndef _ASM_PGTABLE_2LEVEL_TYPES_H
20 #define _ASM_PGTABLE_2LEVEL_TYPES_H
21
22 typedef unsigned long pteval_t;
23
24 #undef STRICT_MM_TYPECHECKS
25
26 #ifdef STRICT_MM_TYPECHECKS
27 /*
28 * These are used to make use of C type-checking..
29 */
30 typedef struct { pteval_t pte; } pte_t;
31 typedef struct { unsigned long pmd; } pmd_t;
32 typedef struct { unsigned long pgd[2]; } pgd_t;
33 typedef struct { unsigned long pgprot; } pgprot_t;
34
35 #define pte_val(x) ((x).pte)
36 #define pmd_val(x) ((x).pmd)
37 #define pgd_val(x) ((x).pgd[0])
38 #define pgprot_val(x) ((x).pgprot)
39
40 #define __pte(x) ((pte_t) { (x) } )
41 #define __pmd(x) ((pmd_t) { (x) } )
42 #define __pgprot(x) ((pgprot_t) { (x) } )
43
44 #else
45 /*
46 * .. while these make it easier on the compiler
47 */
48 typedef pteval_t pte_t;
49 typedef unsigned long pmd_t;
50 typedef unsigned long pgd_t[2];
51 typedef unsigned long pgprot_t;
52
53 #define pte_val(x) (x)
54 #define pmd_val(x) (x)
55 #define pgd_val(x) ((x)[0])
56 #define pgprot_val(x) (x)
57
58 #define __pte(x) (x)
59 #define __pmd(x) (x)
60 #define __pgprot(x) (x)
61
62 #endif /* STRICT_MM_TYPECHECKS */
63
64 #endif /* _ASM_PGTABLE_2LEVEL_TYPES_H */
This page took 0.034463 seconds and 5 git commands to generate.