Bringing flexcat 2.15 into the main branch (again)
[AROS.git] / arch / m68k-amiga / graphics / locklayerrom.S
blob30110cd2f12508d6fcf1e9c88c57064c7ec38ef9
1 /*
2     Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3     $Id$
5     Desc: Graphics function LockLayerRom()
6     Lang: english
7 */
8 /*****************************************************************************
10     NAME
11 #include <proto/graphics.h>
13         AROS_LH1(void, LockLayerRom,
15     SYNOPSIS
16         AROS_LHA(struct Layer *, l,   A5),
18     LOCATION
19         struct GfxBase *, GfxBase, 72, Graphics)
21     FUNCTION
22         Locks the layer. Returns when the layer is locked for
23         exclusive use.
24         This call behaves like when a semaphore is locked. The
25         same task may lock the same layer several times without
26         locking itself out. For every call to this function a
27         call to UnlockLayerRom() has to be made as the calls nest.
28         This function will also prevent intuition from locking the
29         layer so the layer should not be blocked too long.
30         This function does exactly the same as layers/LockLayer()
32     INPUTS
33         l - pointer to layer that is to be locked
35     RESULT
37     NOTES
39     EXAMPLE
41     BUGS
42        Does not save all registers.
44     SEE ALSO
45        UnlockLayerRom(), hyperlayers.library/LockLayer()
46        hyperlayers.library/UnLockLayer()
48     INTERNALS
50     HISTORY
52 *****************************************************************************/
53         #include "aros/m68k/asm.h"
55         .text
56         .balign 4
57         .globl  AROS_SLIB_ENTRY(LockLayerRom,Graphics,72)
59 AROS_SLIB_ENTRY(LockLayerRom,Graphics,72):
60     movem.l %d0-%d1/%a0-%a1/%a6,%sp@-
61     move.l  SysBase,%a6
62     lea.l   %a5@(ly_Lock),%a0
63     jsr     %a6@(ObtainSemaphore)
64     movem.l %sp@+,%d0-%d1/%a0-%a1/%a6
65     rts