mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-05-05 06:56:57 +00:00
Here is how the recursion might happen: when there is something wrong | sbuf_put -> memcpy_s -> pr_err -> do_logmsg | | ----------------------------------- Replace 'pr_err' with 'ASSERT' in 'memcpy_s' to break this kind of recursion. Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
22 lines
396 B
C
22 lines
396 B
C
/*
|
|
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef ASSERT_H
|
|
#define ASSERT_H
|
|
|
|
#ifdef HV_DEBUG
|
|
void __assert(uint32_t line, const char *file, const char *txt);
|
|
|
|
#define ASSERT(x, ...) \
|
|
if (!(x)) {\
|
|
__assert(__LINE__, __FILE__, "fatal error");\
|
|
}
|
|
#else
|
|
#define ASSERT(x, ...) do { } while(0)
|
|
#endif
|
|
|
|
#endif /* ASSERT_H */
|