L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
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
31namespace L4 {
32
58 public Kobject_t<Scheduler, Icu, L4_PROTO_SCHEDULER,
59 Type_info::Demand_t<1> >
60{
61public:
62 // ABI function for 'info' call
64 l4_msgtag_t, info, (l4_umword_t gran_offset, l4_umword_t *map,
65 l4_umword_t *cpu_max, l4_umword_t *sched_classes));
66
86 l4_umword_t *sched_classes = nullptr,
87 l4_utcb_t *utcb = l4_utcb()) const noexcept
88 {
89 l4_umword_t max = 0;
90 l4_umword_t sc = 0;
91 l4_msgtag_t t =
92 info_t::call(c(), cpus->gran_offset, &cpus->map, &max, &sc, utcb);
93 if (cpu_max)
94 *cpu_max = max;
95 if (sched_classes)
96 *sched_classes = sc;
97 return t;
98 }
99
124 l4_msgtag_t, run_thread, (Ipc::Cap<Thread> thread, l4_sched_param_t const &sp));
125
153 l4_msgtag_t, idle_time, (l4_sched_cpu_set_t const &cpus,
155
165 bool is_online(l4_umword_t cpu, l4_utcb_t *utcb = l4_utcb()) const noexcept
166 { return l4_scheduler_is_online_u(cap(), cpu, utcb); }
167
169};
170}
L4::Cap related definitions.
Capability type for RPC interfaces (see L4::Cap<T>).
Definition ipc_types:563
Helper class to create an L4Re interface class that is derived from a single base class.
Definition __typeinfo.h:761
C++ interface of the Scheduler kernel object, see Scheduler for the C interface.
Definition scheduler:60
bool is_online(l4_umword_t cpu, l4_utcb_t *utcb=l4_utcb()) const noexcept
Query if a CPU is online.
Definition scheduler:165
l4_msgtag_t info(l4_umword_t *cpu_max, l4_sched_cpu_set_t *cpus, l4_umword_t *sched_classes=nullptr, l4_utcb_t *utcb=l4_utcb()) const noexcept
Get scheduler information.
Definition scheduler:85
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:51
l4_uint64_t l4_kernel_clock_t
Kernel clock type.
Definition l4int.h:64
@ L4_SCHEDULER_RUN_THREAD_OP
Run a thread on this scheduler.
Definition scheduler.h:274
@ L4_SCHEDULER_IDLE_TIME_OP
Query idle time for the scheduler.
Definition scheduler.h:275
@ L4_SCHEDULER_INFO_OP
Query infos about the scheduler.
Definition scheduler.h:273
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:67
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Definition utcb.h:340
#define L4_EXPORT
Attribute to mark functions, variables, and data types as being exported from a library.
Definition compiler.h:231
Interrupt controller.
Interface Definition Language.
#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:453
#define L4_INLINE_RPC_OP(op, res, name, args, attr...)
Define an inline RPC call with specific opcode (type and callable).
Definition ipc_iface:484
L4 low-level kernel interface.
Definition io_regblock.h:19
List of RPCs typically used for kernel interfaces.
Definition __typeinfo.h:476
Message tag data structure.
Definition types.h:164
l4_umword_t gran_offset
Combination of granularity and offset.
Definition scheduler.h:83
l4_umword_t map
Bitmap of CPUs.
Definition scheduler.h:88
Scheduler parameter set.
Definition scheduler.h:185
Scheduler object functions.