]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4re_vfs/include/impl/vfs_api_impl.h
a26f411324289b9fb2cc6f3c63645cdb75835f7c
[l4.git] / l4 / pkg / l4re_vfs / include / impl / vfs_api_impl.h
1 /*
2  * (c) 2010 Technische Universität Dresden
3  * This file is part of TUD:OS and distributed under the terms of the
4  * GNU General Public License 2.
5  * Please see the COPYING-GPL-2 file for details.
6  *
7  * As a special exception, you may use this file as part of a free software
8  * library without restriction.  Specifically, if other files instantiate
9  * templates or use macros or inline functions from this file, or you compile
10  * this file and link it with other files to produce an executable, this
11  * file does not by itself cause the resulting executable to be covered by
12  * the GNU General Public License.  This exception does not however
13  * invalidate any other reasons why the executable file might be covered by
14  * the GNU General Public License.
15  */
16 #include "vfs_api.h"
17 #include <stddef.h>
18
19 namespace L4Re { namespace Core {
20
21 namespace {
22 class Default_cap_alloc : public L4Re::Cap_alloc
23 {
24 public:
25   virtual L4::Cap<void> alloc() throw()
26   { return Vfs_config::cap_alloc.alloc<void>(); }
27
28   virtual void free(L4::Cap<void> cap) throw()
29   { Vfs_config::cap_alloc.free(cap); }
30
31   virtual L4::Cap<void> next_allocated(l4_umword_t *refs, L4::Cap<void> pivot = L4::Cap<void>::Invalid) throw()
32   {
33     (void)refs;
34     return pivot;
35   }
36
37   virtual ~Default_cap_alloc() {}
38
39   void operator delete (void *) throw() {}
40 };
41
42 }
43
44 L4Re::Cap_alloc *cap_alloc()
45 {
46   static Default_cap_alloc default_cap_alloc;
47   return &default_cap_alloc;
48 }
49
50 }}