zephyr/subsys/bindesc/bindesc_host_info.c
Yonatan Schachter 5508b17fb4 bindesc: Add initial support for binary descriptor definition
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>
2023-09-28 07:39:09 -04:00

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) */