extend.h

来自「AMLOGIC DPF source code」· C头文件 代码 · 共 151 行

H
151
字号
/*******************************************************************
 * 
 *  Copyright C 2005 by Amlogic, Inc. All Rights Reserved.
 *
 *  Description: 
 *
 *  Author: AVOS Team
 *  Created: 2005
 *
 *******************************************************************/

#ifndef EXTEND_H
#define EXTEND_H

/* OS extension */
void OS_TimerInit();

/* Memory management service */
#include "memmap.h"
#include "AVmalloc.h"

extern _phymem_node_t *Am_GetSystemMem(unsigned map_index, unsigned mem_type);
extern void avmalloc_trace_dump(char *block_ptr);

/* System event service */
#include "AVSysEvent.h"
#include "AVSysEventId.h"
#include "AVTimer.h"
#include "AVResource.h"

/* AVOS Debug Helper */
#define AVOS_PRINT_FLAG_NONE		0x00000000
#define AVOS_PRINT_FLAG_TIME		0x00000001
#define AVOS_PRINT_FLAG_NL			0x00000002

#define AVOS_printf(arg...)			__AVOS_printf(AVOS_PRINT_FLAG_NONE, arg)
#define AVOS_printf_ext(arg...)		__AVOS_printf(AVOS_PRINT_FLAG_TIME, arg)
#define AVOS_printf_ext_nl(arg...)	__AVOS_printf((AVOS_PRINT_FLAG_TIME | AVOS_PRINT_FLAG_NL), arg)

/** 
 *  AVOS log macro.
 *  
 *  @param[in] area Debug area (not defined yet).
 *  @param[in] level Debug log level (AVOS_Print_Flag bit mask).
 *  @param[in] msg A short message to prefix the logged message.
 *  @param[in] args Variable length log message string.
 */
#if OS_TASK_DEBUGHELPER_EN>0
#define AVOS_LOG(area, level, msg, args...) \
    do { \
        if (AVOS_Print_Flag & level) \
            AVOS_printf_ext(msg args); \
    } while (0)
#else
#define AVOS_LOG(area, level, msg, args...) 
#endif

extern int __AVOS_printf(INT32U flag, const char* fmt, ...);

extern char * AVDebugAWGetMsgidName(INT16U msg_id);
extern char * AVDebugAWGetMsgtypeName(INT8U msg_type);
extern void AVDebugHelperInit();
extern void AVDebugHelperShell();
extern void AVDebugAWInit();
extern void AVDebugHelperCpuEnable(INT8U cpu_type);

#if OS_TASK_DEBUGHELPER_EN>0
extern void AVDebugLogMalloc(unsigned adr, size_t size);
extern void AVDebugLogFree(unsigned adr);
#else
#define AVDebugLogMalloc(adr, size)
#define AVDebugLogFree(adr)
#endif

extern unsigned AVOS_Print_Flag;
extern unsigned AVOS_Check_Flag;

#define DBGHLP_LOG_APPCMD               0x00000001
#define DBGHLP_LOG_APPCMD_MORE          0x00000002
#define DBGHLP_LOG_WINMSG               0x00000004
#define DBGHLP_LOG_WINMSG_MORE          0x00000008

#define DBGHLP_LOG_OSEVENT              0x00000010
#define DBGHLP_LOG_DATAPATH             0x00000020
#define DBGHLP_PRINT_MALLOC             0x00000040
#define DBGHLP_LOG_AVSYNC               0x00000080

#define DBGHLP_LOG_APPTASK              0x00000100
#define DBGHLP_PRINT_DEMUX              0x00000200
#define DBGHLP_LOG_FILENAV              0x00000400

#define DBGHLP_LOG_FILEOP               0x00001000
#define DBGHLP_LOG_FILEOP_MORE          0x00002000
#define DBGHLP_LOG_FAT                  0x00004000
#define DBGHLP_LOG_FAT_MORE             0x00008000

#define DBGHLP_PRINT_USB                0x00100000
#define DBGHLP_LOG_NET                  0x00200000
#define DBGHLP_LOG_NETFS                0x00400000
#define DBGHLP_LOG_NETFS_MORE           0x00800000

#define DBGHLP_LOG_MUTEX                0x01000000
#define DBGHLP_LOG_SEM                  0x02000000
#define DBGHLP_LOG_WIFI_WPA             0x04000000

#define DBGHLP_DUMP_ENABLE              0x20000000
#define DBGHLP_PRINT_ENABLE             0x40000000

#define DBGHLP_GETINFO_AVLEVEL          1
extern unsigned AVDebugHelperGetHardwareInfo(unsigned char type);

#define FILE_TRACE_BUF_LEN              0x10
extern char file_trace_buffer[FILE_TRACE_BUF_LEN];

extern unsigned char AVDebugInRange(void* p, unsigned char ignore0, unsigned loopforever,char* file, unsigned line);
extern void AVDebugHelperSetZeroAdrCheck(unsigned char check_zero_adr_);
extern int (*os_sw_check_cb_t)(void* arg);
extern int (*os_irq_check_cb_t)(void* arg);

extern int (*os_sw_check_user)(void* arg);
extern int (*os_irq_check_user)(void* arg);
extern int (*os_prolog_epilog_check_user)(void* arg);

#define KERN_EMERG      "<0> KERN_EMERG "	/* system is unusable                   */
#define KERN_ALERT      "<1> KERN_ALERT "	/* action must be taken immediately     */
#define KERN_CRIT       "<2> KERN_CRIT "	/* critical conditions                  */
#define KERN_ERR        "<3> KERN_ERR "		/* error conditions                     */
#define KERN_WARNING    "<4> KERN_WARNING "	/* warning conditions                   */
#define KERN_NOTICE     "<5> KERN_NOTICE "	/* normal but significant condition     */
#define KERN_INFO       "<6> KERN_INFO "	/* informational                        */
#define KERN_DEBUG      "<7> KERN_DEBUG "	/* debug-level messages                 */

#define AVOS_CHECK_ZERO_ADR           0x00000001
#define AVOS_CHECK_ZERO_ADR_IRQ       0x00000002
                    /* zero adr check when function return: CFLAGS += -Hon=Epilog_trace -Hon=Prolog_trace, and set this bit */
#define AVOS_CHECK_ZERO_ADR_EPILOG    0x00000800
/* these bits can not be changed after running code */
#define AVOS_CHECK_MALLOC_HISTORY     0x00000004
#define AVOS_CHECK_OPEN               0x00000008  
#define AVOS_CHECK_PBUF               0x00000010 
/**/
/* these bits can not be changed after running code */
#define AVOS_CHECK_MALLOC             0x00000100
#define AVOS_CHECK_MALLOC_MORE        0x00000200
/**/
/* this bit is valid only when AVOS_CHECK_MALLOC or AVOS_CHECK_MALLOC_MORE is set*/
#define AVOS_CHECK_MALLOC_WHEN_TASK_SW     0x00000400


#endif /* EXTEND_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?