Line | |
---|
1 | /* |
---|
2 | * This file is part of DSX, development environment for static |
---|
3 | * SoC applications. |
---|
4 | * |
---|
5 | * This file is distributed under the terms of the GNU General Public |
---|
6 | * License. |
---|
7 | * |
---|
8 | * Copyright (c) 2006, Nicolas Pouillon, <nipo@ssji.net> |
---|
9 | * Laboratoire d'informatique de Paris 6 / ASIM, France |
---|
10 | * |
---|
11 | * $Id$ |
---|
12 | */ |
---|
13 | |
---|
14 | #ifndef SRL_LOCK_H_ |
---|
15 | #define SRL_LOCK_H_ |
---|
16 | |
---|
17 | /** |
---|
18 | * @file |
---|
19 | * @module{SRL} |
---|
20 | * @short Lock operations |
---|
21 | */ |
---|
22 | |
---|
23 | #include "spin_lock.h" |
---|
24 | |
---|
25 | typedef giet_lock_t* srl_lock_t; |
---|
26 | |
---|
27 | /** |
---|
28 | @this takes a lock. |
---|
29 | |
---|
30 | @param lock The lock object |
---|
31 | */ |
---|
32 | #define srl_lock_lock(lock) lock_acquire(lock); |
---|
33 | |
---|
34 | /** |
---|
35 | @this releases a lock. |
---|
36 | |
---|
37 | @param lock The lock object |
---|
38 | */ |
---|
39 | #define srl_lock_unlock( lock ) lock_release(lock); |
---|
40 | |
---|
41 | /** |
---|
42 | @this tries to take a lock. @this returns whether the lock was |
---|
43 | actually taken. |
---|
44 | |
---|
45 | @param lock The lock object |
---|
46 | @return 0 if the lock was taken successfully |
---|
47 | */ |
---|
48 | #define srl_lock_try_lock( lock ) lock_try_acquire( lock ); |
---|
49 | |
---|
50 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.