From 9437150004d1bc83adf443f26e7c9d0bba58ede7 Mon Sep 17 00:00:00 2001 From: aoki_ryoma Date: Thu, 4 Sep 2008 06:30:38 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E3=81=AE=E3=83=95=E3=82=A9=E3=83=BC=E3=83=9E=E3=83=83=E3=83=88?= =?UTF-8?q?=E3=82=92=E5=A4=89=E6=9B=B4=E3=81=97=E3=81=A6=E3=83=A6=E3=83=BC?= =?UTF-8?q?=E3=82=B6=E9=A0=98=E5=9F=9F=E3=82=92213byte=E3=81=BE=E3=81=A7?= =?UTF-8?q?=E6=8B=A1=E5=BC=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2401 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- .../errorLog/ARM9/src/errorLog.c | 20 ++++++++++--------- build/tests/ErrorLogTest/ARM9/Makefile | 4 ++-- .../ErrorLogTest/ARM9/src/ErrorLogTest.c | 16 ++++++++++++--- include/sysmenu/errorLog.h | 2 +- 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/build/libraries_sysmenu/errorLog/ARM9/src/errorLog.c b/build/libraries_sysmenu/errorLog/ARM9/src/errorLog.c index 418ef173..094ea5f0 100644 --- a/build/libraries_sysmenu/errorLog/ARM9/src/errorLog.c +++ b/build/libraries_sysmenu/errorLog/ARM9/src/errorLog.c @@ -28,15 +28,14 @@ #define ERRORLOG_DIRECTORYPATH "nand:/sys/log" #define ERRORLOG_FILEPATH "nand:/sys/log/sysmenu.log" -#define ERRORLOG_BAR "====================" -#define ERRORLOG_BAR_LENGTH 20 -#define ERRORLOG_WRITE_FORMAT_RED1 ERRORLOG_BAR"\n#RED %02u-%02u-%02u[%3s] %02u:%02u:%02u\n" +#define ERRORLOG_HEADER_SIZE 6 +#define ERRORLOG_WRITE_FORMAT_RED1 "\n\n#RED %02u-%02u-%02u[%3s] %02u:%02u:%02u\n" #define ERRORLOG_WRITE_FORMAT_RED2 "title: %04s ErrorCode: %u\n%s" -#define ERRORLOG_WRITE_FORMAT1 ERRORLOG_BAR"\n#FFT %02u-%02u-%02u[%3s] %02u:%02u:%02u\n" +#define ERRORLOG_WRITE_FORMAT1 "\n\n#FFT %02u-%02u-%02u[%3s] %02u:%02u:%02u\n" #define ERRORLOG_WRITE_FORMAT2 "title: %04s\n%s" -#define ERRORLOG_READ_FORMAT_RED1 ERRORLOG_BAR"\n#RED %d-%d-%d[%3s] %d:%d:%d\n" +#define ERRORLOG_READ_FORMAT_RED1 "\n\n#RED %d-%d-%d[%3s] %d:%d:%d\n" #define ERRORLOG_READ_FORMAT_RED2 "title: %4s ErrorCode: %u\n%*s" -#define ERRORLOG_READ_FORMAT1 ERRORLOG_BAR"\n#FFT %d-%d-%d[%3s] %d:%d:%d\n" +#define ERRORLOG_READ_FORMAT1 "\n\n#FFT %d-%d-%d[%3s] %d:%d:%d\n" #define ERRORLOG_READ_FORMAT2 "title: %4s\n%s" #define ERRORLOG_WRITE_FORMAT ERRORLOG_WRITE_FORMAT1 ERRORLOG_WRITE_FORMAT2 @@ -46,7 +45,7 @@ #define ERRORLOG_NUM_ARGS 9 -#define ERRORLOG_STR_OFFSET 61 +#define ERRORLOG_STR_OFFSET 42 @@ -62,6 +61,7 @@ typedef enum CheckStatus { ErrorLogWork elWork; static BOOL isInitialized = FALSE; + /*-- function prototype ----------------------*/ CheckStatus ERRORLOGi_CheckAndCreateDirectory( const char *path ); CheckStatus ERRORLOGi_CheckAndCreateFile( const char *path ); @@ -568,7 +568,7 @@ int ERRORLOGi_ReadEntry( void ) int numArgs = 0; // 決められたファイルフォーマットからエントリに読み込む - if( ! STD_StrNCmp( "#RED", &buf[ERRORLOG_BAR_LENGTH + 1], 4 ) ) + if( ! STD_StrNCmp( "\n\n#RED", buf, ERRORLOG_HEADER_SIZE ) ) { // ランチャから書き込まれたエラーの場合 @@ -589,7 +589,7 @@ int ERRORLOGi_ReadEntry( void ) elWork.entry[numEntry].titleId = MI_LoadLE32( titlebuf ); } - else if( !STD_StrNCmp( "#FFT", &buf[ERRORLOG_BAR_LENGTH + 1], 4 ) ) + else if( !STD_StrNCmp( "\n\n#FFT", buf, ERRORLOG_HEADER_SIZE ) ) { // フリーフォーマットで書き込まれたエラーの場合 if( elWork.entry[numEntry].errorStr == NULL ) @@ -635,6 +635,7 @@ int ERRORLOGi_ReadEntry( void ) elWork.entry[numEntry].isBroken = TRUE; STD_CopyLStringZeroFill( elWork.entry[numEntry].errorStr, buf, ERRORLOG_BUFSIZE+1 ); + } numEntry++; @@ -664,6 +665,7 @@ BOOL ERRORLOGi_SetString( char *buf, ErrorLogEntry *entry ) if( entry->isBroken ) { STD_CopyLString( buf, entry->errorStr, ERRORLOG_BUFSIZE ); + buf[ ERRORLOG_BUFSIZE-1 ] = '\n'; return TRUE; } diff --git a/build/tests/ErrorLogTest/ARM9/Makefile b/build/tests/ErrorLogTest/ARM9/Makefile index 4144a38b..32b13e36 100644 --- a/build/tests/ErrorLogTest/ARM9/Makefile +++ b/build/tests/ErrorLogTest/ARM9/Makefile @@ -19,13 +19,13 @@ SUBDIRS = SUBMAKES = Makefile.0 Makefile.1 -include $(TWL_IPL_RED_ROOT)/build/tests/RelocateChecker/buildtools/commondefs +include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs #---------------------------------------------------------------------------- do-build : $(TARGETS) -include $(TWL_IPL_RED_ROOT)/build/tests/RelocateChecker/buildtools/modulerules +include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules #---------------------------------------------------------------------------- diff --git a/build/tests/ErrorLogTest/ARM9/src/ErrorLogTest.c b/build/tests/ErrorLogTest/ARM9/src/ErrorLogTest.c index ca525281..a3a23892 100644 --- a/build/tests/ErrorLogTest/ARM9/src/ErrorLogTest.c +++ b/build/tests/ErrorLogTest/ARM9/src/ErrorLogTest.c @@ -48,16 +48,26 @@ void TwlMain( void ) numEntry = ERRORLOG_GetNum(); OS_TPrintf("API: before numEntry : %d\n", numEntry ); - - ERRORLOG_Write( (u64)0x0200040051LL ); - ERRORLOG_Printf( "%d hyoooo nyoronyoro\naboooon dogaaaaaaaan", 2+5 ); + ERRORLOG_Write( 0x80000 ); ERRORLOG_Printf( "this is overflow message!\nthis is overflow message!\nthis is overflow message!\n" "this is overflow message!\nthis is overflow message!\nthis is overflow message!\n" "this is overflow message!\nthis is overflow message!\nthis is overflow message!\n" "this is overflow message!\nthis is overflow message!\nthis is overflow message!\n" "this is overflow message!\nthis is overflow message!\nthis is overflow message!\n" "this is overflow message!\nthis is overflow message!\nthis is overflow message!\n" ); + +/* + ERRORLOG_Write( (u64)0x77700040051LL ); + ERRORLOG_Printf( "%d hyoooo nyoronyoro\naboooon dogaaaaaaaan", 2+5 ); + + ERRORLOG_Printf( "menuRedIplManager.cpp [l.73] RED FATAL 0" ); + ERRORLOG_Printf( "this is too long long long long long long long long long long long long string.\n" + "this is too long long long long long long long long long long long long string.\n" + "this is too long long long long long long long long long long long long string.\n" + "this is too long long long long long long long long long long long long string.\n" ); + */ + /* if( numEntry > 2 ) { diff --git a/include/sysmenu/errorLog.h b/include/sysmenu/errorLog.h index 425fe1ec..52ec7437 100644 --- a/include/sysmenu/errorLog.h +++ b/include/sysmenu/errorLog.h @@ -30,7 +30,7 @@ extern "C" { // 日付データとかを除いた、自由フォーマットで書き込めるサイズ // このサイズを超えた文字列は切り捨てられます // ERRORLOG_STR_LENGTH = ERRORLOG_BUFSIZE - ERRORLOG_STR_OFFSET - 1 -#define ERRORLOG_STR_LENGTH 194 +#define ERRORLOG_STR_LENGTH 213 #define ERRORLOG_SIZE ( 16 * 1024 ) // ファイルは16KBサイズ固定 #define ERRORLOG_BUFSIZE 256 // 1エントリあたりのサイズ #define ERRORLOG_NUM_ENTRY ( ERRORLOG_SIZE / ERRORLOG_BUFSIZE ) // ログに書き込まれるエントリの最大数