bl31_traps.c 517 B

1234567891011121314151617181920212223
  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. #include <bl31/sync_handle.h>
  9. #include <context.h>
  10. int handle_sysreg_trap(uint64_t esr_el3, cpu_context_t *ctx)
  11. {
  12. switch (esr_el3 & ISS_SYSREG_OPCODE_MASK) {
  13. #if ENABLE_FEAT_RNG_TRAP
  14. case ISS_SYSREG_OPCODE_RNDR:
  15. case ISS_SYSREG_OPCODE_RNDRRS:
  16. return plat_handle_rng_trap(esr_el3, ctx);
  17. #endif
  18. default:
  19. return TRAP_RET_UNHANDLED;
  20. }
  21. }