1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<TITLE>OS_LockCartridge</TITLE> 8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 9</HEAD> 10<BODY> 11<H1 align="left">OS_LockCartridge <IMG src="../../image/NTR.gif" align="middle"><IMG src="../../image/TWL.gif" align="middle"></H1> 12<H2>Syntax</H2> 13<DL> 14 <DD> 15 <PRE><CODE>#include <nitro/os.h></CODE></PRE> 16 <PRE><CODE>s32 OS_LockCartridge( u16 lockID ); 17 </CODE></PRE> 18</DL> 19<H2>Arguments</H2> 20<TABLE border="1" width="100%"> 21 <TBODY> 22 <TR> 23 <TD width="13%"><EM><STRONG>lockID</STRONG></EM></TD> 24 <TD width="87%">ID used to lock the cartridge</TD> 25 </TR> 26 </TBODY> 27</TABLE> 28<H2>Return Values</H2> 29<P>Succeeds if <CODE>OS_LOCK_SUCCESS</CODE> is returned. (Defined as 0.) It will continue trying until it succeeds, so this will always be the return value.</P> 30<H2>Description</H2> 31<P>Spinlocks are employed to allow exclusive control of resources (for this function, the card) that are shared between processors or modules.</P> 32<P>This function keeps trying until the lock is successful. When the locking succeeded, it accesses the <code>EXMEMCNT</code> 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.</P> 33<P><em><strong><code>lockID</code></strong></em> is the ID for the lock and should be obtained using <code><a href="OS_GetLockID.html">OS_GetLockID()</a></code> to prevent overlap between processors or modules.</P> 34<H2>Internal Operation</H2> 35<P>Accesses the <code>EXMEMCNT</code> I/O register <code>(0x4000204)</code>.</P> 36<H2>See Also</H2> 37<P><code><a href="OS_UnlockCartridge.html">OS_UnlockCartridge</a></code>, <code><a href="OS_TryLockCartridge.html">OS_TryLockCartridge</a></code>, <code><a href="OS_LockCard.html">OS_LockCard</a></code>, <code><a href="OS_GetLockID.html">OS_GetLockID</a></code></P> 38<H2>Revision History</H2> 39<P>2004/11/04 Added Internal Operation description.<br /> 2004/07/22 Change of argument format from <code>u32</code> to <code>u16</code>.<br /> 2004/06/21 Initial version</P> 40<hr><p>CONFIDENTIAL</p></body> 41</HTML>