os: Refine Attached_rom_dataspace::update

This commit is contained in:
Norman Feske 2014-04-28 19:50:01 +02:00
parent 34dd7f982c
commit 3e4eb0d135
1 changed files with 14 additions and 0 deletions

View File

@ -40,6 +40,20 @@ class Genode::Attached_rom_dataspace
*/
void _try_attach()
{
/*
* Normally, '_ds.construct()' would implicitly destruct an
* existing dataspace upon re-construction. However, we have to
* explicitly destruct the original dataspace prior calling
* '_rom.dataspace()'.
*
* The ROM server may destroy the original dataspace when the
* 'dataspace()' function is called. In this case, all existing
* mappings of the dataspace will be flushed by core. A destruction
* of 'Attached_dataspace' after this point will attempt to detach
* the already flushed mappings, thereby producing error messages
* at core.
*/
_ds.destruct();
try { _ds.construct(_rom.dataspace()); }
catch (Attached_dataspace::Invalid_dataspace) { }
}