L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
mem_alloc
Go to the documentation of this file.
1// -*- Mode: C++ -*-
2// vim:ft=cpp
7/*
8 * Copyright (C) 2014-2016, 2019, 2021, 2024 Kernkonzept GmbH.
9 * Author(s): Alexander Warg <alexander.warg@kernkonzept.com>
10 */
11/*
12 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
13 * Alexander Warg <warg@os.inf.tu-dresden.de>,
14 * Torsten Frenzel <frenzel@os.inf.tu-dresden.de>
15 * economic rights: Technische Universität Dresden (Germany)
16 *
17 * License: see LICENSE.spdx (in this directory or the directories above)
18 */
19#pragma once
20
21#include <l4/re/protocols.h>
22#include <l4/sys/capability>
23#include <l4/sys/cxx/ipc_iface>
24#include <l4/sys/factory>
25
26namespace L4Re {
27class Dataspace;
28
29// MISSING:
30// * alignment constraints
31// * shall we support superpages in noncont memory?
32
53 public L4::Kobject_t<Mem_alloc, L4::Factory, L4RE_PROTO_MEM_ALLOC>
54{
55public:
63 {
64 Continuous = 0x01,
65 Pinned = 0x02,
66 Super_pages = 0x04,
67 Fixed_paddr = 0x08,
69 };
70
128
157 long alloc(long size, L4::Cap<Dataspace> mem,
158 unsigned long flags = 0, unsigned long align = 0,
159 l4_addr_t paddr = 0) const noexcept;
160
169 L4_INLINE_RPC(long, info, (Stats &stats));
170
171 typedef L4::Typeid::Rpcs<info_t> Rpcs;
172};
173
174};
L4::Cap related definitions.
Memory allocation interface.
Definition mem_alloc:54
Mem_alloc_flags
Flags for the allocator.
Definition mem_alloc:63
C++ interface for capabilities.
Definition capability.h:224
Helper class to create an L4Re interface class that is derived from a single base class.
Definition __typeinfo.h:750
Common factory related definitions.
unsigned int l4_size_t
Unsigned size type.
Definition l4int.h:24
unsigned long l4_addr_t
Address type.
Definition l4int.h:34
#define L4_EXPORT
Attribute to mark functions, variables, and data types as being exported from a library.
Definition compiler.h:210
Interface Definition Language.
#define L4_INLINE_RPC(res, name, args, attr...)
Define an inline RPC call (type and callable).
Definition ipc_iface:482
L4Re C++ Interfaces.
Definition cmd_control:14
L4 low-level kernel interface.
L4Re Protocol Constants (C version)
Statistics about memory-allocator.
Definition mem_alloc:75
l4_size_t quota
Memory quota of this allocator.
Definition mem_alloc:83
l4_size_t mem_limit
Maximum amount of memory that can be allocated by this allocator.
Definition mem_alloc:102
l4_size_t quota_used
Amount of currently used quota of this allocator.
Definition mem_alloc:94
l4_size_t mem_used
Amount of currently allocated memory.
Definition mem_alloc:116
l4_size_t mem_free
Amount of memory that is still available for allocation.
Definition mem_alloc:126
Standard list of RPCs of an interface.
Definition __typeinfo.h:428