2 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
3 * Alexander Warg <warg@os.inf.tu-dresden.de>
4 * economic rights: Technische Universität Dresden (Germany)
6 * This file is part of TUD:OS and distributed under the terms of the
7 * GNU General Public License 2.
8 * Please see the COPYING-GPL-2 file for details.
11 //#include "slab_alloc.h"
12 //#include "globals.h"
13 #include <l4/re/parent-sys.h>
14 #include <l4/re/protocols>
15 #include <l4/re/error_helper>
16 #include <l4/re/util/cap_alloc>
18 #include <l4/cxx/iostream>
23 using L4Re::Util::cap_alloc;
24 using L4Re::Dataspace;
27 static Slab_alloc<App_task> *alloc()
29 static Slab_alloc<App_task> a;
35 void *App_task::operator new (size_t) throw()
36 { return alloc()->alloc(); }
38 void App_task::operator delete (void *m) throw()
39 { alloc()->free((App_task*)m); }
43 App_task::dispatch(l4_umword_t obj, L4::Ipc_iostream &ios)
48 if (tag.label() != L4Re::Protocol::Parent)
55 case L4Re::Parent_::Signal:
65 L4Re::Util::cap_alloc.free(obj_cap());
68 L4::cout << "LDR: task " << obj << " exited with " << val
82 : _task(L4::Cap<L4::Task>::Invalid),
83 _thread(L4::Cap<L4::Thread>::Invalid)
85 //object_pool.cap_alloc()->alloc(&_alloc);
86 Gate_alloc::registry.register_obj(&_rm);
88 //object_pool.cap_alloc()->alloc(&log);
93 //object_pool.cap_alloc()->free(&_alloc);
94 Gate_alloc::registry.unregister_obj(&_rm);
95 //object_pool.cap_alloc()->free(&log);
96 if (_thread.is_valid())
97 cap_alloc.free(_thread);
100 cap_alloc.free(_task);
102 if (_sched.obj_cap().is_valid())
103 cap_alloc.free(_sched.obj_cap());
105 Gate_alloc::registry.unregister_obj(this);