Re: Question about dataspace

Adam Lackorzynski <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.devel
Message-ID <[email protected]>
On Tue May 13, 2014 at 17:45:46 -0800, Yuxin Ren wrote:
> For the unmapping stuff, can you tell me a little more in detail.
> I do not  understand the parameters of unmap function.

So the L4::Task::unmap() function takes two arguments. The first is a
flexpage which can be constructed with the l4_fpage helper, like this:
  l4_fpage(address, L4_LOG2_PAGESIZE, L4_FPAGE_RWX)
So in our case the fpage describes a piece of memory, with a start
(address) and size (L4_LOG2_PAGESIZE, given in log2) and attributes
(L4_FPAGE_RWX). For the unmapping, this yields to:
  l4_msgtag_t result;
  result = task->unmap(l4_fpage(address, L4_LOG2_PAGESIZE, L4_FPAGE_RWX),
                       L4_FP_ALL_SPACES);
  if (l4_error(result))
    // some error handling/message

So this means that this unmap call shall remove all access rights
(L4_FPAGE_RWX), for task and its childs (L4_FP_ALL_SPACES) from memory
region address to address + (1 << L4_LOG2_PAGESIZE) (what is just a
single page in our case).


HTH,
Adam
-- 
Adam                 [email protected]
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.