NANDアプリ動作の時にInitAlloc→FS_Initの順で実行されていたため、

FS_Init内のハッシュチェック用バッファがヒープから確保できずに正常
動作していなかった不具合対策。

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@1258 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
yosiokat 2008-04-24 08:53:16 +00:00
parent 8500b36e99
commit 5854fe9c14
2 changed files with 19 additions and 14 deletions

View File

@ -39,9 +39,6 @@ void CMN_InitFileSystem( NNSFndAllocator* pAllocator )
// ARM7との通信FIFO割り込み許可
(void)OS_EnableIrqMask(OS_IE_SPFIFO_RECV);
// ファイルシステム初期化
FS_Init( FS_DMA_NOT_USE );
// ファイルテーブルキャッシュ
if( pAllocator != NULL )
{

View File

@ -155,18 +155,26 @@ const u8 *const g_strWeek[] ATTRIBUTE_ALIGN(2) = {
// アロケータの初期化
void InitAllocator( void )
{
NNSFndAllocator *pAllocator = &g_allocator;
u32 arenaLow = MATH_ROUNDUP ( (u32)OS_GetMainArenaLo(), 16 );
u32 arenaHigh = MATH_ROUNDDOWN( (u32)OS_GetMainArenaHi(), 16 );
u32 heapSize = arenaHigh - arenaLow;
void* heapMemory = OS_AllocFromMainArenaLo( heapSize, 16 );
NNSFndHeapHandle heapHandle;
SDK_NULL_ASSERT( pAllocator );
heapHandle = NNS_FndCreateExpHeap( heapMemory, heapSize );
SDK_ASSERT( heapHandle != NNS_FND_HEAP_INVALID_HANDLE );
// ※暫定対策 FS_Init内でハッシュチェック用のヒープを確保しているため、
// ユーザーヒープの確保前にFS_Initを行う必要がある。
NNS_FndInitAllocatorForExpHeap( pAllocator, heapHandle, 32 );
// ファイルシステム初期化
FS_Init( FS_DMA_NOT_USE );
{
NNSFndAllocator *pAllocator = &g_allocator;
u32 arenaLow = MATH_ROUNDUP ( (u32)OS_GetMainArenaLo(), 16 );
u32 arenaHigh = MATH_ROUNDDOWN( (u32)OS_GetMainArenaHi(), 16 );
u32 heapSize = arenaHigh - arenaLow;
void* heapMemory = OS_AllocFromMainArenaLo( heapSize, 16 );
NNSFndHeapHandle heapHandle;
SDK_NULL_ASSERT( pAllocator );
heapHandle = NNS_FndCreateExpHeap( heapMemory, heapSize );
SDK_ASSERT( heapHandle != NNS_FND_HEAP_INVALID_HANDLE );
NNS_FndInitAllocatorForExpHeap( pAllocator, heapHandle, 32 );
}
}