5508b17fb4
Binary descriptors are data objects stored at a known location of a binary image. They can be read by an external tool or image, and are used mostly for build information: version, build time, host information, etc. This commit adds initial support for defining such descriptors. Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
30 lines
1.1 KiB
C
30 lines
1.1 KiB
C
/*
|
|
* Copyright (c) 2023 Yonatan Schachter
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <zephyr/kernel.h>
|
|
#include <zephyr/bindesc.h>
|
|
|
|
#if IS_ENABLED(CONFIG_BINDESC_HOST_NAME)
|
|
BINDESC_STR_DEFINE(host_name, BINDESC_ID_HOST_NAME, HOST_NAME);
|
|
#endif /* IS_ENABLED(CONFIG_BINDESC_HOST_NAME) */
|
|
|
|
#if IS_ENABLED(CONFIG_BINDESC_C_COMPILER_NAME)
|
|
BINDESC_STR_DEFINE(c_compiler_name, BINDESC_ID_C_COMPILER_NAME, C_COMPILER_NAME);
|
|
#endif /* IS_ENABLED(CONFIG_BINDESC_C_COMPILER_NAME) */
|
|
|
|
#if IS_ENABLED(CONFIG_BINDESC_C_COMPILER_VERSION)
|
|
BINDESC_STR_DEFINE(c_compiler_version, BINDESC_ID_C_COMPILER_VERSION, C_COMPILER_VERSION);
|
|
#endif /* IS_ENABLED(CONFIG_BINDESC_C_COMPILER_VERSION) */
|
|
|
|
#if IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_NAME)
|
|
BINDESC_STR_DEFINE(cxx_compiler_name, BINDESC_ID_CXX_COMPILER_NAME, CXX_COMPILER_NAME);
|
|
#endif /* IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_NAME) */
|
|
|
|
#if IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_VERSION)
|
|
BINDESC_STR_DEFINE(cxx_compiler_version, BINDESC_ID_CXX_COMPILER_VERSION,
|
|
CXX_COMPILER_VERSION);
|
|
#endif /* IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_VERSION) */
|