/*---------------------------------------------------------------------------* Project: TwlBrom - exclusive File: main.c Copyright 2009 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:: $ $Rev$ $Author$ *---------------------------------------------------------------------------*/ #include void BromMain( void ) { osInitException(); osInitBROM(); osPrintf( "ARM11: start\n" ); #ifdef BROM_TARGET_FIRM #ifdef CTR_DEBUGGER_ARM #undef osTPrintf( ... ) #define osTPrintf( ... ) ((void)0) #endif // CTR_DEBUGGER_ARM #endif // BROM_TARGET_FIRM osInitThread(); while ( 1 ) { if ( osTryLockByte(1, (OSLockByte *)HW_CARD_LOCK_BUF, NULL) == OS_LOCK_SUCCESS ) { osTPrintf( "SpinLock is succeed.\n" ); osSleep(1000 - 100 * i_osGetCpuID()); osUnlockByte(1, (OSLockByte *)HW_CARD_LOCK_BUF, NULL); osSleep(1000 - 100 * i_osGetCpuID()); } else { osTPrintf( "SpinLock is failed.\n" ); osSleep(1000 - 100 * i_osGetCpuID()); } } }