63 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			63 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
/****************************************************************************
 | 
						|
 | 
						|
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
 | 
						|
 | 
						|
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
 | 
						|
be copied by any method or incorporated into another program without
 | 
						|
the express written consent of Aerospace C.Power. This Information or any portion
 | 
						|
thereof remains the property of Aerospace C.Power. The Information contained herein
 | 
						|
is believed to be accurate and Aerospace C.Power assumes no responsibility or
 | 
						|
liability for its use in any way and conveys no license or title under
 | 
						|
any patent or copyright and makes no representation or warranty that this
 | 
						|
Information is free from patent or copyright infringement.
 | 
						|
 | 
						|
****************************************************************************/
 | 
						|
 | 
						|
#ifndef __DBG_MSG_H__
 | 
						|
#define __DBG_MSG_H__
 | 
						|
 | 
						|
/* os shim includes */
 | 
						|
#include "os_types.h"
 | 
						|
 | 
						|
#ifdef __cplusplus
 | 
						|
extern "C" {
 | 
						|
#endif
 | 
						|
 | 
						|
/* define the size of a msg. struct dbg_msg_t  64 = 4 + 2 + 58 */
 | 
						|
#define DBG_MSG_SIZE                     58
 | 
						|
/* define RESV num for exception msg */
 | 
						|
#define DBG_MSG_EPT_RESV_NUM             50
 | 
						|
 | 
						|
/* used for debug bb cpu */
 | 
						|
#define DBG_BB_CPU                       0
 | 
						|
/* used for debug sec cpu */
 | 
						|
#define DBG_SEC_CPU                      1
 | 
						|
/* cpu count */
 | 
						|
#define DBG_CPU_CNT                      2
 | 
						|
 | 
						|
typedef struct _dbg_msg {
 | 
						|
    /* record dbg msg timestamp, unit us */
 | 
						|
    uint32_t ts;
 | 
						|
    /* record idx */
 | 
						|
    uint16_t idx;
 | 
						|
    /* debug msg */
 | 
						|
    char msg_buf[DBG_MSG_SIZE];
 | 
						|
} dbg_msg_t;
 | 
						|
 | 
						|
typedef struct _dbg_msg_idx_info {
 | 
						|
    /* buffer count */
 | 
						|
    uint32_t size;
 | 
						|
    /* read index */
 | 
						|
    uint32_t read_idx;
 | 
						|
    /* write index */
 | 
						|
    uint32_t write_idx;
 | 
						|
    /* debug message buffer list */
 | 
						|
    dbg_msg_t list[0];
 | 
						|
} dbg_msg_info_t;
 | 
						|
 | 
						|
#ifdef __cplusplus
 | 
						|
}
 | 
						|
#endif
 | 
						|
 | 
						|
#endif /* __DBG_MSG_H__ */
 |