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