1/* 2 * Support for Intel Camera Imaging ISP subsystem. 3 * Copyright (c) 2015, Intel Corporation. 4 * 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. 8 * 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 12 * more details. 13 */ 14 15#ifndef __DEBUG_PUBLIC_H_INCLUDED__ 16#define __DEBUG_PUBLIC_H_INCLUDED__ 17 18#include <type_support.h> 19#include "system_types.h" 20 21/*! brief 22 * 23 * Simple queuing trace buffer for debug data 24 * instantiatable in SP DMEM 25 * 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 30 * 31 * An alternative (storage efficient) implementation 32 * could manage the buffers to contain unique data 33 * 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) 38 */ 39 40typedef struct debug_data_s debug_data_t; 41typedef struct debug_data_ddr_s debug_data_ddr_t; 42 43extern debug_data_t *debug_data_ptr; 44extern hrt_address debug_buffer_address; 45extern hrt_vaddress debug_buffer_ddr_address; 46 47/*! Check the empty state of the local debug data buffer 48 49 \return isEmpty(buffer) 50 */ 51STORAGE_CLASS_DEBUG_H bool is_debug_buffer_empty(void); 52 53/*! Dequeue a token from the debug data buffer 54 55 \return isEmpty(buffer)?0:buffer[head] 56 */ 57STORAGE_CLASS_DEBUG_H hrt_data debug_dequeue(void); 58 59/*! Synchronise the remote buffer to the local buffer 60 61 \return none 62 */ 63STORAGE_CLASS_DEBUG_H void debug_synch_queue(void); 64 65/*! Synchronise the remote buffer to the local buffer 66 67 \return none 68 */ 69STORAGE_CLASS_DEBUG_H void debug_synch_queue_isp(void); 70 71 72/*! Synchronise the remote buffer to the local buffer 73 74 \return none 75 */ 76STORAGE_CLASS_DEBUG_H void debug_synch_queue_ddr(void); 77 78/*! Set the offset/address of the (remote) debug buffer 79 80 \return none 81 */ 82extern void debug_buffer_init( 83 const hrt_address addr); 84 85/*! Set the offset/address of the (remote) debug buffer 86 87 \return none 88 */ 89extern void debug_buffer_ddr_init( 90 const hrt_vaddress addr); 91 92/*! Set the (remote) operating mode of the debug buffer 93 94 \return none 95 */ 96extern void debug_buffer_setmode( 97 const debug_buf_mode_t mode); 98 99#endif /* __DEBUG_PUBLIC_H_INCLUDED__ */ 100