Loading...
Searching...
No Matches
mem_alloc_impl.h
Go to the documentation of this file.
/*
* (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)
*/
#include <l4/re/mem_alloc>
#include <l4/re/mem_alloc-sys.h>
#include <l4/re/dataspace>
#include <l4/re/error_helper>
#include <l4/sys/factory>
namespace L4Re
{
long
Mem_alloc::alloc(long size,
L4::Cap<Dataspace> mem, unsigned long flags,
unsigned long align, l4_addr_t paddr) const noexcept
{
L4::Cap<L4::Factory> f(cap());
auto call = f->create(mem, L4Re::Dataspace::Protocol);
call << l4_mword_t(size)
<< l4_umword_t(flags)
<< l4_umword_t(align);
if (flags & Fixed_paddr)
call << l4_umword_t(paddr);
return l4_error(call);
}
};
L4Re::Mem_alloc::alloc
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.
Definition mem_alloc_impl.h:24
L4Re::Mem_alloc::Fixed_paddr
@ Fixed_paddr
Allocate at fixed physical address.
Definition mem_alloc:67
L4::Cap
C++ interface for capabilities.
Definition capability.h:224
L4::Kobject::cap
l4_cap_idx_t cap() const noexcept
Return capability selector.
Definition kobject:69
dataspace
Dataspace interface.
error_helper
Error helper.
factory
Common factory related definitions.
l4_umword_t
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
l4_addr_t
unsigned long l4_addr_t
Address type.
Definition l4int.h:34
l4_mword_t
signed long l4_mword_t
Signed machine word.
Definition l4int.h:37
l4_error
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
mem_alloc-sys.h
Memory allocator protocol definitions.
mem_alloc
Memory allocator interface.
L4Re
L4Re C++ Interfaces.
Definition cmd_control:14