OS_LockCartridge


C Specification

#include <nitro/os.h>

s32 OS_LockCartridge( u16 lockID );

Description

Spinlocks are employed to allow exclusive control of resources (for this function, the card) that are shared between processors or modules. It keeps trying until the lock is successful. Please be sure to use this after the lock for resources shared between processors. If the timing of an exclusive resource of a processor can be adjusted, then a lock won't be necessary.

This function keeps trying until the lock is successful. When the locking succeeded, it accesses the EXMEMCNT register and obtains access rights to the card bus. Please be sure to use this function after the lock for resources shared between processors. If the timing of an exclusive resource of a processor can be adjusted, 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.

Arguments

lockID ID used to lock the cartridge

Return Value

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.

Internal Operation

Accesses EXMEMCNT(0x4000204) of the IO register.

See Also

OS_UnlockCartridge, OS_TryLockCartridge, OS_LockCard, OS_GetLockID

Revision History

11/04/2004 Added Internal Operation description.
07/22/2004 Change of argument format from u32 to u16.
06/21/2004 Initial version