blob: a97a182ba28732a4d9d22ae353efcf695696bd46 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/include/asm-arm/glue.h
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 Torvalds1da177e2005-04-16 15:20:36 -070018
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 Marinasbbe88882007-05-08 22:27:46 +010041 * v7_early - ARMv7 generic early abort handler
Linus Torvalds1da177e2005-04-16 15:20:36 -070042 */
Paul Brook48d79272008-04-18 22:43:07 +010043#undef CPU_DABORT_HANDLER
44#undef MULTI_DABORT
Linus Torvalds1da177e2005-04-16 15:20:36 -070045
46#if defined(CONFIG_CPU_ARM610)
Paul Brook48d79272008-04-18 22:43:07 +010047# ifdef CPU_DABORT_HANDLER
48# define MULTI_DABORT 1
Linus Torvalds1da177e2005-04-16 15:20:36 -070049# else
Paul Brook48d79272008-04-18 22:43:07 +010050# define CPU_DABORT_HANDLER cpu_arm6_data_abort
Linus Torvalds1da177e2005-04-16 15:20:36 -070051# endif
52#endif
53
54#if defined(CONFIG_CPU_ARM710)
Paul Brook48d79272008-04-18 22:43:07 +010055# ifdef CPU_DABORT_HANDLER
56# define MULTI_DABORT 1
Linus Torvalds1da177e2005-04-16 15:20:36 -070057# else
Paul Brook48d79272008-04-18 22:43:07 +010058# define CPU_DABORT_HANDLER cpu_arm7_data_abort
Linus Torvalds1da177e2005-04-16 15:20:36 -070059# endif
60#endif
61
62#ifdef CONFIG_CPU_ABRT_LV4T
Paul Brook48d79272008-04-18 22:43:07 +010063# ifdef CPU_DABORT_HANDLER
64# define MULTI_DABORT 1
Linus Torvalds1da177e2005-04-16 15:20:36 -070065# else
Paul Brook48d79272008-04-18 22:43:07 +010066# define CPU_DABORT_HANDLER v4t_late_abort
Linus Torvalds1da177e2005-04-16 15:20:36 -070067# endif
68#endif
69
70#ifdef CONFIG_CPU_ABRT_EV4
Paul Brook48d79272008-04-18 22:43:07 +010071# ifdef CPU_DABORT_HANDLER
72# define MULTI_DABORT 1
Linus Torvalds1da177e2005-04-16 15:20:36 -070073# else
Paul Brook48d79272008-04-18 22:43:07 +010074# define CPU_DABORT_HANDLER v4_early_abort
Linus Torvalds1da177e2005-04-16 15:20:36 -070075# endif
76#endif
77
78#ifdef CONFIG_CPU_ABRT_EV4T
Paul Brook48d79272008-04-18 22:43:07 +010079# ifdef CPU_DABORT_HANDLER
80# define MULTI_DABORT 1
Linus Torvalds1da177e2005-04-16 15:20:36 -070081# else
Paul Brook48d79272008-04-18 22:43:07 +010082# define CPU_DABORT_HANDLER v4t_early_abort
Linus Torvalds1da177e2005-04-16 15:20:36 -070083# endif
84#endif
85
86#ifdef CONFIG_CPU_ABRT_EV5TJ
Paul Brook48d79272008-04-18 22:43:07 +010087# ifdef CPU_DABORT_HANDLER
88# define MULTI_DABORT 1
Linus Torvalds1da177e2005-04-16 15:20:36 -070089# else
Paul Brook48d79272008-04-18 22:43:07 +010090# define CPU_DABORT_HANDLER v5tj_early_abort
Linus Torvalds1da177e2005-04-16 15:20:36 -070091# endif
92#endif
93
94#ifdef CONFIG_CPU_ABRT_EV5T
Paul Brook48d79272008-04-18 22:43:07 +010095# ifdef CPU_DABORT_HANDLER
96# define MULTI_DABORT 1
Linus Torvalds1da177e2005-04-16 15:20:36 -070097# else
Paul Brook48d79272008-04-18 22:43:07 +010098# define CPU_DABORT_HANDLER v5t_early_abort
Linus Torvalds1da177e2005-04-16 15:20:36 -070099# endif
100#endif
101
102#ifdef CONFIG_CPU_ABRT_EV6
Paul Brook48d79272008-04-18 22:43:07 +0100103# ifdef CPU_DABORT_HANDLER
104# define MULTI_DABORT 1
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105# else
Paul Brook48d79272008-04-18 22:43:07 +0100106# define CPU_DABORT_HANDLER v6_early_abort
Linus Torvalds1da177e2005-04-16 15:20:36 -0700107# endif
108#endif
109
Catalin Marinasbbe88882007-05-08 22:27:46 +0100110#ifdef CONFIG_CPU_ABRT_EV7
Paul Brook48d79272008-04-18 22:43:07 +0100111# ifdef CPU_DABORT_HANDLER
112# define MULTI_DABORT 1
Catalin Marinasbbe88882007-05-08 22:27:46 +0100113# else
Paul Brook48d79272008-04-18 22:43:07 +0100114# define CPU_DABORT_HANDLER v7_early_abort
Catalin Marinasbbe88882007-05-08 22:27:46 +0100115# endif
116#endif
117
Paul Brook48d79272008-04-18 22:43:07 +0100118#ifndef CPU_DABORT_HANDLER
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119#error Unknown data abort handler type
120#endif
121
Paul Brook48d79272008-04-18 22:43:07 +0100122/*
123 * Prefetch abort handler. If the CPU has an IFAR use that, otherwise
124 * use the address of the aborted instruction
125 */
126#undef CPU_PABORT_HANDLER
127#undef MULTI_PABORT
128
129#ifdef CONFIG_CPU_PABRT_IFAR
130# ifdef CPU_PABORT_HANDLER
131# define MULTI_PABORT 1
132# else
133# define CPU_PABORT_HANDLER(reg, insn) mrc p15, 0, reg, cr6, cr0, 2
134# endif
135#endif
136
137#ifdef CONFIG_CPU_PABRT_NOIFAR
138# ifdef CPU_PABORT_HANDLER
139# define MULTI_PABORT 1
140# else
141# define CPU_PABORT_HANDLER(reg, insn) mov reg, insn
142# endif
143#endif
144
145#ifndef CPU_PABORT_HANDLER
146#error Unknown prefetch abort handler type
147#endif
148
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149#endif