#include <nitro/os.h>
s32 OS_LockCard( u16 lockID );
lockID | ID used to lock the card |
Succeeds if OS_LOCK_SUCCESS
is returned. (Defined as 0.) It will continue trying until it succeeds, so this will always be the return value.
Spinlocks are employed to allow exclusive control of resources (for this function, the card) that are shared between processors or modules.
This function keeps trying until the lock is successful. When the lock succeeds, it accesses the EXMEMCNT
register and obtains access rights to the card bus. Please be sure to use this function for resources shared between processors after the lock. If the timing of an exclusive resource of a processor can be adjusted, then a lock is not necessary.
lockID
is the ID for the lock and should be obtained using OS_GetLockID()
to prevent overlap between processors or modules.
Accesses the EXMEMCNT
I/O register (0x4000204)
.
OS_UnlockCard
, OS_TryLockCard
, OS_LockCartridge
, OS_GetLockID
2004/11/04 Added Internal Operation description.
2004/07/22 Change of argument format from u32
to u16
.
2004/06/21 Initial version
CONFIDENTIAL