+//-------------------------------------------------------------
+//---------L4 memory allocation--------------------------------
+/*------from examples/libs/l4re/c/ma+rm.c example-------------*/
+// static int allocate_mem(unsigned long size_in_bytes, unsigned long flags,
+// void **virt_addr)
+// {
+// int r;
+// l4re_ds_t ds;
+
+// /* Allocate a free capability index for our data space */
+// ds = l4re_util_cap_alloc();
+// if (l4_is_invalid_cap(ds))
+// return -L4_ENOMEM;
+
+// size_in_bytes = l4_trunc_page(size_in_bytes);
+
+// /* Allocate memory via a dataspace */
+// if ((r = l4re_ma_alloc(size_in_bytes, ds, flags)))
+// return r;
+
+// /* Make the dataspace visible in our address space */
+// *virt_addr = 0;
+// if ((r = l4re_rm_attach(virt_addr, size_in_bytes,
+// L4RE_RM_SEARCH_ADDR, ds, 0,
+// flags & L4RE_MA_SUPER_PAGES
+// ? L4_SUPERPAGESHIFT : L4_PAGESHIFT)))
+// return r;
+
+// /* Done, virtual address is in virt_addr */
+// return 0;
+// }
+
+// /**
+// * \brief Free previously allocated memory.
+// *
+// * \param virt_addr Virtual address return by allocate_mem
+// *
+// * \return 0 on success, error code otherwise
+// */
+// static int free_mem(void *virt_addr)
+// {
+// int r;
+// l4re_ds_t ds;
+
+// /* Detach memory from our address space */
+// if ((r = l4re_rm_detach_ds(virt_addr, &ds)))
+// return r;
+
+// /* Free memory at our memory allocator */
+// if ((r = l4re_ma_free(ds)))
+// return r;