Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Russell King | 4baa992 | 2008-08-02 10:55:55 +0100 | [diff] [blame] | 2 | * arch/arm/include/asm/glue.h |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 1997-1999 Russell King |
| 5 | * Copyright (C) 2000-2002 Deep Blue Solutions Ltd. |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2 as |
| 9 | * published by the Free Software Foundation. |
| 10 | * |
| 11 | * This file provides the glue to stick the processor-specific bits |
| 12 | * into the kernel in an efficient manner. The idea is to use branches |
| 13 | * when we're only targetting one class of TLB, or indirect calls |
| 14 | * when we're targetting multiple classes of TLBs. |
| 15 | */ |
| 16 | #ifdef __KERNEL__ |
| 17 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | |
| 19 | #ifdef __STDC__ |
| 20 | #define ____glue(name,fn) name##fn |
| 21 | #else |
| 22 | #define ____glue(name,fn) name/**/fn |
| 23 | #endif |
| 24 | #define __glue(name,fn) ____glue(name,fn) |
| 25 | |
| 26 | |
| 27 | |
| 28 | /* |
| 29 | * Data Abort Model |
| 30 | * ================ |
| 31 | * |
| 32 | * We have the following to choose from: |
| 33 | * arm6 - ARM6 style |
| 34 | * arm7 - ARM7 style |
| 35 | * v4_early - ARMv4 without Thumb early abort handler |
| 36 | * v4t_late - ARMv4 with Thumb late abort handler |
| 37 | * v4t_early - ARMv4 with Thumb early abort handler |
| 38 | * v5tej_early - ARMv5 with Thumb and Java early abort handler |
| 39 | * xscale - ARMv5 with Thumb with Xscale extensions |
| 40 | * v6_early - ARMv6 generic early abort handler |
Catalin Marinas | bbe8888 | 2007-05-08 22:27:46 +0100 | [diff] [blame] | 41 | * v7_early - ARMv7 generic early abort handler |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | */ |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 43 | #undef CPU_DABORT_HANDLER |
| 44 | #undef MULTI_DABORT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | |
| 46 | #if defined(CONFIG_CPU_ARM610) |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 47 | # ifdef CPU_DABORT_HANDLER |
| 48 | # define MULTI_DABORT 1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | # else |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 50 | # define CPU_DABORT_HANDLER cpu_arm6_data_abort |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | # endif |
| 52 | #endif |
| 53 | |
| 54 | #if defined(CONFIG_CPU_ARM710) |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 55 | # ifdef CPU_DABORT_HANDLER |
| 56 | # define MULTI_DABORT 1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | # else |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 58 | # define CPU_DABORT_HANDLER cpu_arm7_data_abort |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | # endif |
| 60 | #endif |
| 61 | |
| 62 | #ifdef CONFIG_CPU_ABRT_LV4T |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 63 | # ifdef CPU_DABORT_HANDLER |
| 64 | # define MULTI_DABORT 1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | # else |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 66 | # define CPU_DABORT_HANDLER v4t_late_abort |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | # endif |
| 68 | #endif |
| 69 | |
| 70 | #ifdef CONFIG_CPU_ABRT_EV4 |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 71 | # ifdef CPU_DABORT_HANDLER |
| 72 | # define MULTI_DABORT 1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 73 | # else |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 74 | # define CPU_DABORT_HANDLER v4_early_abort |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | # endif |
| 76 | #endif |
| 77 | |
| 78 | #ifdef CONFIG_CPU_ABRT_EV4T |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 79 | # ifdef CPU_DABORT_HANDLER |
| 80 | # define MULTI_DABORT 1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | # else |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 82 | # define CPU_DABORT_HANDLER v4t_early_abort |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 83 | # endif |
| 84 | #endif |
| 85 | |
| 86 | #ifdef CONFIG_CPU_ABRT_EV5TJ |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 87 | # ifdef CPU_DABORT_HANDLER |
| 88 | # define MULTI_DABORT 1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | # else |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 90 | # define CPU_DABORT_HANDLER v5tj_early_abort |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 91 | # endif |
| 92 | #endif |
| 93 | |
| 94 | #ifdef CONFIG_CPU_ABRT_EV5T |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 95 | # ifdef CPU_DABORT_HANDLER |
| 96 | # define MULTI_DABORT 1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 97 | # else |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 98 | # define CPU_DABORT_HANDLER v5t_early_abort |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 99 | # endif |
| 100 | #endif |
| 101 | |
| 102 | #ifdef CONFIG_CPU_ABRT_EV6 |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 103 | # ifdef CPU_DABORT_HANDLER |
| 104 | # define MULTI_DABORT 1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 105 | # else |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 106 | # define CPU_DABORT_HANDLER v6_early_abort |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 107 | # endif |
| 108 | #endif |
| 109 | |
Catalin Marinas | bbe8888 | 2007-05-08 22:27:46 +0100 | [diff] [blame] | 110 | #ifdef CONFIG_CPU_ABRT_EV7 |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 111 | # ifdef CPU_DABORT_HANDLER |
| 112 | # define MULTI_DABORT 1 |
Catalin Marinas | bbe8888 | 2007-05-08 22:27:46 +0100 | [diff] [blame] | 113 | # else |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 114 | # define CPU_DABORT_HANDLER v7_early_abort |
Catalin Marinas | bbe8888 | 2007-05-08 22:27:46 +0100 | [diff] [blame] | 115 | # endif |
| 116 | #endif |
| 117 | |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 118 | #ifndef CPU_DABORT_HANDLER |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 119 | #error Unknown data abort handler type |
| 120 | #endif |
| 121 | |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 122 | /* |
Kirill A. Shutemov | 4fb2847 | 2009-09-25 13:39:47 +0100 | [diff] [blame] | 123 | * Prefetch Abort Model |
| 124 | * ================ |
| 125 | * |
| 126 | * We have the following to choose from: |
| 127 | * legacy - no IFSR, no IFAR |
| 128 | * v6 - ARMv6: IFSR, no IFAR |
| 129 | * v7 - ARMv7: IFSR and IFAR |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 130 | */ |
Kirill A. Shutemov | 4fb2847 | 2009-09-25 13:39:47 +0100 | [diff] [blame] | 131 | |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 132 | #undef CPU_PABORT_HANDLER |
| 133 | #undef MULTI_PABORT |
| 134 | |
Kirill A. Shutemov | 4fb2847 | 2009-09-25 13:39:47 +0100 | [diff] [blame] | 135 | #ifdef CONFIG_CPU_PABRT_LEGACY |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 136 | # ifdef CPU_PABORT_HANDLER |
| 137 | # define MULTI_PABORT 1 |
| 138 | # else |
Kirill A. Shutemov | 4fb2847 | 2009-09-25 13:39:47 +0100 | [diff] [blame] | 139 | # define CPU_PABORT_HANDLER legacy_pabort |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 140 | # endif |
| 141 | #endif |
| 142 | |
Kirill A. Shutemov | 4fb2847 | 2009-09-25 13:39:47 +0100 | [diff] [blame] | 143 | #ifdef CONFIG_CPU_PABRT_V6 |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 144 | # ifdef CPU_PABORT_HANDLER |
| 145 | # define MULTI_PABORT 1 |
| 146 | # else |
Kirill A. Shutemov | 4fb2847 | 2009-09-25 13:39:47 +0100 | [diff] [blame] | 147 | # define CPU_PABORT_HANDLER v6_pabort |
| 148 | # endif |
| 149 | #endif |
| 150 | |
| 151 | #ifdef CONFIG_CPU_PABRT_V7 |
| 152 | # ifdef CPU_PABORT_HANDLER |
| 153 | # define MULTI_PABORT 1 |
| 154 | # else |
| 155 | # define CPU_PABORT_HANDLER v7_pabort |
Paul Brook | 48d7927 | 2008-04-18 22:43:07 +0100 | [diff] [blame] | 156 | # endif |
| 157 | #endif |
| 158 | |
| 159 | #ifndef CPU_PABORT_HANDLER |
| 160 | #error Unknown prefetch abort handler type |
| 161 | #endif |
| 162 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 163 | #endif |