Commit 3787bce2 authored by Adam Wujek's avatar Adam Wujek 💬

sw:rt:Kconfig: move LIB_PRINTF related defines to Kconfig

Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent ca220c9e
......@@ -7,6 +7,4 @@ TRTL_SW = $(TRTL)/software
EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=0x0
EXTRA_CFLAGS += -DRT_APPLICATION_ID=0x0
MOCKTURTLE_LIBRARY_PRINT_ENABLE := 1
include $(TRTL_SW)/rt/Makefile
......@@ -10,8 +10,19 @@
#
# Mock Turtle configuration
#
#
# Mock Turtle framework configuration
#
CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE=y
# CONFIG_MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE is not set
CONFIG_MOCKTURTLE_FRAMEWORK_32BIT_ALIGN=y
#
# Mock Turtle library configuration
#
CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE=y
# CONFIG_MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE is not set
# CONFIG_MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE is not set
......@@ -7,8 +7,4 @@ TRTL_SW = $(TRTL)/software
EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=0x0
EXTRA_CFLAGS += -DRT_APPLICATION_ID=0x0
MOCKTURTLE_LIBRARY_PRINT_ENABLE := 1
MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE := 1
MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE := 1
include $(TRTL_SW)/rt/Makefile
......@@ -10,8 +10,19 @@
#
# Mock Turtle configuration
#
#
# Mock Turtle framework configuration
#
CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_32BIT_ALIGN=y
#
# Mock Turtle library configuration
#
CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE=y
CONFIG_MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE=y
CONFIG_MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE=y
......@@ -7,7 +7,4 @@ TRTL_SW = $(TRTL)/software
EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=0x0
EXTRA_CFLAGS += -DRT_APPLICATION_ID=0x0
MOCKTURTLE_LIBRARY_PRINT_ENABLE := 1
include $(TRTL_SW)/rt/Makefile
......@@ -10,4 +10,15 @@
#
# Mock Turtle configuration
#
#
# Mock Turtle framework configuration
#
# CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE is not set
#
# Mock Turtle library configuration
#
CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE=y
# CONFIG_MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE is not set
# CONFIG_MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE is not set
......@@ -7,6 +7,4 @@ TRTL_SW = $(TRTL)/software
EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=0x0
EXTRA_CFLAGS += -DRT_APPLICATION_ID=0x0
MOCKTURTLE_LIBRARY_PRINT_ENABLE := 1
include $(TRTL_SW)/rt/Makefile
......@@ -10,8 +10,19 @@
#
# Mock Turtle configuration
#
#
# Mock Turtle framework configuration
#
CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE=y
# CONFIG_MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE is not set
# CONFIG_MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE is not set
# CONFIG_MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE is not set
CONFIG_MOCKTURTLE_FRAMEWORK_32BIT_ALIGN=y
#
# Mock Turtle library configuration
#
CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE=y
# CONFIG_MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE is not set
# CONFIG_MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE is not set
......@@ -10,7 +10,4 @@ EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=0x0
EXTRA_CFLAGS += -DRT_APPLICATION_ID=0x0
MOCKTURTLE_LIBRARY_PRINT_ENABLE := 1
MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE := 1
include $(TRTL_SW)/rt/Makefile
......@@ -10,4 +10,15 @@
#
# Mock Turtle configuration
#
#
# Mock Turtle framework configuration
#
# CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE is not set
#
# Mock Turtle library configuration
#
CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE=y
CONFIG_MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE=y
# CONFIG_MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE is not set
......@@ -9,8 +9,4 @@ CFLAGS_OPT = -O0
EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=0x0
EXTRA_CFLAGS += -DRT_APPLICATION_ID=0x0
MOCKTURTLE_LIBRARY_PRINT_ENABLE := 1
MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE := 1
include $(TRTL_SW)/rt/Makefile
......@@ -10,4 +10,15 @@
#
# Mock Turtle configuration
#
#
# Mock Turtle framework configuration
#
# CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE is not set
#
# Mock Turtle library configuration
#
CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE=y
CONFIG_MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE=y
# CONFIG_MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE is not set
......@@ -9,8 +9,4 @@ CFLAGS_OPT = -O0
EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=0x0
EXTRA_CFLAGS += -DRT_APPLICATION_ID=0x0
MOCKTURTLE_LIBRARY_PRINT_ENABLE := 1
MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE := 1
include $(TRTL_SW)/rt/Makefile
......@@ -10,4 +10,15 @@
#
# Mock Turtle configuration
#
#
# Mock Turtle framework configuration
#
# CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE is not set
#
# Mock Turtle library configuration
#
CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE=y
CONFIG_MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE=y
# CONFIG_MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE is not set
comment "Mock Turtle configuration"
comment "Mock Turtle framework configuration"
config MOCKTURTLE_FRAMEWORK_ENABLE
bool "Enable Mock Turtle framework"
default y
......@@ -33,3 +34,25 @@ config MOCKTURTLE_FRAMEWORK_32BIT_ALIGN
default y
help
Help text
comment "Mock Turtle library configuration"
config MOCKTURTLE_LIBRARY_PRINT_ENABLE
bool "Enable print in Mock Turtle library"
default y
help
Help text
config MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE
bool "Enable print debug in Mock Turtle library"
depends on MOCKTURTLE_LIBRARY_PRINT_ENABLE
default n
help
Help text
config MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE
bool "Enable print error in Mock Turtle library"
depends on MOCKTURTLE_LIBRARY_PRINT_ENABLE
default n
help
Help text
......@@ -51,15 +51,6 @@ CFLAGS += -I$(TRTL)/software/rt/lib
CFLAGS += -I$(TRTL)/software/rt/framework
CFLAGS += -I$(TRTL)/software/include
CFLAGS += -DGIT_VERSION=$(RT_GIT_VERSION)
ifeq ($(MOCKTURTLE_LIBRARY_PRINT_ENABLE), 1)
CFLAGS += -DLIB_PRINTF
ifeq ($(MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE), 1)
CFLAGS += -DLIB_PRINT_DEBUG
endif
ifeq ($(MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE), 1)
CFLAGS += -DLIB_PRINT_ERROR
endif
endif
CFLAGS += $(EXTRA_CFLAGS)
......
......@@ -34,7 +34,7 @@
* @param[in] ... argument according to the string format
* @return number of printed characters
*/
#ifdef LIB_PRINTF
#ifdef CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE
extern int pp_printf(const char *fmt, ...)
__attribute__((format(printf,1,2)));
#else
......@@ -52,7 +52,7 @@ static inline int pp_printf(const char *fmt, ...)
* @param[in] ... argument according to the string format
* @return number of printed characters
*/
#ifdef LIB_PRINTF
#ifdef CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE
extern int pp_sprintf(char *s, const char *fmt, ...)
__attribute__((format(printf,2,3)));
#else
......@@ -70,7 +70,7 @@ static inline int pp_sprintf(char *s, const char *fmt, ...)
* @param[in] args list of arguments according to the string format
* @return number of printed characters
*/
#ifdef LIB_PRINTF
#ifdef CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE
extern int pp_vprintf(const char *fmt, va_list args);
#else
static inline int pp_vprintf(const char *fmt, va_list args)
......@@ -87,7 +87,7 @@ static inline int pp_vprintf(const char *fmt, va_list args)
* @param[in] args list of arguments according to the string format
* @return number of printed characters
*/
#ifdef LIB_PRINTF
#ifdef CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE
extern int pp_vsprintf(char *buf, const char *, va_list args)
__attribute__ ((format (printf, 2, 0)));
#else
......@@ -102,16 +102,14 @@ static inline int pp_vsprintf(char *buf, const char *fmt, va_list args)
* It prints a string on the serial interface only when the support
* for error messages is enable.
*
* Standard Makefile -> MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE
*
* C Preprocessor ->LIB_PRINT_DEBUG
* Kconfig ->CONFIG_MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE
*
* Internally, it uses the puts() function.
* @param[in] fmt string format
* @param[in] ... argument according to the string format
* @return number of printed characters
*/
#if defined(LIB_PRINTF) && defined(LIB_PRINT_DEBUG)
#if defined(CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE) && defined(CONFIG_MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE)
extern int pr_debug(const char *fmt, ...)
__attribute__((format(printf,1,2)));
#else
......@@ -125,16 +123,14 @@ static inline int pr_debug(const char *fmt, ...)
* It prints a string on the serial interface only when the support
* for error messages is enable.
*
* Standard Makefile -> MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE
*
* C Preprocessor -> LIB_PRINT_ERROR
* Kconfig -> CONFIG_MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE
*
* Internally, it uses the puts() function.
* @param[in] fmt string format
* @param[in] ... argument according to the string format
* @return number of printed characters
*/
#if defined(LIB_PRINTF) && defined(LIB_PRINT_ERROR)
#if defined(CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE) && defined(CONFIG_MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE)
extern int pr_error(const char *fmt, ...)
__attribute__((format(printf,1,2)));
#else
......
......@@ -8,7 +8,7 @@
/**
* Include this code only if explicitly asked to
*/
#ifdef LIB_PRINTF
#ifdef CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE
#include <stdarg.h>
#include <mockturtle-rt-common.h>
......@@ -50,7 +50,7 @@ int pp_printf(const char *fmt, ...)
return ret;
}
#ifdef LIB_PRINT_ERROR
#ifdef CONFIG_MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE
int pr_error(const char *fmt, ...)
{
va_list args;
......@@ -66,7 +66,7 @@ int pr_error(const char *fmt, ...)
}
#endif
#ifdef LIB_PRINT_DEBUG
#ifdef CONFIG_MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE
int pr_debug(const char *fmt, ...)
{
va_list args;
......
......@@ -8,7 +8,7 @@
/**
* Include this code only if explicitly asked to
*/
#ifdef LIB_PRINTF
#ifdef CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE
#include <stdarg.h>
#include <stdint.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment