2 * arch/arm/include/asm/pgtable-2level-types.h
4 * Copyright (C) 1995-2003 Russell King
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.
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.
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
19 #ifndef _ASM_PGTABLE_2LEVEL_TYPES_H
20 #define _ASM_PGTABLE_2LEVEL_TYPES_H
22 typedef unsigned long pteval_t;
24 #undef STRICT_MM_TYPECHECKS
26 #ifdef STRICT_MM_TYPECHECKS
28 * These are used to make use of C type-checking..
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;
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)
40 #define __pte(x) ((pte_t) { (x) } )
41 #define __pmd(x) ((pmd_t) { (x) } )
42 #define __pgprot(x) ((pgprot_t) { (x) } )
46 * .. while these make it easier on the compiler
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;
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)
60 #define __pgprot(x) (x)
62 #endif /* STRICT_MM_TYPECHECKS */
64 #endif /* _ASM_PGTABLE_2LEVEL_TYPES_H */