hv: clean up function definitions in logmsg.h

seperate the function definitions into debug/release directories
to better distinguish debug/release libraries

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Shiqing Gao 2018-11-27 14:16:46 +08:00 committed by lijinxia
parent 5b6c611a1d
commit 8920fbacaa
2 changed files with 23 additions and 32 deletions

View File

@ -31,9 +31,6 @@
extern uint16_t console_loglevel;
extern uint16_t mem_loglevel;
extern uint16_t npk_loglevel;
void init_logmsg(uint32_t flags);
void print_logmsg_buffer(uint16_t pcpu_id);
void do_logmsg(uint32_t severity, const char *fmt, ...);
void asm_assert(int32_t line, const char *file, const char *txt);
@ -44,6 +41,16 @@ void asm_assert(int32_t line, const char *file, const char *txt);
} \
} while (0)
#else /* HV_DEBUG */
#define ASSERT(x, ...) do { } while (0)
#endif /* HV_DEBUG */
void init_logmsg(uint32_t flags);
void print_logmsg_buffer(uint16_t pcpu_id);
void do_logmsg(uint32_t severity, const char *fmt, ...);
/** The well known printf() function.
*
* Formats a string and writes it to the console output.
@ -68,35 +75,6 @@ void printf(const char *fmt, ...);
void vprintf(const char *fmt, va_list args);
#else /* HV_DEBUG */
static inline void init_logmsg(__unused uint32_t flags)
{
}
static inline void do_logmsg(__unused uint32_t severity,
__unused const char *fmt, ...)
{
}
static inline void print_logmsg_buffer(__unused uint16_t pcpu_id)
{
}
#define ASSERT(x, ...) do { } while (0)
static inline void printf(__unused const char *fmt, ...)
{
}
static inline void vprintf(__unused const char *fmt, __unused va_list args)
{
}
#endif /* HV_DEBUG */
#ifndef pr_prefix
#define pr_prefix
#endif

View File

@ -0,0 +1,13 @@
/*
* Copyright (C) 2018 Intel Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <hypervisor.h>
void init_logmsg(__unused uint32_t flags) {}
void do_logmsg(__unused uint32_t severity, __unused const char *fmt, ...) {}
void print_logmsg_buffer(__unused uint16_t pcpu_id) {}
void printf(__unused const char *fmt, ...) {}
void vprintf(__unused const char *fmt, __unused va_list args) {}