8 * (c) 2008-2009 Technische Universität Dresden
9 * This file is part of TUD:OS and distributed under the terms of the
10 * GNU General Public License 2.
11 * Please see the COPYING-GPL-2 file for details.
13 * As a special exception, you may use this file as part of a free software
14 * library without restriction. Specifically, if other files instantiate
15 * templates or use macros or inline functions from this file, or you compile
16 * this file and link it with other files to produce an executable, this
17 * file does not by itself cause the resulting executable to be covered by
18 * the GNU General Public License. This exception does not however
19 * invalidate any other reasons why the executable file might be covered by
20 * the GNU General Public License.
22 #include <l4/sys/scheduler.h>
23 #include <l4/sys/types.h>
24 #include <l4/cxx/ipc_stream>
25 #include <l4/libkproxy/scheduler_svr>
29 int Scheduler_svr::scheduler_dispatch(l4_umword_t, L4::Ipc_iostream &ios)
35 case L4_SCHEDULER_INFO_OP:
37 l4_sched_cpu_set_t cpus;
44 cpus.offset = gran_off & 0x00ffffff;
45 cpus.granularity = (gran_off >> 24);
49 int ret = _sched->info(&cpu_max, &cpus);
52 ios << cpus.map << cpu_max;
56 case L4_SCHEDULER_RUN_THREAD_OP:
61 l4_umword_t gran_off, prio, quantum;
62 ios >> gran_off >> sp.affinity.map >> prio >> quantum >> thread;
65 sp.affinity.offset = gran_off & 0x00ffffff;
66 sp.affinity.granularity = gran_off >> 24;
69 return _sched->run_thread(received_thread(thread), sp);
71 case L4_SCHEDULER_IDLE_TIME_OP:
73 l4_sched_cpu_set_t cpus;
76 ios >> gran_off >> cpus.map;
77 cpus.offset = gran_off & 0x00ffffff;
78 cpus.granularity = gran_off >> 24;
80 return _sched->idle_time(cpus);