2 * Support for Intel Camera Imaging ISP subsystem.
3 * Copyright (c) 2015, Intel Corporation.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 #ifndef __DEBUG_PUBLIC_H_INCLUDED__
16 #define __DEBUG_PUBLIC_H_INCLUDED__
18 #include <type_support.h>
19 #include "system_types.h"
23 * Simple queuing trace buffer for debug data
24 * instantiatable in SP DMEM
26 * The buffer has a remote and and a local store
27 * which contain duplicate data (when in sync).
28 * The buffers are automatically synched when the
29 * user dequeues, or manualy using the synch function
31 * An alternative (storage efficient) implementation
32 * could manage the buffers to contain unique data
34 * The buffer empty status is computed from local
35 * state which does not reflect the presence of data
36 * in the remote buffer (unless the alternative
37 * implementation is followed)
40 typedef struct debug_data_s debug_data_t
;
41 typedef struct debug_data_ddr_s debug_data_ddr_t
;
43 extern debug_data_t
*debug_data_ptr
;
44 extern hrt_address debug_buffer_address
;
45 extern hrt_vaddress debug_buffer_ddr_address
;
47 /*! Check the empty state of the local debug data buffer
49 \return isEmpty(buffer)
51 STORAGE_CLASS_DEBUG_H
bool is_debug_buffer_empty(void);
53 /*! Dequeue a token from the debug data buffer
55 \return isEmpty(buffer)?0:buffer[head]
57 STORAGE_CLASS_DEBUG_H hrt_data
debug_dequeue(void);
59 /*! Synchronise the remote buffer to the local buffer
63 STORAGE_CLASS_DEBUG_H
void debug_synch_queue(void);
65 /*! Synchronise the remote buffer to the local buffer
69 STORAGE_CLASS_DEBUG_H
void debug_synch_queue_isp(void);
72 /*! Synchronise the remote buffer to the local buffer
76 STORAGE_CLASS_DEBUG_H
void debug_synch_queue_ddr(void);
78 /*! Set the offset/address of the (remote) debug buffer
82 extern void debug_buffer_init(
83 const hrt_address addr
);
85 /*! Set the offset/address of the (remote) debug buffer
89 extern void debug_buffer_ddr_init(
90 const hrt_vaddress addr
);
92 /*! Set the (remote) operating mode of the debug buffer
96 extern void debug_buffer_setmode(
97 const debug_buf_mode_t mode
);
99 #endif /* __DEBUG_PUBLIC_H_INCLUDED__ */