L4Re - L4 Runtime Environment
scheduler
Go to the documentation of this file.
1 // vi:set ft=cpp: -*- Mode: C++ -*-
6 /*
7  * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
8  * Alexander Warg <warg@os.inf.tu-dresden.de>
9  * economic rights: Technische Universität Dresden (Germany)
10  *
11  * This file is part of TUD:OS and distributed under the terms of the
12  * GNU General Public License 2.
13  * Please see the COPYING-GPL-2 file for details.
14  *
15  * As a special exception, you may use this file as part of a free software
16  * library without restriction. Specifically, if other files instantiate
17  * templates or use macros or inline functions from this file, or you compile
18  * this file and link it with other files to produce an executable, this
19  * file does not by itself cause the resulting executable to be covered by
20  * the GNU General Public License. This exception does not however
21  * invalidate any other reasons why the executable file might be covered by
22  * the GNU General Public License.
23  */
24 #pragma once
25 
26 #include <l4/sys/icu>
27 #include <l4/sys/scheduler.h>
28 #include <l4/sys/capability>
29 #include <l4/sys/cxx/ipc_iface>
30 
31 namespace L4 {
32 
42 class L4_EXPORT Scheduler :
43  public Kobject_t<Scheduler, Icu, L4_PROTO_SCHEDULER,
44  Type_info::Demand_t<1> >
45 {
46 public:
47  // ABI function for 'info' call
49  l4_msgtag_t, info, (l4_umword_t gran_offset, l4_umword_t *map,
50  l4_umword_t *cpu_max));
51 
67  l4_utcb_t *utcb = l4_utcb()) const throw()
68  {
69  l4_umword_t max = 0;
70  l4_msgtag_t t =
71  info_t::call(c(), cpus->gran_offset, &cpus->map, &max, utcb);
72  if (cpu_max) *cpu_max = max;
73  return t;
74  }
75 
98  l4_msgtag_t, run_thread, (Ipc::Cap<Thread> thread, l4_sched_param_t const &sp));
99 
127  l4_msgtag_t, idle_time, (l4_sched_cpu_set_t const &cpus,
128  l4_kernel_clock_t *us));
129 
139  bool is_online(l4_umword_t cpu, l4_utcb_t *utcb = l4_utcb()) const throw()
140  { return l4_scheduler_is_online_u(cap(), cpu, utcb); }
141 
143 };
144 }
Capability type for RPC interfaces (see L4::Cap<T>).
Definition: ipc_types:541
Run a thread on this scheduler.
Definition: scheduler.h:204
l4_umword_t gran_offset
Combination of granularity and offset.
Definition: scheduler.h:58
L4 low-level kernel interface.
bool is_online(l4_umword_t cpu, l4_utcb_t *utcb=l4_utcb()) const
Query if a CPU is online.
Definition: scheduler:139
#define L4_INLINE_RPC_OP(op, res, name, args, attr...)
Define an inline RPC call with specific opcode (type and callable).
Definition: ipc_iface:473
Scheduler parameter set.
Definition: scheduler.h:120
l4_umword_t map
Bitmap of CPUs.
Definition: scheduler.h:63
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition: utcb.h:67
Interrupt controller.
Scheduler object functions.
L4::Cap related definitions.
T1 max(T1 a, T1 b)
Get the maximum of a and b.
Definition: minmax:46
Query idle time for the scheduler.
Definition: scheduler.h:205
l4_msgtag_t info(l4_umword_t *cpu_max, l4_sched_cpu_set_t *cpus, l4_utcb_t *utcb=l4_utcb()) const
Get scheduler information.
Definition: scheduler:66
Query infos about the scheduler.
Definition: scheduler.h:203
List of RPCs typically used for kernel interfaces.
Definition: __typeinfo.h:475
unsigned long l4_umword_t
Unsigned machine word.
Definition: l4int.h:52
l4_uint64_t l4_kernel_clock_t
Kernel clock type.
Definition: l4int.h:65
Interface Definition Language.
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Definition: utcb.h:340
Helper class to create an L4Re interface class that is derived from a single base class...
Definition: __typeinfo.h:759
Message tag data structure.
Definition: types.h:159
CPU sets.
Definition: scheduler.h:44
C++ interface of the Scheduler kernel object.
Definition: scheduler:42
#define L4_INLINE_RPC_NF_OP(op, res, name, args...)
Define an inline RPC call type with specific opcode (the type only, no callable). ...
Definition: ipc_iface:442