/*---------------------------------------------------------------------------* Project: TwlSDK - MI File: mi_sharedWram.c Copyright 2007-2008 Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Date:: 2009-06-19#$ $Rev: 10786 $ $Author: okajima_manabu $ *---------------------------------------------------------------------------*/ #ifdef SDK_ARM9 #include #else #include #endif #include // Remove only branch when operating TWL from MI_InitWramManager static void MIi_InitWramManager(void); void MI_InitWramManager(void) { if (OS_IsRunOnTwl() == FALSE) { return; } MIi_InitWramManager(); } #ifdef SDK_ARM9 #include #endif #ifdef SDK_ARM9 //================================================================================ // low level functions of wram banks //================================================================================ /*---------------------------------------------------------------------------* Name: MIi_SetWramBank_A / MIi_SetWramBank_B / MIi_SetWramBank_C Description: Configures shared WRAM bank Arguments: num ; slot num WRAM_A:0-3 WRAM_B:0-7 WRAM_C:0-7 proc : master select MI_WRAM_ARM9 : ARM9 MI_WRAM_ARM7 : ARM7 MI_WRAM_DSP : DSP (only for WRAM_B and WRAM_C) offset: offset of WRAM allocation (for WRAM_A) MI_WRAM_OFFSET_0KB : 0KB from top MI_WRAM_OFFSET_64KB : 64KB from top MI_WRAM_OFFSET_128KB : 128KB from top MI_WRAM_OFFSET_192KB : 192KB from top (for WRAM_B and WRAM_C) MI_WRAM_OFFSET_0KB : 0KB from top MI_WRAM_OFFSET_32KB : 32KB from top MI_WRAM_OFFSET_64KB : 64KB from top MI_WRAM_OFFSET_96KB : 96KB from top MI_WRAM_OFFSET_128KB : 128KB from top MI_WRAM_OFFSET_160KB : 160KB from top MI_WRAM_OFFSET_192KB : 192KB from top MI_WRAM_OFFSET_224KB : 224KB from top enable: enable flag MI_WRAM_ENABLE : enable MI_WRAM_DISABLE : disable Returns: None. *---------------------------------------------------------------------------*/ void MIi_SetWramBank_A( int num, MIWramProc proc, MIWramOffset offset, MIWramEnable enable ) { SDK_ASSERT( 0<=num && num>1)<> MI_WRAM_OFFSET_SHIFT_A << 1 ); } MIWramOffset MI_GetWramBankOffset_B( int num ) { SDK_ASSERT( 0<=num && num> MI_WRAM_OFFSET_SHIFT_B ); } MIWramOffset MI_GetWramBankOffset_C( int num ) { SDK_ASSERT( 0<=num && num> MI_WRAM_OFFSET_SHIFT_C ); } MIWramOffset MI_GetWramBankOffset( MIWramPos wram, int num ) { static MIWramOffset (*f[3])( int ) = { MI_GetWramBankOffset_A, MI_GetWramBankOffset_B, MI_GetWramBankOffset_C }; SDK_ASSERT( 0<=wram && wram<3 ); return (f[wram])( num ); } /*---------------------------------------------------------------------------* Name: MI_GetWramBankEnable_A / MI_GetWramBankEnable_B /MI_GetWramBankEnable_C Description: Gets enable/disable which is set to shared WRAM bank Arguments: num ; slot num WRAM_A:0-3 WRAM_B:0-7 WRAM_C:0-7 Returns: enable flag MI_WRAM_ENABLE : enable MI_WRAM_DISABLE : disable *---------------------------------------------------------------------------*/ MIWramEnable MI_GetWramBankEnable_A( int num ) { SDK_ASSERT( 0<=num && num> (16 - REG_MI_MBK6_WA_SADDR_SHIFT)) | ((end -0x02ffffff) << (REG_MI_MBK6_WA_EADDR_SHIFT - 16)); } /*---------------------------------------------------------------------------* Name: MIi_SetWramMap_B Description: Sets WRAM_B map Arguments: start: start address 0x03000000 - 0x03FF0000 (32KB step) end: end address 0x02FFFFFF - 0x03FFFFFF (32KB step) image: MI_WRAM_IMAGE_32KB MI_WRAM_IMAGE_64KB MI_WRAM_IMAGE_128KB MI_WRAM_IMAGE_256KB Returns: None. *---------------------------------------------------------------------------*/ void MIi_SetWramMap_B( u32 start, u32 end, MIWramImage image ) { SDK_ASSERT( (start & 0x7fff) == 0 && 0x03000000 <= start && start <= 0x03ff8000); SDK_ASSERT( (end & 0x7fff) == 0x7fff && 0x02ffffff <= end && end <= 0x03ffffff); reg_MI_MBK7 = (image << REG_MI_MBK7_WB_ISIZE_SHIFT) | ((start-0x03000000) >> (16 - REG_MI_MBK7_WB_SADDR_SHIFT)) | ((end -0x02ffffff) << (REG_MI_MBK7_WB_EADDR_SHIFT - 16)); } /*---------------------------------------------------------------------------* Name: MIi_SetWramMap_C Description: Sets WRAM_C map Arguments: start: start address 0x03000000 - 0x03FF0000 (32KB step) end: end address 0x02FFFFFF - 0x03FFFFFF (32KB step) image: MI_WRAM_IMAGE_32KB MI_WRAM_IMAGE_64KB MI_WRAM_IMAGE_128KB MI_WRAM_IMAGE_256KB Returns: None. *---------------------------------------------------------------------------*/ void MIi_SetWramMap_C( u32 start, u32 end, MIWramImage image ) { SDK_ASSERT( (start & 0x7fff) == 0 && 0x03000000 <= start && start <= 0x03ff8000); SDK_ASSERT( (end & 0x7fff) == 0x7fff && 0x02ffffff <= end && end <= 0x03ffffff); reg_MI_MBK8 = (image << REG_MI_MBK8_WC_ISIZE_SHIFT) | ((start-0x03000000) >> (16 - REG_MI_MBK8_WC_SADDR_SHIFT)) | ((end -0x02ffffff) << (REG_MI_MBK8_WC_EADDR_SHIFT - 16)); } /*---------------------------------------------------------------------------* Name: MI_GetWramMapStart_A / MI_GetWramMapStart_B / MI_GetWramMapStart_C Description: Gets start address of shared WRAM Arguments: None. Return: start: start address (for WRAM_A) 0x03000000 - 0x03FF0000 (64KB step) (for WRAM_B and WRAM_C) 0x03000000 - 0x03FF0000 (32KB step) *---------------------------------------------------------------------------*/ u32 MI_GetWramMapStart_A(void) { #ifdef SDK_ARM9 u32 wramReg = reg_MI_MBK6; #else u32 wramReg = *(u32*)(HW_TWL_ROM_HEADER_BUF + 0x0194); #endif return HW_WRAM_BASE + (((wramReg & REG_MI_MBK6_WA_SADDR_MASK) >> REG_MI_MBK6_WA_SADDR_SHIFT) << 16); } u32 MI_GetWramMapStart_B(void) { #ifdef SDK_ARM9 u32 wramReg = reg_MI_MBK7; #else u32 wramReg = *(u32*)(HW_TWL_ROM_HEADER_BUF + 0x0198); #endif return HW_WRAM_BASE + (((wramReg & REG_MI_MBK7_WB_SADDR_MASK) >> REG_MI_MBK7_WB_SADDR_SHIFT) << 15); } u32 MI_GetWramMapStart_C(void) { #ifdef SDK_ARM9 u32 wramReg = reg_MI_MBK8; #else u32 wramReg = *(u32*)(HW_TWL_ROM_HEADER_BUF + 0x019C); #endif return HW_WRAM_BASE + (((wramReg & REG_MI_MBK8_WC_SADDR_MASK) >> REG_MI_MBK8_WC_SADDR_SHIFT) << 15); } u32 MI_GetWramMapStart( MIWramPos wram ) { static u32 (*f[3])( void ) = { MI_GetWramMapStart_A, MI_GetWramMapStart_B, MI_GetWramMapStart_C }; SDK_ASSERT( 0<=wram && wram<3 ); return (f[wram])(); } /*---------------------------------------------------------------------------* Name: MI_GetWramMapEnd_A / MI_GetWramMapEnd_B / MI_GetWramMapEnd_C Description: Gets end address of shared WRAM Arguments: None. Returns: end: end address (for WRAM_A) 0x02FFFFFF - 0x03FFFFFF (64KB step) (for WRAM_B and WRAM_C) 0x02FFFFFF - 0x03FF0000 (32KB step) *---------------------------------------------------------------------------*/ u32 MI_GetWramMapEnd_A(void) { #ifdef SDK_ARM9 u32 wramReg = reg_MI_MBK6; #else u32 wramReg = *(u32*)(HW_TWL_ROM_HEADER_BUF + 0x0194); #endif return (HW_WRAM_BASE-1) + (((wramReg & REG_MI_MBK6_WA_EADDR_MASK) >> REG_MI_MBK6_WA_EADDR_SHIFT) << 16); } u32 MI_GetWramMapEnd_B(void) { #ifdef SDK_ARM9 u32 wramReg = reg_MI_MBK7; #else u32 wramReg = *(u32*)(HW_TWL_ROM_HEADER_BUF + 0x0198); #endif return (HW_WRAM_BASE-1) + (((wramReg & REG_MI_MBK7_WB_EADDR_MASK) >> REG_MI_MBK7_WB_EADDR_SHIFT) << 15); } u32 MI_GetWramMapEnd_C(void) { #ifdef SDK_ARM9 u32 wramReg = reg_MI_MBK8; #else u32 wramReg = *(u32*)(HW_TWL_ROM_HEADER_BUF + 0x019C); #endif return (HW_WRAM_BASE-1) + (((wramReg & REG_MI_MBK8_WC_EADDR_MASK) >> REG_MI_MBK8_WC_EADDR_SHIFT) << 15); } u32 MI_GetWramMapEnd( MIWramPos wram ) { static u32 (*f[3])( void ) = { MI_GetWramMapEnd_A, MI_GetWramMapEnd_B, MI_GetWramMapEnd_C }; SDK_ASSERT( 0<=wram && wram<3 ); return (f[wram])(); } /*---------------------------------------------------------------------------* Name: MI_GetWramMapImage_A / MI_GetWramMapImage_B / MI_GetWramMapImage_C Description: Gets image setting of shared WRAM Arguments: None. Returns: image: MI_WRAM_IMAGE_32KB (only for WRAM_B and WRAM_C) MI_WRAM_IMAGE_64KB MI_WRAM_IMAGE_128KB MI_WRAM_IMAGE_256KB *---------------------------------------------------------------------------*/ MIWramImage MI_GetWramMapImage_A(void) { #ifdef SDK_ARM9 u32 wramReg = reg_MI_MBK6; #else u32 wramReg = *(u32*)(HW_TWL_ROM_HEADER_BUF + 0x0194); #endif MIWramImage image = (MIWramImage)((wramReg & REG_MI_MBK6_WA_ISIZE_MASK) >> REG_MI_MBK6_WA_ISIZE_SHIFT); if ( image == MI_WRAM_IMAGE_32KB ) { image = MI_WRAM_IMAGE_64KB; } return image; } MIWramImage MI_GetWramMapImage_B(void) { #ifdef SDK_ARM9 u32 wramReg = reg_MI_MBK7; #else u32 wramReg = *(u32*)(HW_TWL_ROM_HEADER_BUF + 0x0198); #endif return (MIWramImage)((wramReg & REG_MI_MBK7_WB_ISIZE_MASK) >> REG_MI_MBK7_WB_ISIZE_SHIFT); } MIWramImage MI_GetWramMapImage_C(void) { #ifdef SDK_ARM9 u32 wramReg = reg_MI_MBK8; #else u32 wramReg = *(u32*)(HW_TWL_ROM_HEADER_BUF + 0x019C); #endif return (MIWramImage)((wramReg & REG_MI_MBK8_WC_ISIZE_MASK) >> REG_MI_MBK8_WC_ISIZE_SHIFT); } MIWramImage MI_GetWramMapImage( MIWramPos wram ) { static MIWramImage (*f[3])( void ) = { MI_GetWramMapImage_A, MI_GetWramMapImage_B, MI_GetWramMapImage_C }; SDK_ASSERT( 0<=wram && wram<3 ); return (f[wram])(); } /*---------------------------------------------------------------------------* Name: MI_IsWramSlotLocked_A / MI_IsWramSlotLocked_B / MI_IsWramSlotLocked_C Description: Checks if WRAM slot locked Arguments: num: slot num WRAM_A:0-3 WRAM_B:0-7 WRAM_C:0-7 Returns: TRUE: locked FALSE: not locked *---------------------------------------------------------------------------*/ BOOL MI_IsWramSlotLocked_A( int num ) { SDK_ASSERT( 0<=num && numarm7 #define MIi_PXI_COMMAND_UNLOCKWRAM 13 // arm9->arm7 #define MIi_PXI_COMMAND_GET_ALLOCATABLE 14 #define MIi_SENDTYPE_COMMAND (FALSE) #define MIi_SENDTYPE_RESULT (TRUE) static void MIi_CallbackForPxi( PXIFifoTag tag, u32 data, BOOL sendType ); static int MIi_LockForPxi( volatile BOOL* finishFlag, u32* ptr ); static void MIi_WaitWhileBusy( volatile BOOL* finished ); static void MIi_SendToPxi( BOOL sendType, u32 data ); static u32 MIi_MakeData( u32 command, MIWramPos wram, MIWramProc proc, u32 data ); static void MIi_TakeApartData( u32 pxiData, u32* command, MIWramPos* wram, MIWramProc* proc, u32* data ); static BOOL lock = FALSE; static volatile BOOL* finishPtr = FALSE; static u32* resultPtr = NULL; static u32 MIi_DoAllocWram( MIWramPos wram, MIWramSize size, MIWramProc proc ); static u32 MIi_DoAllocWramSlot( MIWramPos wram, int slot, MIWramSize size, MIWramProc proc ); static int MIi_DoFreeWram( MIWramPos wram, MIWramProc proc ); static int MIi_DoFreeWramSlot( MIWramPos wram, int slot, MIWramSize size, MIWramProc proc ); static int MIi_DoSwitchWram( MIWramPos wram, MIWramProc proc, MIWramProc newProc ); static int MIi_DoSwitchWramSlot( MIWramPos wram, int slot, MIWramSize size, MIWramProc proc, MIWramProc newProc ); static u32 MIi_DoReserveWram( MIWramPos wram, MIWramSize size, MIWramProc proc ); static u32 MIi_DoReserveWramSlot( MIWramPos wram, int slot, MIWramSize size, MIWramProc proc ); static int MIi_DoCancelWram( MIWramPos wram, MIWramProc proc ); static int MIi_DoCancelWramSlot( MIWramPos wram, int slot, MIWramSize size, MIWramProc proc ); static int MIi_DoLockWramSlots( MIWramPos wram, u32 slots ); static int MIi_DoUnlockWramSlots( MIWramPos wram, u32 slots ); static int MIi_DoGetAllocatableWramSlot( MIWramPos wram, MIWramProc proc ); static OSIntrMode MIi_LockWramManagerDI( u16* lockid ); static void MIi_UnlockWramManagerRI( u16 lockid, OSIntrMode e ); //---------------------------------------------------------------- // manager info //---------------------------------------------------------------- #ifdef SDK_ARM9 //---- wram status static struct { u16 wram[3][MI_WRAM_B_MAX_NUM]; } MIi_Info; #define MI_MAN_WRAM_RESERVE_SHIFT 8 #define MI_MAN_WRAM_MASTER_SHIFT 0 #define MI_MAN_WRAM_RESERVE_MASK (3<>MI_MAN_WRAM_RESERVE_SHIFT; } #define MIi_GetReservation_A(num) (MIi_GetReservation( MI_WRAM_A, (num) )) #define MIi_GetReservation_B(num) (MIi_GetReservation( MI_WRAM_B, (num) )) #define MIi_GetReservation_C(num) (MIi_GetReservation( MI_WRAM_C, (num) )) static inline void MIi_SetReservation( MIWramPos wram, int num, int val) { MIi_Info.wram[wram][num] = (u16)(MIi_Info.wram[wram][num] & ~MI_MAN_WRAM_RESERVE_MASK | (val<>MI_MAN_WRAM_MASTER_SHIFT; } #define MIi_GetMaster_A(num) (MIi_GetMaster( MI_WRAM_A, (num) )) #define MIi_GetMaster_B(num) (MIi_GetMaster( MI_WRAM_B, (num) )) #define MIi_GetMaster_C(num) (MIi_GetMaster( MI_WRAM_C, (num) )) static inline void MIi_SetMaster( MIWramPos wram, int num, int val) { MIi_Info.wram[wram][num] = (u16)(MIi_Info.wram[wram][num] & ~MI_MAN_WRAM_MASTER_MASK | (val<>8) & 0xff; retval = MIi_DoAllocWram( wram, (MIWramSize)size, proc ); } break; case MIi_PXI_COMMAND_ALLOC_SLOT: { int slot = (int)(param>>8) & 0xff; MIWramSize size = (MIWramSize)(param & 0xff); retval = MIi_DoAllocWramSlot( wram, slot, size, proc ); } break; case MIi_PXI_COMMAND_FREE: { retval = (u32)MIi_DoFreeWram( wram, proc ); } break; case MIi_PXI_COMMAND_FREE_SLOT: { int slot = (int)((param>>8) & 0xff); MIWramSize size = (MIWramSize)(param & 0xff); retval = (u32)MIi_DoFreeWramSlot( wram, slot, size, proc ); } break; case MIi_PXI_COMMAND_SWITCH: { MIWramProc newProc = (MIWramProc)((param>>12) & 3); retval = (u32)MIi_DoSwitchWram( wram, proc, newProc ); } break; case MIi_PXI_COMMAND_SWITCH_SLOT: { int slot = (int)((param>>8) & 0xf); MIWramSize size = (MIWramSize)(param & 0xff); MIWramProc newProc = (MIWramProc)((param>>12) & 3); retval = (u32)MIi_DoSwitchWramSlot( wram, slot, size, proc, newProc ); } break; case MIi_PXI_COMMAND_RESERVE: { u32 size = (param & 0xff); retval = MIi_DoReserveWram( wram, (MIWramSize)size, proc ); } break; case MIi_PXI_COMMAND_RESERVE_SLOT: { int slot = (int)((param>>8) & 0xff); MIWramSize size = (MIWramSize)(param & 0xff); retval = MIi_DoReserveWramSlot( wram, slot, size, proc ); } break; case MIi_PXI_COMMAND_CANCEL: { retval = (u32)MIi_DoCancelWram( wram, proc ); } break; case MIi_PXI_COMMAND_CANCEL_SLOT: { int slot = (int)((param>>8) & 0xff); MIWramSize size = (MIWramSize)(param & 0xff); retval = (u32)MIi_DoCancelWramSlot( wram, slot, size, proc ); } break; case MIi_PXI_COMMAND_GET_RESERVE: { retval = (u32)MIi_GetReservation( wram, (int)param ); } break; case MIi_PXI_COMMAND_GET_ALLOCATABLE: { retval = (u8)MIi_DoGetAllocatableWramSlot( wram, proc ); } break; } #else switch( command ) { case MIi_PXI_COMMAND_LOCKWRAM: { retval = (u32)MIi_DoLockWramSlots( wram, param ); } break; case MIi_PXI_COMMAND_UNLOCKWRAM: { retval = (u32)MIi_DoUnlockWramSlots( wram, param ); } break; } #endif MIi_SendToPxi( MIi_SENDTYPE_RESULT, retval ); } else { if ( resultPtr ) { *resultPtr = data; } if ( finishPtr ) { *finishPtr = TRUE; } //---- unlock lock = FALSE; } } /*---------------------------------------------------------------------------* Name: MI_AllocWram Description: allocate WRAM slot Arguments: wram wram position MI_WRAM_A : WRAM A MI_WRAM_B : WRAM B MI_WRAM_C : WRAM C size: size to allocate (for WRAM_A) MI_WRAM_SIZE_0KB : 0KB MI_WRAM_SIZE_64KB : 64KB MI_WRAM_SIZE_128KB : 128KB MI_WRAM_SIZE_192KB : 192KB MI_WRAM_SIZE_256KB : 256KB (for WRAM_B and WRAM_C) MI_WRAM_SIZE_0KB : 0KB MI_WRAM_SIZE_32KB : 16KB MI_WRAM_SIZE_64KB : 32KB MI_WRAM_SIZE_96KB : 64KB MI_WRAM_SIZE_128KB : 128KB MI_WRAM_SIZE_160KB : 160KB MI_WRAM_SIZE_192KB : 192KB MI_WRAM_SIZE_224KB : 224KB MI_WRAM_SIZE_256KB : 256KB proc : processor MI_WRAM_ARM9 : ARM9 MI_WRAM_ARM7 : ARM7 MI_WRAM_DSP : DSP Returns: top address of allocated WRAM 0 : failure *---------------------------------------------------------------------------*/ u32 MI_AllocWram( MIWramPos wram, MIWramSize size, MIWramProc proc ) { u32 result; u16 lockid; OSIntrMode e = MIi_LockWramManagerDI( &lockid ); result = MIi_DoAllocWram( wram, size, proc ); MIi_UnlockWramManagerRI( lockid, e ); return result; } //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - static u32 MIi_DoAllocWram( MIWramPos wram, MIWramSize size, MIWramProc proc ) { #ifdef SDK_ARM9 int blocks = (int)( (wram == MI_WRAM_A)? (size/2): size ); int allocated = 0; int firstBlock; int n; int maxNum = (wram == MI_WRAM_A)? MI_WRAM_A_MAX_NUM: MI_WRAM_B_MAX_NUM; for( n=0; n= blocks ) { break; } } else { allocated = 0; } } //---- no space not enough to alloc if ( allocated < blocks ) { return 0; } for( n=0; n= blocks ) { break; } } else { allocated = 0; } } if ( allocated < blocks ) { return 0; } for( n=0; n>20) & 0xf; } if ( wram ) { *wram = (MIWramPos)( (pxiData>>18) & 3 ); } if ( proc ) { *proc = (MIWramProc)( (pxiData>>16) & 3 ); } if ( data ) { *data = (pxiData) & 0xffff; } } //================================================================================ /*---------------------------------------------------------------------------* Name: MI_LockWramManager Description: Locks wram manager Arguments: lockid : lockID Returns: None. *---------------------------------------------------------------------------*/ void MI_LockWramManager( u16* lockid ) { *lockid = (u16)OS_GetLockID(); (void)OS_LockByWord( *lockid, (OSLockWord *)(HW_WRAM_EX_LOCK_BUF), NULL ); } /*---------------------------------------------------------------------------* Name: MI_UnlockWramManager Description: Unlocks wram manager Arguments: lockid : lockID Returns: None. *---------------------------------------------------------------------------*/ void MI_UnlockWramManager( u16 lockid ) { (void)OS_UnlockByWord( lockid, (OSLockWord *)(HW_WRAM_EX_LOCK_BUF), NULL ); OS_ReleaseLockID( lockid ); } /*---------------------------------------------------------------------------* Name: MI_TryLockWramManager Description: Tries to lock wram manager Arguments: lockid : lockID Returns: >0 value: Previous locked id OS_LOCK_SUCCESS: Lock success. *---------------------------------------------------------------------------*/ s32 MI_TryLockWramManager( u16* lockid ) { *lockid = (u16)OS_GetLockID(); return OS_TryLockByWord( *lockid, (OSLockWord *)(HW_WRAM_EX_LOCK_BUF), NULL ); } /*---------------------------------------------------------------------------* Name: (MIi_LockWramManagerDI) Description: Disables interrupts and locks wram manager Arguments: lockid : lockID Returns: former interrupt mode *---------------------------------------------------------------------------*/ static OSIntrMode MIi_LockWramManagerDI( u16* lockid ) { OSIntrMode e = OS_DisableInterrupts(); MI_LockWramManager( lockid ); return e; } /*---------------------------------------------------------------------------* Name: (MIi_UnlockWramManagerRI) Description: Unlocks wram manager and restores interrupts Arguments: lockid : lockID e : interrupt mode Returns: None. *---------------------------------------------------------------------------*/ static void MIi_UnlockWramManagerRI( u16 lockid, OSIntrMode e ) { MI_UnlockWramManager( lockid ); (void)OS_RestoreInterrupts( e ); } //================================================================================ // for DEBUG //================================================================================ static char* getMasterStr( MIWramProc m ); static char* getMasterStr( MIWramProc m ) { static char strARM9[] = "ARM9"; static char strARM7[] = "ARM7"; static char strDSP[] = "DSP "; static char strNA[] = "----"; switch( m ) { case MI_WRAM_ARM9: return strARM9; case MI_WRAM_ARM7: return strARM7; case MI_WRAM_DSP: return strDSP; } return strNA; } /*---------------------------------------------------------------------------* Name: MI_DumpThreadList Description: Dumps wram Status for WRAM-A/B/C Arguments: wram wram position. MI_WRAM_A / MI_WRAM_B / MI_WRAM_C Returns: None. *---------------------------------------------------------------------------*/ void MI_DumpWramList(MIWramPos wram) { #ifdef SDK_FINALROM #pragma unused( wram ) #else int n; int maxNum = (wram == MI_WRAM_A)? MI_WRAM_A_MAX_NUM: MI_WRAM_B_MAX_NUM; //---- wram address OS_TPrintf("----WRAM-%c (%x-%x)\n", 'A'+(int)wram, MI_GetWramMapStart(wram), MI_GetWramMapEnd(wram) ); //---- explanatory OS_TPrintf(" ALLOC RESERVE\n"); //---- each slot info for( n=0; n #endif