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/sys/cxx/ipc_epiface>
13 #include <l4/libkproxy/scheduler_svr>
16 #include "server_obj.h"
19 public L4::Epiface_t<Sched_proxy, L4::Scheduler, 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_t<Sched_proxy>
24 typedef L4Re::Util::Icu_cap_array_svr<Sched_proxy> Icu;
27 using L4Re::Util::Icu_cap_array_svr<Sched_proxy>::op_info;
28 using L4kproxy::Scheduler_svr_t<Sched_proxy>::op_info;
30 typedef L4::Cap<L4::Irq> Irq_cap;
31 static Irq_cap alloc_irq_cap()
32 { return object_pool.cap_alloc()->alloc<L4::Irq>(); }
34 static void free_irq_cap(Irq_cap cap)
35 { object_pool.cap_alloc()->free(cap); }
40 int info(l4_umword_t *cpu_max, l4_sched_cpu_set_t *cpus);
42 int run_thread(L4::Cap<L4::Thread> thread, l4_sched_param_t const &sp);
44 int idle_time(l4_sched_cpu_set_t const &cpus, l4_kernel_clock_t &us);
46 void set_prio(unsigned offs, unsigned limit)
47 { _prio_offset = offs; _prio_limit = limit; }
49 L4::Cap<L4::Thread> received_thread(L4::Ipc::Snd_fpage const &fp);
50 L4::Cap<void> rcv_cap() const
51 { return L4::Cap<L4::Thread>(Rcv_cap << L4_CAP_SHIFT); }
53 void restrict_cpus(l4_umword_t cpus);
56 Icu::Irq *scheduler_irq() { return &_scheduler_irq; }
57 Icu::Irq const *scheduler_irq() const { return &_scheduler_irq; }
60 friend class Cpu_hotplug_server;
62 l4_sched_cpu_set_t _cpus, _real_cpus, _cpu_mask;
64 unsigned _prio_offset, _prio_limit;
65 Icu::Irq _scheduler_irq;
67 typedef cxx::H_list_t_bss<Sched_proxy> List;