L4Re - L4 Runtime Environment
llulc.h
1 /*
2  * (c) 2011 Adam Lackorzynski <adam@os.inf.tu-dresden.de>
3  * economic rights: Technische Universit├Ąt Dresden (Germany)
4  *
5  * This file is part of TUD:OS and distributed under the terms of the
6  * GNU General Public License 2.
7  * Please see the COPYING-GPL-2 file for details.
8  *
9  * As a special exception, you may use this file as part of a free software
10  * library without restriction. Specifically, if other files instantiate
11  * templates or use macros or inline functions from this file, or you compile
12  * this file and link it with other files to produce an executable, this
13  * file does not by itself cause the resulting executable to be covered by
14  * the GNU General Public License. This exception does not however
15  * invalidate any other reasons why the executable file might be covered by
16  * the GNU General Public License.
17  */
18 /*
19  * Note, do _NOT_ use this lock unless you got advised to do so.
20  */
21 #pragma once
22 
23 #include <l4/sys/utcb.h>
24 #include <stddef.h>
25 
26 __BEGIN_DECLS
27 
28 struct l4lllock_struct_t;
29 typedef struct l4ullulock_struct_t l4ullulock_t;
30 
31 #ifdef __cplusplus
32 #define DEFAULT_UTCB = l4_utcb()
33 #else
34 #define DEFAULT_UTCB
35 #endif
36 
37 int l4ullulock_init(l4ullulock_t **t,
38  void *(*mem_alloc)(size_t x),
39  void (*mem_free)(void *p),
40  l4_cap_idx_t (*cap_alloc)(void),
41  void (*cap_free)(l4_cap_idx_t c),
42  l4_cap_idx_t factory);
43 int l4ullulock_deinit(l4ullulock_t *t);
44 int l4ullulock_lock(l4ullulock_t *t, l4_utcb_t *u DEFAULT_UTCB);
45 int l4ullulock_unlock(l4ullulock_t *t, l4_utcb_t *u DEFAULT_UTCB);
46 
unsigned long l4_cap_idx_t
L4 Capability selector Type.
Definition: types.h:342
#define __END_DECLS
End section with C types and functions.
Definition: compiler.h:193
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition: utcb.h:67
_Cap_alloc & cap_alloc
Capability allocator.