L4Re Operating System Framework
Interface and Usage Documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 * License: see LICENSE.spdx (in this directory or the directories above)
12 */
13#pragma once
14
15#include <l4/sys/icu>
16#include <l4/sys/scheduler.h>
17#include <l4/sys/capability>
18#include <l4/sys/cxx/ipc_iface>
19
20namespace L4 {
21
47 public Kobject_t<Scheduler, Icu, L4_PROTO_SCHEDULER,
48 Type_info::Demand_t<1> >
49{
50public:
51 // ABI function for 'info' call
53 l4_msgtag_t, info, (l4_umword_t gran_offset, l4_umword_t *map,
54 l4_umword_t *cpu_max, l4_umword_t *sched_classes));
55
75 l4_umword_t *sched_classes = nullptr,
76 l4_utcb_t *utcb = l4_utcb()) const noexcept
77 {
78 l4_umword_t max = 0;
79 l4_umword_t sc = 0;
80 l4_msgtag_t t =
81 info_t::call(c(), cpus->gran_offset, &cpus->map, &max, &sc, utcb);
82 if (cpu_max)
83 *cpu_max = max;
84 if (sched_classes)
85 *sched_classes = sc;
86 return t;
87 }
88
113 l4_msgtag_t, run_thread, (Ipc::Cap<Thread> thread, l4_sched_param_t const &sp));
114
142 l4_msgtag_t, idle_time, (l4_sched_cpu_set_t const &cpus,
144
154 bool is_online(l4_umword_t cpu, l4_utcb_t *utcb = l4_utcb()) const noexcept
155 { return l4_scheduler_is_online_u(cap(), cpu, utcb); }
156
158};
159}
L4::Cap related definitions.
Capability type for RPC interfaces (see L4::Cap<T>).
Definition ipc_types:699
Helper class to create an L4Re interface class that is derived from a single base class.
Definition __typeinfo.h:750
C++ interface of the Scheduler kernel object, see Scheduler for the C interface.
Definition scheduler:49
bool is_online(l4_umword_t cpu, l4_utcb_t *utcb=l4_utcb()) const noexcept
Query if a CPU is online.
Definition scheduler:154
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:74
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
l4_uint64_t l4_kernel_clock_t
Kernel clock type.
Definition l4int.h:53
@ L4_SCHEDULER_RUN_THREAD_OP
Run a thread on this scheduler.
Definition scheduler.h:272
@ L4_SCHEDULER_IDLE_TIME_OP
Query idle time for the scheduler.
Definition scheduler.h:273
@ L4_SCHEDULER_INFO_OP
Query infos about the scheduler.
Definition scheduler.h:271
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:56
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Definition utcb.h:346
#define L4_EXPORT
Attribute to mark functions, variables, and data types as being exported from a library.
Definition compiler.h:210
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:460
#define L4_INLINE_RPC_OP(op, res, name, args, attr...)
Define an inline RPC call with specific opcode (type and callable).
Definition ipc_iface:491
L4 low-level kernel interface.
List of RPCs typically used for kernel interfaces.
Definition __typeinfo.h:465
Message tag data structure.
Definition types.h:153
l4_umword_t gran_offset
Combination of granularity and offset.
Definition scheduler.h:72
l4_umword_t map
Bitmap of CPUs.
Definition scheduler.h:77
Scheduler parameter set.
Definition scheduler.h:174
Scheduler object functions.