L4Re - L4 Runtime Environment
mem_alloc
Go to the documentation of this file.
1 // -*- Mode: C++ -*-
2 // vim:ft=cpp
7 /*
8  * Copyright (C) 2015 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  * This file is part of TUD:OS and distributed under the terms of the
18  * GNU General Public License 2.
19  * Please see the COPYING-GPL-2 file for details.
20  *
21  * As a special exception, you may use this file as part of a free software
22  * library without restriction. Specifically, if other files instantiate
23  * templates or use macros or inline functions from this file, or you compile
24  * this file and link it with other files to produce an executable, this
25  * file does not by itself cause the resulting executable to be covered by
26  * the GNU General Public License. This exception does not however
27  * invalidate any other reasons why the executable file might be covered by
28  * the GNU General Public License.
29  */
30 #pragma once
31 
32 #include <l4/sys/capability>
33 #include <l4/sys/factory>
34 
35 namespace L4Re {
36 class Dataspace;
37 
38 // MISSING:
39 // * alignment constraints
40 // * shall we support superpages in noncont memory?
41 
61 class L4_EXPORT Mem_alloc :
62  public L4::Kobject_t<Mem_alloc, L4::Factory, L4::PROTO_EMPTY>
63 {
64 public:
72  {
73  Continuous = 0x01,
74  Pinned = 0x02,
75  Super_pages = 0x04,
76  };
77 
100  long alloc(long size, L4::Cap<Dataspace> mem,
101  unsigned long flags = 0, unsigned long align = 0) const throw();
102 
115  /* Deprecation message added Q4 2016 */
116  long free(L4::Cap<Dataspace> mem) const throw()
117  L4_DEPRECATED("This function is an empty stub and remains for backward compatibility only. Check documentation for details.");
118 
119 };
120 
121 };
Memory allocation interface.
Definition: mem_alloc:61
L4 low-level kernel interface.
L4Re C++ Interfaces.
Definition: cmd_control:15
L4::Cap related definitions.
Mem_alloc_flags
Flags for the allocator.
Definition: mem_alloc:71
Interface for memory-like objects.
Definition: dataspace:59
Helper class to create an L4Re interface class that is derived from a single base class...
Definition: __typeinfo.h:759
Common factory related definitions.
C++ interface for capabilities.
Definition: capability.h:13
#define L4_DEPRECATED(s)
Mark symbol deprecated.
Definition: compiler.h:239