L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
mem_alloc_impl.h
Go to the documentation of this file.
1
5/*
6 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
7 * Alexander Warg <warg@os.inf.tu-dresden.de>
8 * economic rights: Technische Universität Dresden (Germany)
9 *
10 * License: see LICENSE.spdx (in this directory or the directories above)
11 */
12#include <l4/re/mem_alloc>
13#include <l4/re/mem_alloc-sys.h>
14#include <l4/re/dataspace>
15#include <l4/re/error_helper>
16
17#include <l4/sys/factory>
18
19
20namespace L4Re
21{
22
23long
25 L4::Cap<Dataspace> mem, unsigned long flags,
26 unsigned long align, l4_addr_t paddr) const noexcept
27{
28 L4::Cap<L4::Factory> f(cap());
29 auto call = f->create(mem, L4Re::Dataspace::Protocol);
30 call << l4_mword_t(size)
31 << l4_umword_t(flags)
32 << l4_umword_t(align);
33 if (flags & Fixed_paddr)
34 call << l4_umword_t(paddr);
35 return l4_error(call);
36}
37
38};
long alloc(long size, L4::Cap< Dataspace > mem, unsigned long flags=0, unsigned long align=0, l4_addr_t paddr=0) const noexcept
Allocate anonymous memory.
C++ interface for capabilities.
Definition capability.h:219
Dataspace interface.
Error helper.
Common factory related definitions.
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
unsigned long l4_addr_t
Address type.
Definition l4int.h:34
signed long l4_mword_t
Signed machine word.
Definition l4int.h:37
long l4_error(l4_msgtag_t tag) L4_NOTHROW
Get IPC error code if any or message tag label otherwise for an IPC call.
Definition ipc.h:646
Memory allocator protocol definitions.
Memory allocator interface.
L4Re C++ Interfaces.
Definition cmd_control:14