Loading...
Searching...
No Matches
scheduler
Go to the documentation of this file.
// vi:set ft=cpp: -*- Mode: C++ -*-
/*
* (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
* Alexander Warg <warg@os.inf.tu-dresden.de>
* economic rights: Technische Universität Dresden (Germany)
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include <l4/sys/icu>
#include <l4/sys/scheduler.h>
#include <l4/sys/capability>
#include <l4/sys/cxx/ipc_iface>
namespace L4 {
class L4_EXPORT Scheduler :
public Kobject_t<Scheduler, Icu, L4_PROTO_SCHEDULER,
Type_info::Demand_t<1> >
{
public:
// ABI function for 'info' call
L4_INLINE_RPC_NF_OP(L4_SCHEDULER_INFO_OP,
l4_msgtag_t, info, (l4_umword_t gran_offset, l4_umword_t *map,
l4_umword_t *cpu_max, l4_umword_t *sched_classes));
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
{
l4_umword_t max = 0;
l4_umword_t sc = 0;
l4_msgtag_t t =
info_t::call(c(), cpus->gran_offset, &cpus->map, &max, &sc, utcb);
if (cpu_max)
*cpu_max = max;
if (sched_classes)
*sched_classes = sc;
return t;
}
L4_INLINE_RPC_OP(L4_SCHEDULER_RUN_THREAD_OP,
l4_msgtag_t, run_thread, (Ipc::Cap<Thread> thread, l4_sched_param_t const &sp));
L4_INLINE_RPC_OP(L4_SCHEDULER_IDLE_TIME_OP,
l4_msgtag_t, idle_time, (l4_sched_cpu_set_t const &cpus,
l4_kernel_clock_t *us));
bool is_online(l4_umword_t cpu, l4_utcb_t *utcb = l4_utcb()) const noexcept
{ return l4_scheduler_is_online_u(cap(), cpu, utcb); }
typedef L4::Typeid::Rpcs_sys<info_t, run_thread_t, idle_time_t> Rpcs;
};
}
capability
L4::Cap related definitions.
L4::Ipc::Cap
Capability type for RPC interfaces (see L4::Cap<T>).
Definition ipc_types:699
L4::Kobject_t
Helper class to create an L4Re interface class that is derived from a single base class.
Definition __typeinfo.h:750
L4::Kobject_t< Scheduler, Icu, L4_PROTO_SCHEDULER, Type_info::Demand_t< 1 > >::c
L4::Cap< Class > c() const noexcept
Definition __typeinfo.h:769
L4::Kobject::cap
l4_cap_idx_t cap() const noexcept
Return capability selector.
Definition kobject:69
L4::Scheduler
C++ interface of the Scheduler kernel object, see Scheduler for the C interface.
Definition scheduler:49
L4::Scheduler::idle_time
l4_msgtag_t idle_time(l4_sched_cpu_set_t const &cpus, l4_kernel_clock_t *us)
Query the idle time (in µs) of a CPU.
L4::Scheduler::is_online
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::Scheduler::info
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
L4::Scheduler::run_thread
l4_msgtag_t run_thread(Ipc::Cap< Thread > thread, l4_sched_param_t const &sp)
Run a thread on a Scheduler.
l4_umword_t
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
l4_kernel_clock_t
l4_uint64_t l4_kernel_clock_t
Kernel clock type.
Definition l4int.h:53
L4_SCHEDULER_RUN_THREAD_OP
@ L4_SCHEDULER_RUN_THREAD_OP
Run a thread on this scheduler.
Definition scheduler.h:272
L4_SCHEDULER_IDLE_TIME_OP
@ L4_SCHEDULER_IDLE_TIME_OP
Query idle time for the scheduler.
Definition scheduler.h:273
L4_SCHEDULER_INFO_OP
@ L4_SCHEDULER_INFO_OP
Query infos about the scheduler.
Definition scheduler.h:271
l4_utcb_t
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:56
l4_utcb
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Definition utcb.h:346
L4_EXPORT
#define L4_EXPORT
Attribute to mark functions, variables, and data types as being exported from a library.
Definition compiler.h:214
icu
Interrupt controller.
ipc_iface
Interface Definition Language.
L4_INLINE_RPC_NF_OP
#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:466
L4_INLINE_RPC_OP
#define L4_INLINE_RPC_OP(op, res, name, args, attr...)
Define an inline RPC call with specific opcode (type and callable).
Definition ipc_iface:497
L4
L4 low-level kernel interface.
Definition l4sys-l4f-groups.dox:50
scheduler.h
Scheduler object functions.
L4::Typeid::Rpcs_sys
List of RPCs typically used for kernel interfaces.
Definition __typeinfo.h:465
l4_msgtag_t
Message tag data structure.
Definition types.h:154
l4_sched_cpu_set_t
CPU sets.
Definition scheduler.h:59
l4_sched_cpu_set_t::gran_offset
l4_umword_t gran_offset
Combination of granularity and offset.
Definition scheduler.h:72
l4_sched_cpu_set_t::map
l4_umword_t map
Bitmap of CPUs.
Definition scheduler.h:77
l4_sched_param_t
Scheduler parameter set.
Definition scheduler.h:174