blob: 79a8446658ee3bc193e110e8a0c7ae956d70d696 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#ifndef __DEBUG_PUBLIC_H_INCLUDED__
#define __DEBUG_PUBLIC_H_INCLUDED__
#include <type_support.h>
#include "system_types.h"
/*! brief
*
* Simple queuing trace buffer for debug data
* instantiatable in SP DMEM
*
* The buffer has a remote and and a local store
* which contain duplicate data (when in sync).
* The buffers are automatically synched when the
* user dequeues, or manualy using the synch function
*
* An alternative (storage efficient) implementation
* could manage the buffers to contain unique data
*
* The buffer empty status is computed from local
* state which does not reflect the presence of data
* in the remote buffer (unless the alternative
* implementation is followed)
*/
typedef struct debug_data_s debug_data_t;
typedef struct debug_data_ddr_s debug_data_ddr_t;
extern debug_data_t *debug_data_ptr;
extern hrt_address debug_buffer_address;
extern hrt_vaddress debug_buffer_ddr_address;
/*! Check the empty state of the local debug data buffer
\return isEmpty(buffer)
*/
STORAGE_CLASS_DEBUG_H bool is_debug_buffer_empty(void);
/*! Dequeue a token from the debug data buffer
\return isEmpty(buffer)?0:buffer[head]
*/
STORAGE_CLASS_DEBUG_H hrt_data debug_dequeue(void);
/*! Synchronise the remote buffer to the local buffer
\return none
*/
STORAGE_CLASS_DEBUG_H void debug_synch_queue(void);
/*! Synchronise the remote buffer to the local buffer
\return none
*/
STORAGE_CLASS_DEBUG_H void debug_synch_queue_isp(void);
/*! Synchronise the remote buffer to the local buffer
\return none
*/
STORAGE_CLASS_DEBUG_H void debug_synch_queue_ddr(void);
/*! Set the offset/address of the (remote) debug buffer
\return none
*/
void debug_buffer_init(
const hrt_address addr);
/*! Set the offset/address of the (remote) debug buffer
\return none
*/
void debug_buffer_ddr_init(
const hrt_vaddress addr);
/*! Set the (remote) operating mode of the debug buffer
\return none
*/
void debug_buffer_setmode(
const debug_buf_mode_t mode);
#endif /* __DEBUG_PUBLIC_H_INCLUDED__ */
|