mirror of
https://github.com/rvtr/TwlIPL.git
synced 2025-10-31 06:01:12 -04:00
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:
parent
8500b36e99
commit
5854fe9c14
@ -39,9 +39,6 @@ void CMN_InitFileSystem( NNSFndAllocator* pAllocator )
|
|||||||
// ARM7との通信FIFO割り込み許可
|
// ARM7との通信FIFO割り込み許可
|
||||||
(void)OS_EnableIrqMask(OS_IE_SPFIFO_RECV);
|
(void)OS_EnableIrqMask(OS_IE_SPFIFO_RECV);
|
||||||
|
|
||||||
// ファイルシステム初期化
|
|
||||||
FS_Init( FS_DMA_NOT_USE );
|
|
||||||
|
|
||||||
// ファイルテーブルキャッシュ
|
// ファイルテーブルキャッシュ
|
||||||
if( pAllocator != NULL )
|
if( pAllocator != NULL )
|
||||||
{
|
{
|
||||||
|
|||||||
@ -155,18 +155,26 @@ const u8 *const g_strWeek[] ATTRIBUTE_ALIGN(2) = {
|
|||||||
// アロケータの初期化
|
// アロケータの初期化
|
||||||
void InitAllocator( void )
|
void InitAllocator( void )
|
||||||
{
|
{
|
||||||
NNSFndAllocator *pAllocator = &g_allocator;
|
// ※暫定対策 FS_Init内でハッシュチェック用のヒープを確保しているため、
|
||||||
u32 arenaLow = MATH_ROUNDUP ( (u32)OS_GetMainArenaLo(), 16 );
|
// ユーザーヒープの確保前にFS_Initを行う必要がある。
|
||||||
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 );
|
// ファイルシステム初期化
|
||||||
|
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 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user