Bringing flexcat 2.15 into the main branch (again)
[AROS.git] / arch / m68k-amiga / graphics / attemptlocklayerrom.S
blob8c1d82f49ae169361a6ab46e6e2837051f173583
1 /*
2     Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3     $Id$
5     Desc: Graphics function AttemptLockLayerRom()
6     Lang: english
7 */
8 /*****************************************************************************
10     NAME
11 #include <proto/graphics.h>
13         AROS_LH1(BOOL, AttemptLockLayerRom,
15     SYNOPSIS
16         AROS_LHA(struct Layer *, l, A5),
18     LOCATION
19         struct GfxBase *, GfxBase, 109, Graphics)
21     FUNCTION
22         Try to lock the current layer. If it is already locked this
23         function will return FALSE, TRUE otherwise.
24         If the layer could be locked successfully nesting will take place
25         which means that for every successful locking of a layer 
26         UnlockLayerRom() has to be called for that layer to let other 
27         tasks access that layer. 
29     INPUTS
30         l - pointer to layer
32     RESULT
33         TRUE  - layer is successfully locked for the task
34         FALSE - layer could not be locked, it's locked by another task.
36     NOTES
38     EXAMPLE
40     BUGS
42     SEE ALSO
43       LockLayerRom(), UnlockLayerRom()
45     INTERNALS
47     HISTORY
49 *****************************************************************************/
50         #include "aros/m68k/asm.h"
52         .text
53         .balign 4
54         .globl  AROS_SLIB_ENTRY(AttemptLockLayerRom,Graphics,109)
56 AROS_SLIB_ENTRY(AttemptLockLayerRom,Graphics,109):
57     movem.l %d1/%a0-%a1/%a6,%sp@-
58     move.l  SysBase,%a6
59     lea.l   %a5@(ly_Lock),%a0
60     jsr     %a6@(AttemptSemaphore)
61     movem.l %sp@+,%d1/%a0-%a1/%a6
62     rts