blob: 8377f2c6a2dbf8436db29b791d4c005ba77d980d [file] [log] [blame]
Achin Gupta4f6ad662013-10-25 09:08:21 +01001/*
2 * Copyright (c) 2013, ARM Limited. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * Redistributions of source code must retain the above copyright notice, this
8 * list of conditions and the following disclaimer.
9 *
10 * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 *
14 * Neither the name of ARM nor the names of its contributors may be used
15 * to endorse or promote products derived from this software without specific
16 * prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#include <arch_helpers.h>
32
33 .globl tlbiall
34 .globl tlbiallis
35 .globl tlbialle1
36 .globl tlbialle1is
37 .globl tlbialle2
38 .globl tlbialle2is
39 .globl tlbialle3
40 .globl tlbialle3is
41 .globl tlbivmalle1
42
43
44 .section .text, "ax"
45
46tlbiall:; .type tlbiall, %function
47 mrs x0, CurrentEl
48 cmp x0, #(MODE_EL1 << MODE_EL_SHIFT)
49 b.eq tlbialle1
50 cmp x0, #(MODE_EL2 << MODE_EL_SHIFT)
51 b.eq tlbialle2
52 cmp x0, #(MODE_EL3 << MODE_EL_SHIFT)
53 b.eq tlbialle3
54
55
56tlbiallis:; .type tlbiallis, %function
57 mrs x0, CurrentEl
58 cmp x0, #(MODE_EL1 << MODE_EL_SHIFT)
59 b.eq tlbialle1is
60 cmp x0, #(MODE_EL2 << MODE_EL_SHIFT)
61 b.eq tlbialle2is
62 cmp x0, #(MODE_EL3 << MODE_EL_SHIFT)
63 b.eq tlbialle3is
64
65
66tlbialle1:; .type tlbialle1, %function
67 tlbi alle1
68 dsb sy
69 isb
70 ret
71
72
73tlbialle1is:; .type tlbialle1is, %function
74 tlbi alle1is
75 dsb sy
76 isb
77 ret
78
79
80tlbialle2:; .type tlbialle2, %function
81 tlbi alle2
82 dsb sy
83 isb
84 ret
85
86
87tlbialle2is:; .type tlbialle2is, %function
88 tlbi alle2is
89 dsb sy
90 isb
91 ret
92
93
94tlbialle3:; .type tlbialle3, %function
95 tlbi alle3
96 dsb sy
97 isb
98 ret
99
100
101tlbialle3is:; .type tlbialle3is, %function
102 tlbi alle3is
103 dsb sy
104 isb
105 ret
106
107tlbivmalle1:; .type tlbivmalle1, %function
108 tlbi vmalle1
109 dsb sy
110 isb
111 ret