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.
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.
19 namespace L4Re { namespace Core {
22 class Default_cap_alloc : public L4Re::Cap_alloc
25 virtual L4::Cap<void> alloc() throw()
26 { return Vfs_config::cap_alloc.alloc<void>(); }
28 virtual void free(L4::Cap<void> cap) throw()
29 { Vfs_config::cap_alloc.free(cap); }
31 virtual L4::Cap<void> next_allocated(l4_umword_t *refs, L4::Cap<void> pivot = L4::Cap<void>::Invalid) throw()
37 virtual ~Default_cap_alloc() {}
39 void operator delete (void *) throw() {}
44 L4Re::Cap_alloc *cap_alloc()
46 static Default_cap_alloc default_cap_alloc;
47 return &default_cap_alloc;