Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 1 | /* |
Dan Handley | e83b0ca | 2014-01-14 18:17:09 +0000 | [diff] [blame] | 2 | * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 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 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 33 | .globl read_vbar_el1 |
| 34 | .globl read_vbar_el2 |
| 35 | .globl read_vbar_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 36 | .globl write_vbar_el1 |
| 37 | .globl write_vbar_el2 |
| 38 | .globl write_vbar_el3 |
| 39 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 40 | .globl read_sctlr_el1 |
| 41 | .globl read_sctlr_el2 |
| 42 | .globl read_sctlr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 43 | .globl write_sctlr_el1 |
| 44 | .globl write_sctlr_el2 |
| 45 | .globl write_sctlr_el3 |
| 46 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 47 | .globl read_actlr_el1 |
| 48 | .globl read_actlr_el2 |
| 49 | .globl read_actlr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 50 | .globl write_actlr_el1 |
| 51 | .globl write_actlr_el2 |
| 52 | .globl write_actlr_el3 |
| 53 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 54 | .globl read_esr_el1 |
| 55 | .globl read_esr_el2 |
| 56 | .globl read_esr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 57 | .globl write_esr_el1 |
| 58 | .globl write_esr_el2 |
| 59 | .globl write_esr_el3 |
| 60 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 61 | .globl read_afsr0_el1 |
| 62 | .globl read_afsr0_el2 |
| 63 | .globl read_afsr0_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 64 | .globl write_afsr0_el1 |
| 65 | .globl write_afsr0_el2 |
| 66 | .globl write_afsr0_el3 |
| 67 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 68 | .globl read_afsr1_el1 |
| 69 | .globl read_afsr1_el2 |
| 70 | .globl read_afsr1_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 71 | .globl write_afsr1_el1 |
| 72 | .globl write_afsr1_el2 |
| 73 | .globl write_afsr1_el3 |
| 74 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 75 | .globl read_far_el1 |
| 76 | .globl read_far_el2 |
| 77 | .globl read_far_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 78 | .globl write_far_el1 |
| 79 | .globl write_far_el2 |
| 80 | .globl write_far_el3 |
| 81 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 82 | .globl read_mair_el1 |
| 83 | .globl read_mair_el2 |
| 84 | .globl read_mair_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 85 | .globl write_mair_el1 |
| 86 | .globl write_mair_el2 |
| 87 | .globl write_mair_el3 |
| 88 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 89 | .globl read_amair_el1 |
| 90 | .globl read_amair_el2 |
| 91 | .globl read_amair_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 92 | .globl write_amair_el1 |
| 93 | .globl write_amair_el2 |
| 94 | .globl write_amair_el3 |
| 95 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 96 | .globl read_rvbar_el1 |
| 97 | .globl read_rvbar_el2 |
| 98 | .globl read_rvbar_el3 |
| 99 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 100 | .globl read_rmr_el1 |
| 101 | .globl read_rmr_el2 |
| 102 | .globl read_rmr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 103 | .globl write_rmr_el1 |
| 104 | .globl write_rmr_el2 |
| 105 | .globl write_rmr_el3 |
| 106 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 107 | .globl read_tcr_el1 |
| 108 | .globl read_tcr_el2 |
| 109 | .globl read_tcr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 110 | .globl write_tcr_el1 |
| 111 | .globl write_tcr_el2 |
| 112 | .globl write_tcr_el3 |
| 113 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 114 | .globl read_cptr_el2 |
| 115 | .globl read_cptr_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 116 | .globl write_cptr_el2 |
| 117 | .globl write_cptr_el3 |
| 118 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 119 | .globl read_ttbr0_el1 |
| 120 | .globl read_ttbr0_el2 |
| 121 | .globl read_ttbr0_el3 |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 122 | .globl write_ttbr0_el1 |
| 123 | .globl write_ttbr0_el2 |
| 124 | .globl write_ttbr0_el3 |
| 125 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 126 | .globl read_ttbr1_el1 |
| 127 | .globl read_ttbr1_el2 |
| 128 | .globl write_ttbr1 |
| 129 | .globl write_ttbr1_el1 |
| 130 | .globl write_ttbr1_el2 |
| 131 | |
| 132 | .globl read_cpacr |
| 133 | .globl write_cpacr |
| 134 | |
| 135 | .globl read_cntfrq |
| 136 | .globl write_cntfrq |
| 137 | |
| 138 | .globl read_cpuectlr |
| 139 | .globl write_cpuectlr |
| 140 | |
| 141 | .globl read_cnthctl_el2 |
| 142 | .globl write_cnthctl_el2 |
| 143 | |
| 144 | .globl read_cntfrq_el0 |
| 145 | .globl write_cntfrq_el0 |
| 146 | |
| 147 | .globl read_scr |
| 148 | .globl write_scr |
| 149 | |
| 150 | .globl read_hcr |
| 151 | .globl write_hcr |
| 152 | |
| 153 | .globl read_midr |
| 154 | .globl read_mpidr |
| 155 | |
| 156 | .globl read_current_el |
| 157 | .globl read_id_pfr1_el1 |
| 158 | .globl read_id_aa64pfr0_el1 |
| 159 | |
| 160 | #if SUPPORT_VFP |
| 161 | .globl enable_vfp |
| 162 | .globl read_fpexc |
| 163 | .globl write_fpexc |
| 164 | #endif |
| 165 | |
| 166 | |
| 167 | .section .text, "ax" |
| 168 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 169 | read_current_el: ; .type read_current_el, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 170 | mrs x0, CurrentEl |
| 171 | ret |
| 172 | |
| 173 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 174 | read_id_pfr1_el1: ; .type read_id_pfr1_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 175 | mrs x0, id_pfr1_el1 |
| 176 | ret |
| 177 | |
| 178 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 179 | read_id_aa64pfr0_el1: ; .type read_id_aa64pfr0_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 180 | mrs x0, id_aa64pfr0_el1 |
| 181 | ret |
| 182 | |
| 183 | |
| 184 | /* ----------------------------------------------------- |
| 185 | * VBAR accessors |
| 186 | * ----------------------------------------------------- |
| 187 | */ |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 188 | read_vbar_el1: ; .type read_vbar_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 189 | mrs x0, vbar_el1 |
| 190 | ret |
| 191 | |
| 192 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 193 | read_vbar_el2: ; .type read_vbar_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 194 | mrs x0, vbar_el2 |
| 195 | ret |
| 196 | |
| 197 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 198 | read_vbar_el3: ; .type read_vbar_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 199 | mrs x0, vbar_el3 |
| 200 | ret |
| 201 | |
| 202 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 203 | write_vbar_el1: ; .type write_vbar_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 204 | msr vbar_el1, x0 |
| 205 | isb |
| 206 | ret |
| 207 | |
| 208 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 209 | write_vbar_el2: ; .type write_vbar_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 210 | msr vbar_el2, x0 |
| 211 | isb |
| 212 | ret |
| 213 | |
| 214 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 215 | write_vbar_el3: ; .type write_vbar_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 216 | msr vbar_el3, x0 |
| 217 | isb |
| 218 | ret |
| 219 | |
| 220 | |
| 221 | /* ----------------------------------------------------- |
| 222 | * AFSR0 accessors |
| 223 | * ----------------------------------------------------- |
| 224 | */ |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 225 | read_afsr0_el1: ; .type read_afsr0_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 226 | mrs x0, afsr0_el1 |
| 227 | ret |
| 228 | |
| 229 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 230 | read_afsr0_el2: ; .type read_afsr0_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 231 | mrs x0, afsr0_el2 |
| 232 | ret |
| 233 | |
| 234 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 235 | read_afsr0_el3: ; .type read_afsr0_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 236 | mrs x0, afsr0_el3 |
| 237 | ret |
| 238 | |
| 239 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 240 | write_afsr0_el1: ; .type write_afsr0_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 241 | msr afsr0_el1, x0 |
| 242 | isb |
| 243 | ret |
| 244 | |
| 245 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 246 | write_afsr0_el2: ; .type write_afsr0_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 247 | msr afsr0_el2, x0 |
| 248 | isb |
| 249 | ret |
| 250 | |
| 251 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 252 | write_afsr0_el3: ; .type write_afsr0_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 253 | msr afsr0_el3, x0 |
| 254 | isb |
| 255 | ret |
| 256 | |
| 257 | |
| 258 | /* ----------------------------------------------------- |
| 259 | * FAR accessors |
| 260 | * ----------------------------------------------------- |
| 261 | */ |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 262 | read_far_el1: ; .type read_far_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 263 | mrs x0, far_el1 |
| 264 | ret |
| 265 | |
| 266 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 267 | read_far_el2: ; .type read_far_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 268 | mrs x0, far_el2 |
| 269 | ret |
| 270 | |
| 271 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 272 | read_far_el3: ; .type read_far_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 273 | mrs x0, far_el3 |
| 274 | ret |
| 275 | |
| 276 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 277 | write_far_el1: ; .type write_far_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 278 | msr far_el1, x0 |
| 279 | isb |
| 280 | ret |
| 281 | |
| 282 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 283 | write_far_el2: ; .type write_far_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 284 | msr far_el2, x0 |
| 285 | isb |
| 286 | ret |
| 287 | |
| 288 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 289 | write_far_el3: ; .type write_far_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 290 | msr far_el3, x0 |
| 291 | isb |
| 292 | ret |
| 293 | |
| 294 | |
| 295 | /* ----------------------------------------------------- |
| 296 | * MAIR accessors |
| 297 | * ----------------------------------------------------- |
| 298 | */ |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 299 | read_mair_el1: ; .type read_mair_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 300 | mrs x0, mair_el1 |
| 301 | ret |
| 302 | |
| 303 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 304 | read_mair_el2: ; .type read_mair_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 305 | mrs x0, mair_el2 |
| 306 | ret |
| 307 | |
| 308 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 309 | read_mair_el3: ; .type read_mair_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 310 | mrs x0, mair_el3 |
| 311 | ret |
| 312 | |
| 313 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 314 | write_mair_el1: ; .type write_mair_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 315 | msr mair_el1, x0 |
| 316 | isb |
| 317 | ret |
| 318 | |
| 319 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 320 | write_mair_el2: ; .type write_mair_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 321 | msr mair_el2, x0 |
| 322 | isb |
| 323 | ret |
| 324 | |
| 325 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 326 | write_mair_el3: ; .type write_mair_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 327 | msr mair_el3, x0 |
| 328 | isb |
| 329 | ret |
| 330 | |
| 331 | |
| 332 | /* ----------------------------------------------------- |
| 333 | * AMAIR accessors |
| 334 | * ----------------------------------------------------- |
| 335 | */ |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 336 | read_amair_el1: ; .type read_amair_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 337 | mrs x0, amair_el1 |
| 338 | ret |
| 339 | |
| 340 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 341 | read_amair_el2: ; .type read_amair_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 342 | mrs x0, amair_el2 |
| 343 | ret |
| 344 | |
| 345 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 346 | read_amair_el3: ; .type read_amair_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 347 | mrs x0, amair_el3 |
| 348 | ret |
| 349 | |
| 350 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 351 | write_amair_el1: ; .type write_amair_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 352 | msr amair_el1, x0 |
| 353 | isb |
| 354 | ret |
| 355 | |
| 356 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 357 | write_amair_el2: ; .type write_amair_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 358 | msr amair_el2, x0 |
| 359 | isb |
| 360 | ret |
| 361 | |
| 362 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 363 | write_amair_el3: ; .type write_amair_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 364 | msr amair_el3, x0 |
| 365 | isb |
| 366 | ret |
| 367 | |
| 368 | |
| 369 | /* ----------------------------------------------------- |
| 370 | * RVBAR accessors |
| 371 | * ----------------------------------------------------- |
| 372 | */ |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 373 | read_rvbar_el1: ; .type read_rvbar_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 374 | mrs x0, rvbar_el1 |
| 375 | ret |
| 376 | |
| 377 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 378 | read_rvbar_el2: ; .type read_rvbar_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 379 | mrs x0, rvbar_el2 |
| 380 | ret |
| 381 | |
| 382 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 383 | read_rvbar_el3: ; .type read_rvbar_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 384 | mrs x0, rvbar_el3 |
| 385 | ret |
| 386 | |
| 387 | |
| 388 | /* ----------------------------------------------------- |
| 389 | * RMR accessors |
| 390 | * ----------------------------------------------------- |
| 391 | */ |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 392 | read_rmr_el1: ; .type read_rmr_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 393 | mrs x0, rmr_el1 |
| 394 | ret |
| 395 | |
| 396 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 397 | read_rmr_el2: ; .type read_rmr_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 398 | mrs x0, rmr_el2 |
| 399 | ret |
| 400 | |
| 401 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 402 | read_rmr_el3: ; .type read_rmr_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 403 | mrs x0, rmr_el3 |
| 404 | ret |
| 405 | |
| 406 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 407 | write_rmr_el1: ; .type write_rmr_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 408 | msr rmr_el1, x0 |
| 409 | isb |
| 410 | ret |
| 411 | |
| 412 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 413 | write_rmr_el2: ; .type write_rmr_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 414 | msr rmr_el2, x0 |
| 415 | isb |
| 416 | ret |
| 417 | |
| 418 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 419 | write_rmr_el3: ; .type write_rmr_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 420 | msr rmr_el3, x0 |
| 421 | isb |
| 422 | ret |
| 423 | |
| 424 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 425 | /* ----------------------------------------------------- |
| 426 | * AFSR1 accessors |
| 427 | * ----------------------------------------------------- |
| 428 | */ |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 429 | read_afsr1_el1: ; .type read_afsr1_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 430 | mrs x0, afsr1_el1 |
| 431 | ret |
| 432 | |
| 433 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 434 | read_afsr1_el2: ; .type read_afsr1_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 435 | mrs x0, afsr1_el2 |
| 436 | ret |
| 437 | |
| 438 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 439 | read_afsr1_el3: ; .type read_afsr1_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 440 | mrs x0, afsr1_el3 |
| 441 | ret |
| 442 | |
| 443 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 444 | write_afsr1_el1: ; .type write_afsr1_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 445 | msr afsr1_el1, x0 |
| 446 | isb |
| 447 | ret |
| 448 | |
| 449 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 450 | write_afsr1_el2: ; .type write_afsr1_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 451 | msr afsr1_el2, x0 |
| 452 | isb |
| 453 | ret |
| 454 | |
| 455 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 456 | write_afsr1_el3: ; .type write_afsr1_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 457 | msr afsr1_el3, x0 |
| 458 | isb |
| 459 | ret |
| 460 | |
| 461 | |
| 462 | /* ----------------------------------------------------- |
| 463 | * SCTLR accessors |
| 464 | * ----------------------------------------------------- |
| 465 | */ |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 466 | read_sctlr_el1: ; .type read_sctlr_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 467 | mrs x0, sctlr_el1 |
| 468 | ret |
| 469 | |
| 470 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 471 | read_sctlr_el2: ; .type read_sctlr_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 472 | mrs x0, sctlr_el2 |
| 473 | ret |
| 474 | |
| 475 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 476 | read_sctlr_el3: ; .type read_sctlr_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 477 | mrs x0, sctlr_el3 |
| 478 | ret |
| 479 | |
| 480 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 481 | write_sctlr_el1: ; .type write_sctlr_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 482 | msr sctlr_el1, x0 |
| 483 | dsb sy |
| 484 | isb |
| 485 | ret |
| 486 | |
| 487 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 488 | write_sctlr_el2: ; .type write_sctlr_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 489 | msr sctlr_el2, x0 |
| 490 | dsb sy |
| 491 | isb |
| 492 | ret |
| 493 | |
| 494 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 495 | write_sctlr_el3: ; .type write_sctlr_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 496 | msr sctlr_el3, x0 |
| 497 | dsb sy |
| 498 | isb |
| 499 | ret |
| 500 | |
| 501 | |
| 502 | /* ----------------------------------------------------- |
| 503 | * ACTLR accessors |
| 504 | * ----------------------------------------------------- |
| 505 | */ |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 506 | read_actlr_el1: ; .type read_actlr_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 507 | mrs x0, actlr_el1 |
| 508 | ret |
| 509 | |
| 510 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 511 | read_actlr_el2: ; .type read_actlr_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 512 | mrs x0, actlr_el2 |
| 513 | ret |
| 514 | |
| 515 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 516 | read_actlr_el3: ; .type read_actlr_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 517 | mrs x0, actlr_el3 |
| 518 | ret |
| 519 | |
| 520 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 521 | write_actlr_el1: ; .type write_actlr_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 522 | msr actlr_el1, x0 |
| 523 | dsb sy |
| 524 | isb |
| 525 | ret |
| 526 | |
| 527 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 528 | write_actlr_el2: ; .type write_actlr_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 529 | msr actlr_el2, x0 |
| 530 | dsb sy |
| 531 | isb |
| 532 | ret |
| 533 | |
| 534 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 535 | write_actlr_el3: ; .type write_actlr_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 536 | msr actlr_el3, x0 |
| 537 | dsb sy |
| 538 | isb |
| 539 | ret |
| 540 | |
| 541 | |
| 542 | /* ----------------------------------------------------- |
| 543 | * ESR accessors |
| 544 | * ----------------------------------------------------- |
| 545 | */ |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 546 | read_esr_el1: ; .type read_esr_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 547 | mrs x0, esr_el1 |
| 548 | ret |
| 549 | |
| 550 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 551 | read_esr_el2: ; .type read_esr_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 552 | mrs x0, esr_el2 |
| 553 | ret |
| 554 | |
| 555 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 556 | read_esr_el3: ; .type read_esr_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 557 | mrs x0, esr_el3 |
| 558 | ret |
| 559 | |
| 560 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 561 | write_esr_el1: ; .type write_esr_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 562 | msr esr_el1, x0 |
| 563 | dsb sy |
| 564 | isb |
| 565 | ret |
| 566 | |
| 567 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 568 | write_esr_el2: ; .type write_esr_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 569 | msr esr_el2, x0 |
| 570 | dsb sy |
| 571 | isb |
| 572 | ret |
| 573 | |
| 574 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 575 | write_esr_el3: ; .type write_esr_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 576 | msr esr_el3, x0 |
| 577 | dsb sy |
| 578 | isb |
| 579 | ret |
| 580 | |
| 581 | |
| 582 | /* ----------------------------------------------------- |
| 583 | * TCR accessors |
| 584 | * ----------------------------------------------------- |
| 585 | */ |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 586 | read_tcr_el1: ; .type read_tcr_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 587 | mrs x0, tcr_el1 |
| 588 | ret |
| 589 | |
| 590 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 591 | read_tcr_el2: ; .type read_tcr_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 592 | mrs x0, tcr_el2 |
| 593 | ret |
| 594 | |
| 595 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 596 | read_tcr_el3: ; .type read_tcr_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 597 | mrs x0, tcr_el3 |
| 598 | ret |
| 599 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 600 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 601 | write_tcr_el1: ; .type write_tcr_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 602 | msr tcr_el1, x0 |
| 603 | dsb sy |
| 604 | isb |
| 605 | ret |
| 606 | |
| 607 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 608 | write_tcr_el2: ; .type write_tcr_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 609 | msr tcr_el2, x0 |
| 610 | dsb sy |
| 611 | isb |
| 612 | ret |
| 613 | |
| 614 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 615 | write_tcr_el3: ; .type write_tcr_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 616 | msr tcr_el3, x0 |
| 617 | dsb sy |
| 618 | isb |
| 619 | ret |
| 620 | |
| 621 | |
| 622 | /* ----------------------------------------------------- |
| 623 | * CPTR accessors |
| 624 | * ----------------------------------------------------- |
| 625 | */ |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 626 | read_cptr_el1: ; .type read_cptr_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 627 | b read_cptr_el1 |
| 628 | ret |
| 629 | |
| 630 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 631 | read_cptr_el2: ; .type read_cptr_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 632 | mrs x0, cptr_el2 |
| 633 | ret |
| 634 | |
| 635 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 636 | read_cptr_el3: ; .type read_cptr_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 637 | mrs x0, cptr_el3 |
| 638 | ret |
| 639 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 640 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 641 | write_cptr_el1: ; .type write_cptr_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 642 | b write_cptr_el1 |
| 643 | |
| 644 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 645 | write_cptr_el2: ; .type write_cptr_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 646 | msr cptr_el2, x0 |
| 647 | dsb sy |
| 648 | isb |
| 649 | ret |
| 650 | |
| 651 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 652 | write_cptr_el3: ; .type write_cptr_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 653 | msr cptr_el3, x0 |
| 654 | dsb sy |
| 655 | isb |
| 656 | ret |
| 657 | |
| 658 | |
| 659 | /* ----------------------------------------------------- |
| 660 | * TTBR0 accessors |
| 661 | * ----------------------------------------------------- |
| 662 | */ |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 663 | read_ttbr0_el1: ; .type read_ttbr0_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 664 | mrs x0, ttbr0_el1 |
| 665 | ret |
| 666 | |
| 667 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 668 | read_ttbr0_el2: ; .type read_ttbr0_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 669 | mrs x0, ttbr0_el2 |
| 670 | ret |
| 671 | |
| 672 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 673 | read_ttbr0_el3: ; .type read_ttbr0_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 674 | mrs x0, ttbr0_el3 |
| 675 | ret |
| 676 | |
| 677 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 678 | write_ttbr0_el1: ; .type write_ttbr0_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 679 | msr ttbr0_el1, x0 |
| 680 | isb |
| 681 | ret |
| 682 | |
| 683 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 684 | write_ttbr0_el2: ; .type write_ttbr0_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 685 | msr ttbr0_el2, x0 |
| 686 | isb |
| 687 | ret |
| 688 | |
| 689 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 690 | write_ttbr0_el3: ; .type write_ttbr0_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 691 | msr ttbr0_el3, x0 |
| 692 | isb |
| 693 | ret |
| 694 | |
| 695 | |
| 696 | /* ----------------------------------------------------- |
| 697 | * TTBR1 accessors |
| 698 | * ----------------------------------------------------- |
| 699 | */ |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 700 | read_ttbr1_el1: ; .type read_ttbr1_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 701 | mrs x0, ttbr1_el1 |
| 702 | ret |
| 703 | |
| 704 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 705 | read_ttbr1_el2: ; .type read_ttbr1_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 706 | b read_ttbr1_el2 |
| 707 | |
| 708 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 709 | read_ttbr1_el3: ; .type read_ttbr1_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 710 | b read_ttbr1_el3 |
| 711 | |
| 712 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 713 | write_ttbr1_el1: ; .type write_ttbr1_el1, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 714 | msr ttbr1_el1, x0 |
| 715 | isb |
| 716 | ret |
| 717 | |
| 718 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 719 | write_ttbr1_el2: ; .type write_ttbr1_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 720 | b write_ttbr1_el2 |
| 721 | |
| 722 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 723 | write_ttbr1_el3: ; .type write_ttbr1_el3, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 724 | b write_ttbr1_el3 |
| 725 | |
| 726 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 727 | read_hcr: ; .type read_hcr, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 728 | mrs x0, hcr_el2 |
| 729 | ret |
| 730 | |
| 731 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 732 | write_hcr: ; .type write_hcr, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 733 | msr hcr_el2, x0 |
| 734 | dsb sy |
| 735 | isb |
| 736 | ret |
| 737 | |
| 738 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 739 | read_cpacr: ; .type read_cpacr, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 740 | mrs x0, cpacr_el1 |
| 741 | ret |
| 742 | |
| 743 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 744 | write_cpacr: ; .type write_cpacr, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 745 | msr cpacr_el1, x0 |
| 746 | ret |
| 747 | |
| 748 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 749 | read_cntfrq_el0: ; .type read_cntfrq_el0, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 750 | mrs x0, cntfrq_el0 |
| 751 | ret |
| 752 | |
| 753 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 754 | write_cntfrq_el0: ; .type write_cntfrq_el0, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 755 | msr cntfrq_el0, x0 |
| 756 | ret |
| 757 | |
| 758 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 759 | read_cpuectlr: ; .type read_cpuectlr, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 760 | mrs x0, CPUECTLR_EL1 |
| 761 | ret |
| 762 | |
| 763 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 764 | write_cpuectlr: ; .type write_cpuectlr, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 765 | msr CPUECTLR_EL1, x0 |
| 766 | dsb sy |
| 767 | isb |
| 768 | ret |
| 769 | |
| 770 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 771 | read_cnthctl_el2: ; .type read_cnthctl_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 772 | mrs x0, cnthctl_el2 |
| 773 | ret |
| 774 | |
| 775 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 776 | write_cnthctl_el2: ; .type write_cnthctl_el2, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 777 | msr cnthctl_el2, x0 |
| 778 | ret |
| 779 | |
| 780 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 781 | read_cntfrq: ; .type read_cntfrq, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 782 | mrs x0, cntfrq_el0 |
| 783 | ret |
| 784 | |
| 785 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 786 | write_cntfrq: ; .type write_cntfrq, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 787 | msr cntfrq_el0, x0 |
| 788 | ret |
| 789 | |
| 790 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 791 | write_scr: ; .type write_scr, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 792 | msr scr_el3, x0 |
| 793 | dsb sy |
| 794 | isb |
| 795 | ret |
| 796 | |
| 797 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 798 | read_scr: ; .type read_scr, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 799 | mrs x0, scr_el3 |
| 800 | ret |
| 801 | |
| 802 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 803 | read_midr: ; .type read_midr, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 804 | mrs x0, midr_el1 |
| 805 | ret |
| 806 | |
| 807 | |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 808 | read_mpidr: ; .type read_mpidr, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 809 | mrs x0, mpidr_el1 |
| 810 | ret |
| 811 | |
| 812 | |
| 813 | #if SUPPORT_VFP |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 814 | enable_vfp: ; .type enable_vfp, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 815 | mrs x0, cpacr_el1 |
| 816 | orr x0, x0, #CPACR_VFP_BITS |
| 817 | msr cpacr_el1, x0 |
| 818 | mrs x0, cptr_el3 |
| 819 | mov x1, #AARCH64_CPTR_TFP |
| 820 | bic x0, x0, x1 |
| 821 | msr cptr_el3, x0 |
| 822 | ret |
| 823 | |
| 824 | |
| 825 | // int read_fpexc(void) |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 826 | read_fpexc: ; .type read_fpexc, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 827 | b read_fpexc |
| 828 | ret |
| 829 | |
| 830 | |
| 831 | // void write_fpexc(int fpexc) |
Jeenu Viswambharan | 3a4cae0 | 2014-01-16 17:30:39 +0000 | [diff] [blame] | 832 | write_fpexc: ; .type write_fpexc, %function |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 833 | b write_fpexc |
| 834 | ret |
| 835 | |
| 836 | #endif |