90 |
size_t amount; |
size_t amount; |
91 |
int i; |
int i; |
92 |
|
|
93 |
/* We require at least three arguments (in addition to the cap id): |
/* We require three arguments (in addition to the cap id): the |
94 |
the flags, the start and the size. */ |
flags, the start and the size. */ |
95 |
if (l4_untyped_words (l4_msg_msg_tag (ctx->msg)) != 4) |
if (l4_untyped_words (l4_msg_msg_tag (ctx->msg)) != 4) |
96 |
{ |
{ |
97 |
debug ("incorrect number of arguments passed. require 4 but got %d\n", |
debug ("incorrect number of arguments passed. require 4 but got %d\n", |
143 |
size_t size = l4_msg_word (ctx->msg, 2); |
size_t size = l4_msg_word (ctx->msg, 2); |
144 |
struct frame_entry *fe; |
struct frame_entry *fe; |
145 |
|
|
146 |
/* We require at least two arguments (in addition to the cap id): |
/* We require two arguments (in addition to the cap id): the start |
147 |
the start and the size. */ |
and the size. */ |
148 |
if (l4_untyped_words (l4_msg_msg_tag (ctx->msg)) != 3) |
if (l4_untyped_words (l4_msg_msg_tag (ctx->msg)) != 3) |
149 |
{ |
{ |
150 |
debug ("incorrect number of arguments passed. require 3 but got %d\n", |
debug ("incorrect number of arguments passed. require 3 but got %d\n", |
261 |
{ |
{ |
262 |
struct container *container = hurd_cap_obj_to_user (struct container *, |
struct container *container = hurd_cap_obj_to_user (struct container *, |
263 |
ctx->obj); |
ctx->obj); |
264 |
uintptr_t index = l4_page_trunc (l4_msg_word (ctx->msg, 1)); |
l4_word_t flags = l4_msg_word (ctx->msg, 1); |
265 |
l4_word_t rights = l4_msg_word (ctx->msg, 1) & 0x7; |
uintptr_t vaddr = l4_msg_word (ctx->msg, 2); |
266 |
size_t size = l4_page_round (l4_msg_word (ctx->msg, 2)); |
uintptr_t index = l4_msg_word (ctx->msg, 3); |
267 |
uintptr_t vaddr = l4_page_trunc (l4_msg_word (ctx->msg, 3)); |
size_t size = l4_msg_word (ctx->msg, 4); |
268 |
int nr_fpages; |
int nr_fpages; |
269 |
#define MAX_MAP_ITEMS ((L4_NUM_MRS - 1) / 2) |
#define MAX_MAP_ITEMS ((L4_NUM_MRS - 1) / 2) |
270 |
int i; |
int i; |
271 |
|
|
272 |
|
/* We require four arguments (in addition to the cap id). */ |
273 |
|
if (l4_untyped_words (l4_msg_msg_tag (ctx->msg)) != 5) |
274 |
|
{ |
275 |
|
debug ("incorrect number of arguments passed. require 5 but got %d\n", |
276 |
|
l4_untyped_words (l4_msg_msg_tag (ctx->msg))); |
277 |
|
l4_msg_clear (ctx->msg); |
278 |
|
return EINVAL; |
279 |
|
} |
280 |
|
|
281 |
l4_msg_clear (ctx->msg); |
l4_msg_clear (ctx->msg); |
282 |
|
|
283 |
|
/* SIZE must be a multiple of the minimum page size and VADDR must |
284 |
|
be aligned on a base page boundary. */ |
285 |
|
if ((size & (L4_MIN_PAGE_SIZE - 1)) != 0 |
286 |
|
|| (vaddr & (L4_MIN_PAGE_SIZE - 1)) != 0) |
287 |
|
return EINVAL; |
288 |
|
|
289 |
pthread_mutex_lock (&container->lock); |
pthread_mutex_lock (&container->lock); |
290 |
|
|
329 |
assert (nr_fpages > 0); |
assert (nr_fpages > 0); |
330 |
|
|
331 |
/* Set the desired permissions. */ |
/* Set the desired permissions. */ |
332 |
l4_set_rights (&fpages[i], rights); |
l4_set_rights (&fpages[i], flags); |
333 |
|
|
334 |
/* Add the mad item to the message. */ |
/* Add the mad item to the message. */ |
335 |
map_item = l4_map_item (fpages[i], vaddr); |
map_item = l4_map_item (fpages[i], vaddr); |
376 |
l4_fpage_t fpages[L4_FPAGE_SPAN_MAX]; |
l4_fpage_t fpages[L4_FPAGE_SPAN_MAX]; |
377 |
int i; |
int i; |
378 |
|
|
379 |
|
/* We require five arguments (in addition to the cap id). */ |
380 |
|
if (l4_untyped_words (l4_msg_msg_tag (ctx->msg)) != 6) |
381 |
|
{ |
382 |
|
debug ("incorrect number of arguments passed. require 6 but got %d\n", |
383 |
|
l4_untyped_words (l4_msg_msg_tag (ctx->msg))); |
384 |
|
l4_msg_clear (ctx->msg); |
385 |
|
return EINVAL; |
386 |
|
} |
387 |
|
|
388 |
l4_msg_clear (ctx->msg); |
l4_msg_clear (ctx->msg); |
389 |
|
|
390 |
if (ctx->handle == dest_cont_handle) |
if (ctx->handle == dest_cont_handle) |