2 * (c) 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/hlist>
12 #include <l4/cxx/ipc_server>
13 #include <l4/libkproxy/scheduler_svr>
16 #include "server_obj.h"
19 public Moe::Server_object,
20 public L4kproxy::Scheduler_svr_t<Sched_proxy>,
21 public L4Re::Util::Icu_cap_array_svr<Sched_proxy>,
22 public cxx::H_list_item
24 typedef L4Re::Util::Icu_cap_array_svr<Sched_proxy> Icu;
27 typedef L4::Cap<L4::Irq> Irq_cap;
28 static Irq_cap alloc_irq_cap()
29 { return object_pool.cap_alloc()->alloc<L4::Irq>(); }
31 static void free_irq_cap(Irq_cap cap)
32 { object_pool.cap_alloc()->free(cap); }
37 int info(l4_umword_t *cpu_max, l4_sched_cpu_set_t *cpus);
39 int run_thread(L4::Cap<L4::Thread> thread, l4_sched_param_t const &sp);
41 int idle_time(l4_sched_cpu_set_t const &cpus);
43 int dispatch(l4_umword_t label, L4::Ipc::Iostream &ios)
48 if (tag.label() == L4_PROTO_IRQ)
49 return Icu::dispatch(label, ios);
50 if (tag.label() == L4_PROTO_SCHEDULER)
51 return scheduler_dispatch(label, ios);
56 void set_prio(unsigned offs, unsigned limit)
57 { _prio_offset = offs; _prio_limit = limit; }
59 L4::Cap<L4::Thread> received_thread(L4::Ipc::Snd_fpage const &fp);
60 L4::Cap<void> rcv_cap() const
61 { return L4::Cap<L4::Thread>(Rcv_cap << L4_CAP_SHIFT); }
63 void restrict_cpus(l4_umword_t cpus);
66 Icu::Irq *scheduler_irq() { return &_scheduler_irq; }
67 Icu::Irq const *scheduler_irq() const { return &_scheduler_irq; }
70 friend class Cpu_hotplug_server;
72 l4_sched_cpu_set_t _cpus, _real_cpus, _cpu_mask;
74 unsigned _prio_offset, _prio_limit;
75 Icu::Irq _scheduler_irq;
77 typedef cxx::H_list_bss<Sched_proxy> List;