block_aml_dbg.h
来自「AMLOGIC DPF source code」· C头文件 代码 · 共 992 行 · 第 1/3 页
H
992 行
//$6 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#ifdef _DEBUG_BLOCK
unsigned char pre_src_chk_state = 0;
unsigned char pre_read_sequence;
unsigned char src_chk_cmd_name[][20] =
{
"",
"CMD_SEARCH ",
"CMD_STOPREAD ",
"CMD_NOCHK_RD ",
"CMD_SCH_FAIL ",
"CMD_CHK_FAIL ",
"CMD_INIT ",
"CMD_RANDOMREAD",
"CMD_REGULAREAD",
};
unsigned char src_chk_state_name[][20] =
{
"SC_STOP ",
"SC_CHECK ",
"SC_NOCHK_RD ",
"SC_DOOR_OPENED ",
"SC_BETTER_SEARCH",
"SC_WAITBUFFER ",
};
unsigned test_force_send = 0;
unsigned trackbuffer_total_value;
unsigned char print_cdtype23_sector_info;
#define BLOCK_PRINTF_BUF_SIZE 40000
char Block_printf_buf[BLOCK_PRINTF_BUF_SIZE];
#define BLOCK_DELAY_PRINTF_BUF_SIZE 10000
char Block_Delay_printf_buf[BLOCK_DELAY_PRINTF_BUF_SIZE];
unsigned Block_Delay_printf_pos = 0;
unsigned Block_printf_pos = 0;
unsigned char block_printf_end[] = "@\n@\n@\n@\n@\n@\n@\n\n";
// =====================================================================================================================
// =======================================================================================================================
void Reset_Block_Printf_Pos(void)
{
memset(&Block_printf_buf[Block_printf_pos], 0, BLOCK_PRINTF_BUF_SIZE - Block_printf_pos);
Block_printf_pos = 0;
}
// =====================================================================================================================
// =======================================================================================================================
void Reset_Block_Printf(void)
{
Block_printf_pos = 0;
memset(&Block_printf_buf[0], 0, BLOCK_PRINTF_BUF_SIZE);
}
extern unsigned short dbg_each_pos[];
void DbgConsoleDisplay(int ii, char *disp_content);
// =====================================================================================================================
// =======================================================================================================================
void Display_Block_Printf_Content_InScreen(void)
{
//~~~~~~~
#if (!(defined AVOS))
int ii = 0;
int i;
//~~~~~~~
for (i = Block_printf_pos; i < BLOCK_PRINTF_BUF_SIZE; i++)
{
if ((Block_printf_buf[i] == '\n') && ((i + 0x18) < BLOCK_PRINTF_BUF_SIZE))
{
if ((Block_printf_buf[i + 1] != '@') && (Block_printf_buf[i + 1] != '\n') && (Block_printf_buf[i + 1] != 0))
{
dbg_each_pos[ii++] = i + 1;
}
}
}
for (i = 0; i < Block_printf_pos; i++)
{
if (i == 0)
{
dbg_each_pos[ii++] = i;
}
else if ((Block_printf_buf[i] == '\n') && ((i + 8) < Block_printf_pos))
{
if ((Block_printf_buf[i + 1] != '@') && (Block_printf_buf[i + 1] != '\n') && (Block_printf_buf[i + 1] != 0))
{
dbg_each_pos[ii++] = i + 1;
}
}
}
if (Block_printf_pos)
{
dbg_each_pos[ii] = Block_printf_pos;
}
else
{
dbg_each_pos[ii] = BLOCK_PRINTF_BUF_SIZE;
}
DbgConsoleDisplay(ii, Block_printf_buf);
#endif
}
// =====================================================================================================================
// =======================================================================================================================
void Display_Block_Printf_Content(void)
{
#ifdef MINIOS
// if(!in_irq)
CLI
#endif
if (Block_Print_Flag & 0x80000000)
{
Block_Print_Flag &= 0x7fffffff;
#if (!(defined __ROM_))
gprintf("%s\n", Block_printf_buf);
Reset_Block_Printf();
#else
Display_Block_Printf_Content_InScreen();
#endif
}
#ifdef MINIOS
// if(!in_irq)
STI
#endif
}
// =====================================================================================================================
// =======================================================================================================================
int Block_printf_none(const char *fmt, ...)
{
return 0;
}
// =====================================================================================================================
// =======================================================================================================================
int Block_printf(const char *fmt, ...)
{
//~~~~~~~~~~~~~~~~~~~~~~~~~
#if (defined AVOS)
OS_CPU_SR cpu_sr;
#endif
va_list args;
int printed_len;
char printf_buf[1024];
//~~~~~~~~~~~~~~~~~~~~~~~~~
va_start(args, fmt);
printed_len = vsprintf(printf_buf, fmt, args);
#if (defined AVOS)
OS_ENTER_CRITICAL();
#else
_ASM("FLAG 0");
#endif
#if (!(defined __ROM_))
if (Block_Print_Flag & 0x40000000)
{
gprintf("%s", printf_buf);
}
else
#endif
{
if ((Block_printf_pos + printed_len + 0x18) > BLOCK_PRINTF_BUF_SIZE)
{
Reset_Block_Printf_Pos();
}
memcpy(Block_printf_buf + Block_printf_pos, printf_buf, printed_len);
Block_printf_pos += printed_len;
memcpy(Block_printf_buf + Block_printf_pos, block_printf_end, 0x10);
}
#if (defined AVOS)
OS_EXIT_CRITICAL();
#else
_ASM("FLAG 6");
#endif
va_end(args);
return 0;
}
// =====================================================================================================================
// =======================================================================================================================
int Block_printf_irq(const char *fmt, ...)
{
//~~~~~~~~~~~~~~~~~~~~~
va_list args;
int printed_len;
char printf_buf[1024];
//~~~~~~~~~~~~~~~~~~~~~
va_start(args, fmt);
printed_len = vsprintf(printf_buf, fmt, args);
#if (!(defined __ROM_))
if (Block_Print_Flag & 0x40000000)
{
gprintf("%s", printf_buf);
}
else
#endif
{
if ((Block_printf_pos + printed_len + 0x18) > BLOCK_PRINTF_BUF_SIZE)
{
Reset_Block_Printf_Pos();
}
memcpy(Block_printf_buf + Block_printf_pos, printf_buf, printed_len);
Block_printf_pos += printed_len;
memcpy(Block_printf_buf + Block_printf_pos, block_printf_end, 0x10);
}
va_end(args);
return 0;
}
// =====================================================================================================================
// =======================================================================================================================
void Reset_Block_Delay_Printf_Pos(void)
{
Block_Delay_printf_pos = 0;
memset(&Block_Delay_printf_buf[0], 0, BLOCK_DELAY_PRINTF_BUF_SIZE);
}
// =====================================================================================================================
// =======================================================================================================================
int Block_Delay_printf(const char *fmt, ...)
{
//~~~~~~~~~~~~~~~~
va_list args;
int printed_len;
//~~~~~~~~~~~~~~~~
va_start(args, fmt);
printed_len = vsprintf(Block_Delay_printf_buf + Block_Delay_printf_pos, fmt, args);
Block_Delay_printf_pos += printed_len;
if ((Block_Delay_printf_pos + 100) > BLOCK_DELAY_PRINTF_BUF_SIZE)
{
Block_Delay_printf_pos = 0;
memset(&Block_Delay_printf_buf[0], 0, BLOCK_DELAY_PRINTF_BUF_SIZE);
}
va_end(args);
return 0;
}
// =====================================================================================================================
// =======================================================================================================================
void Block_Printf_Delay_Content(void)
{
//~~~~~~~~~~~~~~~~~~~~
// Block_printf("%s",Block_Delay_printf_buf);
int printed_len;
#if (defined AVOS)
OS_CPU_SR cpu_sr;
#endif
//~~~~~~~~~~~~~~~~~~~~
#if (defined AVOS)
OS_ENTER_CRITICAL();
#else
_ASM("FLAG 0");
#endif
printed_len = strlen(Block_Delay_printf_buf);
#if (!(defined __ROM_))
if (Block_Print_Flag & 0x40000000)
{
gprintf("%s", Block_Delay_printf_buf);
}
else
#endif
{
if ((Block_printf_pos + printed_len + 0x18) > BLOCK_PRINTF_BUF_SIZE)
{
Reset_Block_Printf_Pos();
}
memcpy(Block_printf_buf + Block_printf_pos, Block_Delay_printf_buf, printed_len);
Block_printf_pos += printed_len;
memcpy(Block_printf_buf + Block_printf_pos, block_printf_end, 0x10);
}
Block_Delay_printf_pos = 0;
memset(&Block_Delay_printf_buf[0], 0, BLOCK_DELAY_PRINTF_BUF_SIZE);
#if (defined AVOS)
OS_EXIT_CRITICAL();
#else
_ASM("FLAG 6");
#endif
}
// =====================================================================================================================
// =======================================================================================================================
void Block_printf_buf_state(THOM_BUF_HDR *tbuf, THOM_BUF_HDR *nbuf, unsigned hoffset)
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~
int i;
unsigned p_adr1;
unsigned char is_sector_error;
unsigned char is_adr_error;
_VO unsigned char *sector_ptr;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for (i = 0, sector_ptr = tbuf->data; i < DMA_UNIT; i++, sector_ptr += SUNIT)
{
is_sector_error = Block_Iserror((unsigned) sector_ptr);
if (Block.disktype == DISCTYPE_DVD)
{
p_adr1 = BLOCK_ADR(sector_ptr, hoffset);
is_adr_error = Block_Isadrerror((unsigned) sector_ptr, hoffset);
}
else
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
unsigned char tempqsubcode[14];
unsigned short ls0s1_offset = gs0s1_offset;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?