L4Re – L4 Runtime Environment
dataspace.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  * This file is part of TUD:OS and distributed under the terms of the
11  * GNU General Public License 2.
12  * Please see the COPYING-GPL-2 file for details.
13  *
14  * As a special exception, you may use this file as part of a free software
15  * library without restriction. Specifically, if other files instantiate
16  * templates or use macros or inline functions from this file, or you compile
17  * this file and link it with other files to produce an executable, this
18  * file does not by itself cause the resulting executable to be covered by
19  * the GNU General Public License. This exception does not however
20  * invalidate any other reasons why the executable file might be covered by
21  * the GNU General Public License.
22  */
23 #pragma once
24 
31 #include <l4/sys/types.h>
32 
34 
40 typedef l4_uint64_t l4re_ds_size_t;
41 typedef l4_uint64_t l4re_ds_offset_t;
42 typedef l4_uint64_t l4re_ds_map_addr_t;
43 typedef unsigned long l4re_ds_flags_t;
44 
49 typedef struct {
50  l4re_ds_size_t size;
51  l4re_ds_flags_t flags;
53 
59  L4RE_DS_F_R = L4_FPAGE_RO,
60  L4RE_DS_F_W = L4_FPAGE_W,
61  L4RE_DS_F_X = L4_FPAGE_X,
62  L4RE_DS_F_RW = L4_FPAGE_RW,
63  L4RE_DS_F_RX = L4_FPAGE_RX,
64  L4RE_DS_F_RWX = L4_FPAGE_RWX,
65 
66  L4RE_DS_F_RIGHTS_MASK = 0x0f,
67 
74 };
75 
81 L4_CV int
82 l4re_ds_map(l4re_ds_t ds,
83  l4re_ds_offset_t offset,
84  l4re_ds_flags_t flags,
85  l4re_ds_map_addr_t local_addr,
86  l4re_ds_map_addr_t min_addr,
87  l4re_ds_map_addr_t max_addr) L4_NOTHROW;
88 
94 L4_CV int
95 l4re_ds_map_region(l4re_ds_t ds,
96  l4re_ds_offset_t offset,
97  l4re_ds_flags_t flags,
98  l4re_ds_map_addr_t min_addr,
99  l4re_ds_map_addr_t max_addr) L4_NOTHROW;
100 
107 L4_CV long
108 l4re_ds_clear(l4re_ds_t ds, l4re_ds_offset_t offset,
109  l4re_ds_size_t size) L4_NOTHROW;
110 
116 L4_CV long
118  l4re_ds_offset_t offset,
119  l4re_ds_size_t size) L4_NOTHROW;
120 
126 L4_CV int
127 l4re_ds_copy_in(l4re_ds_t ds, l4re_ds_offset_t dst_offs,
128  l4re_ds_t src, l4re_ds_offset_t src_offs,
129  l4re_ds_size_t size) L4_NOTHROW;
130 
136 L4_CV l4re_ds_size_t
138 
143 L4_CV l4re_ds_flags_t
145 
150 L4_CV int
152 
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition: compiler.h:186
#define EXTERN_C_BEGIN
Start section with C types and functions.
Definition: compiler.h:190
#define EXTERN_C_END
End section with C types and functions.
Definition: compiler.h:191
int l4re_ds_info(l4re_ds_t ds, l4re_ds_stats_t *stats) L4_NOTHROW
l4_cap_idx_t l4re_ds_t
Dataspace type.
Definition: dataspace.h:39
l4re_ds_flags_t l4re_ds_flags(l4re_ds_t ds) L4_NOTHROW
long l4re_ds_allocate(l4re_ds_t ds, l4re_ds_offset_t offset, l4re_ds_size_t size) L4_NOTHROW
long l4re_ds_clear(l4re_ds_t ds, l4re_ds_offset_t offset, l4re_ds_size_t size) L4_NOTHROW
int l4re_ds_copy_in(l4re_ds_t ds, l4re_ds_offset_t dst_offs, l4re_ds_t src, l4re_ds_offset_t src_offs, l4re_ds_size_t size) L4_NOTHROW
l4re_ds_size_t l4re_ds_size(l4re_ds_t ds) L4_NOTHROW
l4re_ds_map_flags
Flags to specify the memory mapping type of a request.
Definition: dataspace.h:58
@ L4RE_DS_F_BUFFERABLE
request bufferable (write buffered) mappings
Definition: dataspace.h:70
@ L4RE_DS_F_NORMAL
request normal memory mapping
Definition: dataspace.h:68
@ L4RE_DS_F_CACHING_SHIFT
shift value for caching flags
Definition: dataspace.h:73
@ L4RE_DS_F_CACHING_MASK
mask for caching flags
Definition: dataspace.h:72
@ L4RE_DS_F_CACHEABLE
request normal memory mapping
Definition: dataspace.h:69
@ L4RE_DS_F_UNCACHEABLE
request uncacheable memory mappings
Definition: dataspace.h:71
unsigned long long l4_uint64_t
Unsigned 64bit value.
Definition: l4int.h:42
unsigned long l4_cap_idx_t
L4 Capability selector Type.
Definition: types.h:342
@ L4_FPAGE_X
Executable flex page.
Definition: __l4_fpage.h:111
@ L4_FPAGE_RWX
Read-write-execute flex page.
Definition: __l4_fpage.h:116
@ L4_FPAGE_RX
Read-execute flex page.
Definition: __l4_fpage.h:115
@ L4_FPAGE_RO
Read-only flex page
Definition: __l4_fpage.h:113
@ L4_FPAGE_RW
Read-write flex page.
Definition: __l4_fpage.h:114
@ L4_FPAGE_W
Writable flex page.
Definition: __l4_fpage.h:112
#define L4_CV
Define calling convention.
Definition: linkage.h:44
Common L4 ABI Data Types.
Information about the data space.
Definition: dataspace.h:49
l4re_ds_flags_t flags
flags
Definition: dataspace.h:51
l4re_ds_size_t size
size
Definition: dataspace.h:50