Andre Przywara | fa914d8 | 2022-11-21 17:04:10 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2022, ARM Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | * Dispatch synchronous system register traps from lower ELs. |
| 7 | */ |
| 8 | |
| 9 | #include <bl31/sync_handle.h> |
| 10 | #include <context.h> |
| 11 | |
| 12 | int handle_sysreg_trap(uint64_t esr_el3, cpu_context_t *ctx) |
| 13 | { |
| 14 | switch (esr_el3 & ISS_SYSREG_OPCODE_MASK) { |
Andre Przywara | bdc76f1 | 2022-11-21 17:07:25 +0000 | [diff] [blame] | 15 | #if ENABLE_FEAT_RNG_TRAP |
| 16 | case ISS_SYSREG_OPCODE_RNDR: |
| 17 | case ISS_SYSREG_OPCODE_RNDRRS: |
| 18 | return plat_handle_rng_trap(esr_el3, ctx); |
| 19 | #endif |
Andre Przywara | fa914d8 | 2022-11-21 17:04:10 +0000 | [diff] [blame] | 20 | default: |
| 21 | return TRAP_RET_UNHANDLED; |
| 22 | } |
| 23 | } |