plat_common.h 881 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2023, Advanced Micro Devices, Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. /* Header file to contain common macros across different platforms */
  7. #ifndef PLAT_COMMON_H
  8. #define PLAT_COMMON_H
  9. #define __bf_shf(x) (__builtin_ffsll(x) - 1U)
  10. #define FIELD_GET(_mask, _reg) \
  11. ({ \
  12. (typeof(_mask))(((_reg) & (_mask)) >> __bf_shf(_mask)); \
  13. })
  14. /*******************************************************************************
  15. * interrupt handling related constants
  16. ******************************************************************************/
  17. #define ARM_IRQ_SEC_SGI_0 8U
  18. #define ARM_IRQ_SEC_SGI_1 9U
  19. #define ARM_IRQ_SEC_SGI_2 10U
  20. #define ARM_IRQ_SEC_SGI_3 11U
  21. #define ARM_IRQ_SEC_SGI_4 12U
  22. #define ARM_IRQ_SEC_SGI_5 13U
  23. #define ARM_IRQ_SEC_SGI_6 14U
  24. #define ARM_IRQ_SEC_SGI_7 15U
  25. #endif /* PLAT_COMMON_H */