diff options
-rw-r--r-- | arch/arm64/include/asm/page.h | 8 | ||||
-rw-r--r-- | arch/arm64/include/asm/pgtable-2level-types.h | 62 | ||||
-rw-r--r-- | arch/arm64/include/asm/pgtable-3level-types.h | 68 | ||||
-rw-r--r-- | arch/arm64/include/asm/pgtable-types.h (renamed from arch/arm64/include/asm/pgtable-4level-types.h) | 72 |
4 files changed, 49 insertions, 161 deletions
diff --git a/arch/arm64/include/asm/page.h b/arch/arm64/include/asm/page.h index a998ff478777..2502754d1921 100644 --- a/arch/arm64/include/asm/page.h +++ b/arch/arm64/include/asm/page.h | |||
@@ -47,13 +47,7 @@ | |||
47 | 47 | ||
48 | #ifndef __ASSEMBLY__ | 48 | #ifndef __ASSEMBLY__ |
49 | 49 | ||
50 | #if CONFIG_ARM64_PGTABLE_LEVELS == 2 | 50 | #include <asm/pgtable-types.h> |
51 | #include <asm/pgtable-2level-types.h> | ||
52 | #elif CONFIG_ARM64_PGTABLE_LEVELS == 3 | ||
53 | #include <asm/pgtable-3level-types.h> | ||
54 | #else | ||
55 | #include <asm/pgtable-4level-types.h> | ||
56 | #endif | ||
57 | 51 | ||
58 | extern void __cpu_clear_user_page(void *p, unsigned long user); | 52 | extern void __cpu_clear_user_page(void *p, unsigned long user); |
59 | extern void __cpu_copy_user_page(void *to, const void *from, | 53 | extern void __cpu_copy_user_page(void *to, const void *from, |
diff --git a/arch/arm64/include/asm/pgtable-2level-types.h b/arch/arm64/include/asm/pgtable-2level-types.h deleted file mode 100644 index 5f101e63dfc1..000000000000 --- a/arch/arm64/include/asm/pgtable-2level-types.h +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 ARM Ltd. | ||
3 | * | ||
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. | ||
7 | * | ||
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. | ||
12 | * | ||
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/>. | ||
15 | */ | ||
16 | #ifndef __ASM_PGTABLE_2LEVEL_TYPES_H | ||
17 | #define __ASM_PGTABLE_2LEVEL_TYPES_H | ||
18 | |||
19 | #include <asm/types.h> | ||
20 | |||
21 | typedef u64 pteval_t; | ||
22 | typedef u64 pgdval_t; | ||
23 | typedef pgdval_t pmdval_t; | ||
24 | |||
25 | #undef STRICT_MM_TYPECHECKS | ||
26 | |||
27 | #ifdef STRICT_MM_TYPECHECKS | ||
28 | |||
29 | /* | ||
30 | * These are used to make use of C type-checking.. | ||
31 | */ | ||
32 | typedef struct { pteval_t pte; } pte_t; | ||
33 | typedef struct { pgdval_t pgd; } pgd_t; | ||
34 | typedef struct { pteval_t pgprot; } pgprot_t; | ||
35 | |||
36 | #define pte_val(x) ((x).pte) | ||
37 | #define pgd_val(x) ((x).pgd) | ||
38 | #define pgprot_val(x) ((x).pgprot) | ||
39 | |||
40 | #define __pte(x) ((pte_t) { (x) } ) | ||
41 | #define __pgd(x) ((pgd_t) { (x) } ) | ||
42 | #define __pgprot(x) ((pgprot_t) { (x) } ) | ||
43 | |||
44 | #else /* !STRICT_MM_TYPECHECKS */ | ||
45 | |||
46 | typedef pteval_t pte_t; | ||
47 | typedef pgdval_t pgd_t; | ||
48 | typedef pteval_t pgprot_t; | ||
49 | |||
50 | #define pte_val(x) (x) | ||
51 | #define pgd_val(x) (x) | ||
52 | #define pgprot_val(x) (x) | ||
53 | |||
54 | #define __pte(x) (x) | ||
55 | #define __pgd(x) (x) | ||
56 | #define __pgprot(x) (x) | ||
57 | |||
58 | #endif /* STRICT_MM_TYPECHECKS */ | ||
59 | |||
60 | #include <asm-generic/pgtable-nopmd.h> | ||
61 | |||
62 | #endif /* __ASM_PGTABLE_2LEVEL_TYPES_H */ | ||
diff --git a/arch/arm64/include/asm/pgtable-3level-types.h b/arch/arm64/include/asm/pgtable-3level-types.h deleted file mode 100644 index 4e94424938a4..000000000000 --- a/arch/arm64/include/asm/pgtable-3level-types.h +++ /dev/null | |||
@@ -1,68 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 ARM Ltd. | ||
3 | * | ||
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. | ||
7 | * | ||
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. | ||
12 | * | ||
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/>. | ||
15 | */ | ||
16 | #ifndef __ASM_PGTABLE_3LEVEL_TYPES_H | ||
17 | #define __ASM_PGTABLE_3LEVEL_TYPES_H | ||
18 | |||
19 | #include <asm/types.h> | ||
20 | |||
21 | typedef u64 pteval_t; | ||
22 | typedef u64 pmdval_t; | ||
23 | typedef u64 pgdval_t; | ||
24 | |||
25 | #undef STRICT_MM_TYPECHECKS | ||
26 | |||
27 | #ifdef STRICT_MM_TYPECHECKS | ||
28 | |||
29 | /* | ||
30 | * These are used to make use of C type-checking.. | ||
31 | */ | ||
32 | typedef struct { pteval_t pte; } pte_t; | ||
33 | typedef struct { pmdval_t pmd; } pmd_t; | ||
34 | typedef struct { pgdval_t pgd; } pgd_t; | ||
35 | typedef struct { pteval_t pgprot; } pgprot_t; | ||
36 | |||
37 | #define pte_val(x) ((x).pte) | ||
38 | #define pmd_val(x) ((x).pmd) | ||
39 | #define pgd_val(x) ((x).pgd) | ||
40 | #define pgprot_val(x) ((x).pgprot) | ||
41 | |||
42 | #define __pte(x) ((pte_t) { (x) } ) | ||
43 | #define __pmd(x) ((pmd_t) { (x) } ) | ||
44 | #define __pgd(x) ((pgd_t) { (x) } ) | ||
45 | #define __pgprot(x) ((pgprot_t) { (x) } ) | ||
46 | |||
47 | #else /* !STRICT_MM_TYPECHECKS */ | ||
48 | |||
49 | typedef pteval_t pte_t; | ||
50 | typedef pmdval_t pmd_t; | ||
51 | typedef pgdval_t pgd_t; | ||
52 | typedef pteval_t pgprot_t; | ||
53 | |||
54 | #define pte_val(x) (x) | ||
55 | #define pmd_val(x) (x) | ||
56 | #define pgd_val(x) (x) | ||
57 | #define pgprot_val(x) (x) | ||
58 | |||
59 | #define __pte(x) (x) | ||
60 | #define __pmd(x) (x) | ||
61 | #define __pgd(x) (x) | ||
62 | #define __pgprot(x) (x) | ||
63 | |||
64 | #endif /* STRICT_MM_TYPECHECKS */ | ||
65 | |||
66 | #include <asm-generic/pgtable-nopud.h> | ||
67 | |||
68 | #endif /* __ASM_PGTABLE_3LEVEL_TYPES_H */ | ||
diff --git a/arch/arm64/include/asm/pgtable-4level-types.h b/arch/arm64/include/asm/pgtable-types.h index 7ad8dd257ea1..ca9df80af896 100644 --- a/arch/arm64/include/asm/pgtable-4level-types.h +++ b/arch/arm64/include/asm/pgtable-types.h | |||
@@ -1,5 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | * This program is free software; you can redistribute it and/or modify | 2 | * Page table types definitions. |
3 | * | ||
4 | * Copyright (C) 2014 ARM Ltd. | ||
5 | * Author: Catalin Marinas <catalin.marinas@arm.com> | ||
6 | * | ||
7 | * This program is free software: you can redistribute it and/or modify | ||
3 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
4 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
5 | * | 10 | * |
@@ -11,8 +16,9 @@ | |||
11 | * You should have received a copy of the GNU General Public License | 16 | * You should have received a copy of the GNU General Public License |
12 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
13 | */ | 18 | */ |
14 | #ifndef __ASM_PGTABLE_4LEVEL_TYPES_H | 19 | |
15 | #define __ASM_PGTABLE_4LEVEL_TYPES_H | 20 | #ifndef __ASM_PGTABLE_TYPES_H |
21 | #define __ASM_PGTABLE_TYPES_H | ||
16 | 22 | ||
17 | #include <asm/types.h> | 23 | #include <asm/types.h> |
18 | 24 | ||
@@ -29,43 +35,61 @@ typedef u64 pgdval_t; | |||
29 | * These are used to make use of C type-checking.. | 35 | * These are used to make use of C type-checking.. |
30 | */ | 36 | */ |
31 | typedef struct { pteval_t pte; } pte_t; | 37 | typedef struct { pteval_t pte; } pte_t; |
32 | typedef struct { pmdval_t pmd; } pmd_t; | ||
33 | typedef struct { pudval_t pud; } pud_t; | ||
34 | typedef struct { pgdval_t pgd; } pgd_t; | ||
35 | typedef struct { pteval_t pgprot; } pgprot_t; | ||
36 | |||
37 | #define pte_val(x) ((x).pte) | 38 | #define pte_val(x) ((x).pte) |
38 | #define pmd_val(x) ((x).pmd) | ||
39 | #define pud_val(x) ((x).pud) | ||
40 | #define pgd_val(x) ((x).pgd) | ||
41 | #define pgprot_val(x) ((x).pgprot) | ||
42 | |||
43 | #define __pte(x) ((pte_t) { (x) } ) | 39 | #define __pte(x) ((pte_t) { (x) } ) |
40 | |||
41 | #if CONFIG_ARM64_PGTABLE_LEVELS > 2 | ||
42 | typedef struct { pmdval_t pmd; } pmd_t; | ||
43 | #define pmd_val(x) ((x).pmd) | ||
44 | #define __pmd(x) ((pmd_t) { (x) } ) | 44 | #define __pmd(x) ((pmd_t) { (x) } ) |
45 | #endif | ||
46 | |||
47 | #if CONFIG_ARM64_PGTABLE_LEVELS > 3 | ||
48 | typedef struct { pudval_t pud; } pud_t; | ||
49 | #define pud_val(x) ((x).pud) | ||
45 | #define __pud(x) ((pud_t) { (x) } ) | 50 | #define __pud(x) ((pud_t) { (x) } ) |
51 | #endif | ||
52 | |||
53 | typedef struct { pgdval_t pgd; } pgd_t; | ||
54 | #define pgd_val(x) ((x).pgd) | ||
46 | #define __pgd(x) ((pgd_t) { (x) } ) | 55 | #define __pgd(x) ((pgd_t) { (x) } ) |
56 | |||
57 | typedef struct { pteval_t pgprot; } pgprot_t; | ||
58 | #define pgprot_val(x) ((x).pgprot) | ||
47 | #define __pgprot(x) ((pgprot_t) { (x) } ) | 59 | #define __pgprot(x) ((pgprot_t) { (x) } ) |
48 | 60 | ||
49 | #else /* !STRICT_MM_TYPECHECKS */ | 61 | #else /* !STRICT_MM_TYPECHECKS */ |
50 | 62 | ||
51 | typedef pteval_t pte_t; | 63 | typedef pteval_t pte_t; |
52 | typedef pmdval_t pmd_t; | ||
53 | typedef pudval_t pud_t; | ||
54 | typedef pgdval_t pgd_t; | ||
55 | typedef pteval_t pgprot_t; | ||
56 | |||
57 | #define pte_val(x) (x) | 64 | #define pte_val(x) (x) |
58 | #define pmd_val(x) (x) | ||
59 | #define pud_val(x) (x) | ||
60 | #define pgd_val(x) (x) | ||
61 | #define pgprot_val(x) (x) | ||
62 | |||
63 | #define __pte(x) (x) | 65 | #define __pte(x) (x) |
66 | |||
67 | #if CONFIG_ARM64_PGTABLE_LEVELS > 2 | ||
68 | typedef pmdval_t pmd_t; | ||
69 | #define pmd_val(x) (x) | ||
64 | #define __pmd(x) (x) | 70 | #define __pmd(x) (x) |
71 | #endif | ||
72 | |||
73 | #if CONFIG_ARM64_PGTABLE_LEVELS > 3 | ||
74 | typedef pudval_t pud_t; | ||
75 | #define pud_val(x) (x) | ||
65 | #define __pud(x) (x) | 76 | #define __pud(x) (x) |
77 | #endif | ||
78 | |||
79 | typedef pgdval_t pgd_t; | ||
80 | #define pgd_val(x) (x) | ||
66 | #define __pgd(x) (x) | 81 | #define __pgd(x) (x) |
82 | |||
83 | typedef pteval_t pgprot_t; | ||
84 | #define pgprot_val(x) (x) | ||
67 | #define __pgprot(x) (x) | 85 | #define __pgprot(x) (x) |
68 | 86 | ||
69 | #endif /* STRICT_MM_TYPECHECKS */ | 87 | #endif /* STRICT_MM_TYPECHECKS */ |
70 | 88 | ||
71 | #endif /* __ASM_PGTABLE_4LEVEL_TYPES_H */ | 89 | #if CONFIG_ARM64_PGTABLE_LEVELS == 2 |
90 | #include <asm-generic/pgtable-nopmd.h> | ||
91 | #elif CONFIG_ARM64_PGTABLE_LEVELS == 3 | ||
92 | #include <asm-generic/pgtable-nopud.h> | ||
93 | #endif | ||
94 | |||
95 | #endif /* __ASM_PGTABLE_TYPES_H */ | ||