vectors_const.h 1003 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. /**
  8. * The interrupt bit in `mcause` register is always bit 31 regardless of the interrupt controller used
  9. */
  10. #define VECTORS_MCAUSE_INTBIT_MASK (0x80000000)
  11. #if SOC_INT_CLIC_SUPPORTED
  12. /* When using the CLIC as their interrupt controller, the `mcause` register contains more information than
  13. * the interrupt bit and cause:
  14. * MINHV[30]: CPU is fetching vector interrupt entry address or not
  15. * MPP[29:28]: MSTATUS.MPP[1:0]
  16. * MPIL[23:16]: interrupt level before entering interrupt ISR
  17. *
  18. * Define the mask that will only keep the cause.
  19. */
  20. #define VECTORS_MCAUSE_REASON_MASK (0x00000fff)
  21. #else // !if SOC_INT_CLIC_SUPPORTED
  22. /**
  23. * For targets that use the former INTC or CLINT/PLIC, the `mcause` shouldn't contain any more information
  24. * but let's be safe and keep the 32 possible cause values.
  25. */
  26. #define VECTORS_MCAUSE_REASON_MASK (0x0000001f)
  27. #endif