asserts.h 958 B

12345678910111213141516171819202122232425262728293031323334
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2020 Synopsys, Inc. (www.synopsys.com)
  4. *
  5. * Author: Eugeniy Paltsev <[email protected]>
  6. */
  7. #ifndef __ASM_ARC_ASSERTS_H
  8. #define __ASM_ARC_ASSERTS_H
  9. /* Helpers to sanitize config options. */
  10. void chk_opt_strict(char *opt_name, bool hw_exists, bool opt_ena);
  11. void chk_opt_weak(char *opt_name, bool hw_exists, bool opt_ena);
  12. /*
  13. * Check required config option:
  14. * - panic in case of OPT enabled but corresponding HW absent.
  15. * - warn in case of OPT disabled but corresponding HW exists.
  16. */
  17. #define CHK_OPT_STRICT(opt_name, hw_exists) \
  18. ({ \
  19. chk_opt_strict(#opt_name, hw_exists, IS_ENABLED(opt_name)); \
  20. })
  21. /*
  22. * Check optional config option:
  23. * - panic in case of OPT enabled but corresponding HW absent.
  24. */
  25. #define CHK_OPT_WEAK(opt_name, hw_exists) \
  26. ({ \
  27. chk_opt_weak(#opt_name, hw_exists, IS_ENABLED(opt_name)); \
  28. })
  29. #endif /* __ASM_ARC_ASSERTS_H */