2 * (c) 2008-2009 Alexander Warg <warg@os.inf.tu-dresden.de>
3 * economic rights: Technische Universität Dresden (Germany)
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.
11 #include <l4/cxx/ipc_server>
13 #include "server_obj.h"
15 #include <l4/cxx/list>
21 class Allocator : public Moe::Server_object, public Moe::Q_object
26 long _sched_prio_limit;
27 l4_umword_t _sched_cpu_mask;
30 explicit Allocator(size_t limit, unsigned prio_limit = 0)
31 : _quota(limit), _sched_prio_limit(prio_limit), _sched_cpu_mask(~0UL)
34 Moe::Quota *quota() { return &_quota; }
36 Moe::Dataspace *alloc(unsigned long size, unsigned long flags = 0,
37 unsigned long align = 0);
41 int dispatch(l4_umword_t obj, L4::Ipc::Iostream &ios);
42 int disp_factory(l4_umword_t, L4::Ipc::Iostream &ios);
44 void *operator new (size_t size, Moe::Quota *q, size_t limit);
45 void operator delete (void *m) throw();
47 L4::Server_object *open(int argc, cxx::String const *argv);
48 static Allocator *root_allocator();