Niranjan Yadla | 19336af | 2018-04-19 12:19:27 -0700 | [diff] [blame^] | 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 | /******************************************************************************* |
| 24 | * xf-debug.h |
| 25 | * |
| 26 | * Debugging interface for Xtensa Audio DSP codec server |
| 27 | * |
| 28 | *******************************************************************************/ |
| 29 | |
| 30 | #ifndef __XF_H |
| 31 | #error "xf-debug.h mustn't be included directly" |
| 32 | #endif |
| 33 | |
| 34 | /******************************************************************************* |
| 35 | * Types definitions |
| 36 | ******************************************************************************/ |
| 37 | |
| 38 | #if XF_TRACE |
| 39 | |
| 40 | /* ...trace data definition */ |
| 41 | typedef struct xf_trace_data |
| 42 | { |
| 43 | /* ...current write position in tracing buffer */ |
| 44 | char *p; |
| 45 | |
| 46 | /* ...threshold position for buffer submission */ |
| 47 | char *end; |
| 48 | |
| 49 | #if XF_TRACE_REMOTE |
| 50 | /* ...beginning of non-commited internal tracing buffer */ |
| 51 | char *start; |
| 52 | |
| 53 | /* ...message queue */ |
| 54 | xf_msg_queue_t queue; |
| 55 | #endif |
| 56 | |
| 57 | } xf_trace_data_t; |
| 58 | |
| 59 | #else |
| 60 | |
| 61 | /* ...stub for disabled tracing */ |
| 62 | typedef u32 xf_trace_data_t[0]; |
| 63 | |
| 64 | #endif /* XF_TRACE */ |
| 65 | |
| 66 | /******************************************************************************* |
| 67 | * Internal API functions |
| 68 | ******************************************************************************/ |
| 69 | |
| 70 | #if XF_TRACE_REMOTE |
| 71 | /* ...submit buffer for tracing */ |
| 72 | extern void xf_trace_submit(u32 core, xf_message_t *m); |
| 73 | |
| 74 | /* ...flush current buffer */ |
| 75 | extern void xf_trace_flush(u32 core, xf_message_t *m); |
| 76 | |
| 77 | #else |
| 78 | |
| 79 | #define xf_trace_submit(core, m) (void)0 |
| 80 | #define xf_trace_flush(core, m) (void)0 |
| 81 | |
| 82 | #endif /* XF_TRACE_REMOTE */ |