• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*******************************************************************************
2 * Copyright (C) 2018 Cadence Design Systems, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files (the
6 * "Software"), to use this Software with Cadence processor cores only and
7 * not with any other processors and platforms, subject to
8 * the following conditions:
9 *
10 * The above copyright notice and this permission notice shall be included
11 * in all copies or substantial portions of the Software.
12 *
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
17 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
18 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 
21 ******************************************************************************/
22 
23 #ifndef __DSP_DEBUG_H__
24 #define __DSP_DEBUG_H__
25 
26 
27 #define DEBUG_LEVEL   0
28 #define INFO_LEVEL    1
29 #define WARNING_LEVEL 1
30 #define ERROR_LEVEL   1
31 #define TRACE_DUMP    1
32 
33 #define LOG_TAG " DSP_LOG"
34 
35 #if TRACE_DUMP
36 #define DSP_TRACE(fmt, ...) print_log(fmt" @%s:%d \n", ##__VA_ARGS__, __FUNCTION__, __LINE__)
37 #else
38 #define DSP_TRACE(fmt, ...)
39 #endif
40 
41 #if DEBUG_LEVEL
42 #define DSP_LOGD(fmt, ...) print_log(LOG_TAG"[D]%s:%d: "fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__)
43 #else
44 #define DSP_LOGD(fmt, ...)
45 #endif
46 
47 #if INFO_LEVEL
48 #define DSP_LOGI(fmt, ...) print_log(LOG_TAG"[I]%s:%d: "fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__)
49 #else
50 #define DSP_LOGI(fmt, ...)
51 #endif
52 
53 #if WARNING_LEVEL
54 #define DSP_LOGW(fmt, ...) print_log(LOG_TAG"[W]%s:%d: "fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__)
55 #else
56 #define DSP_LOGW(fmt, ...)
57 #endif
58 
59 #if ERROR_LEVEL
60 #define DSP_LOGE(fmt, ...) print_log(LOG_TAG"[E]%s:%d: "fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__)
61 #else
62 +#define DSP_LOGE(fmt, ...)
63 #endif
64 
65 
66 void print_log(const char *fmt, ...);
67 void dsp_debug_init();
68 #ifdef HIKEY_XAF_IPC_COMMENT_OUT
69 void dsp_om_func_proc(char *om_str, unsigned int str_len);
70 #endif
71 #endif
72