mirror of
https://github.com/rvtr/ctr_firmware.git
synced 2025-06-18 16:55:31 -04:00
exclusiveデモへ排他アクセス追加。
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_firmware@297 b871894f-2f95-9b40-918c-086798483c85
This commit is contained in:
parent
7700918ac6
commit
72fd0dd832
@ -26,18 +26,30 @@ void BromMain( void )
|
||||
osInitThread();
|
||||
while ( 1 )
|
||||
{
|
||||
u8 cpuID = i_osGetCpuID();
|
||||
|
||||
osSleep(1000 - 100 * cpuID);
|
||||
if ( osTryLockByte(1, (OSLockByte *)HW_CARD_LOCK_BUF, NULL) == OS_LOCK_SUCCESS )
|
||||
{
|
||||
osTPrintf( "Core%d: SpinLock is succeed.\n", i_osGetCpuID() );
|
||||
osSleep(1000 - 100 * i_osGetCpuID());
|
||||
osTPrintf( "[Core%d] SpinLock is succeed.\n", cpuID );
|
||||
osSleep(1000 - 100 * cpuID);
|
||||
osUnlockByte(1, (OSLockByte *)HW_CARD_LOCK_BUF, NULL);
|
||||
osSleep(1000 - 100 * i_osGetCpuID());
|
||||
}
|
||||
else
|
||||
{
|
||||
osTPrintf( "Core%d: SpinLock is failed.\n", i_osGetCpuID() );
|
||||
osSleep(1000 - 100 * i_osGetCpuID());
|
||||
osTPrintf( "[Core%d] SpinLock is failed.\n", cpuID );
|
||||
}
|
||||
#ifndef SDK_MG20EMU
|
||||
if ( miStoreExclusiveByte(cpuID, (u8 *)HW_MAIN_MEM_EX) == MI_STREX_SUCCESS )
|
||||
{
|
||||
osTPrintf( "[Core%d] StrExclusive is succeed.\n", cpuID );
|
||||
}
|
||||
else
|
||||
{
|
||||
osTPrintf( "[Core%d] StrExclusive is failed.\n", cpuID );
|
||||
}
|
||||
osTPrintf( "[Core%d] LoadExclusive value is %x.\n", cpuID, miLoadExclusiveByte( (u8 *)HW_MAIN_MEM_EX ) );
|
||||
#endif // SDK_MG20EMU
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user