mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
parent
6fa87e62dd
commit
25a7ea3d40
@ -44,7 +44,7 @@ class Genode::Platform_pd : public Address_space
|
||||
|
||||
Cnode _cspace_cnode_1st;
|
||||
|
||||
Lazy_volatile_object<Cnode> _cspace_cnode_2nd[1UL << CSPACE_SIZE_LOG2_1ST];
|
||||
Constructible<Cnode> _cspace_cnode_2nd[1UL << CSPACE_SIZE_LOG2_1ST];
|
||||
|
||||
Native_capability _parent;
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
/* Genode includes */
|
||||
#include <util/bit_allocator.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <base/log.h>
|
||||
#include <base/thread.h>
|
||||
#include <base/session_label.h>
|
||||
@ -101,7 +101,7 @@ class Genode::Vm_space
|
||||
* objects (where we cannot pass any arguments to the
|
||||
* constructors of the individual objects).
|
||||
*/
|
||||
Lazy_volatile_object<Cnode> _cnode;
|
||||
Constructible<Cnode> _cnode;
|
||||
|
||||
public:
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#ifndef _INCLUDE__BASE__ATTACHED_ROM_DATASPACE_H_
|
||||
#define _INCLUDE__BASE__ATTACHED_ROM_DATASPACE_H_
|
||||
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <util/xml_node.h>
|
||||
#include <base/attached_dataspace.h>
|
||||
#include <rom_session/connection.h>
|
||||
@ -35,7 +35,7 @@ class Genode::Attached_rom_dataspace
|
||||
* always be valid once constructed, a 'Attached_rom_dataspace' has
|
||||
* to handle the validity of the dataspace.
|
||||
*/
|
||||
Lazy_volatile_object<Attached_dataspace> _ds;
|
||||
Constructible<Attached_dataspace> _ds;
|
||||
|
||||
/**
|
||||
* Try to attach the ROM module, ignore invalid dataspaces
|
||||
|
@ -311,7 +311,7 @@ class Genode::Child : protected Rpc_object<Parent>,
|
||||
Env_connection<Rom_connection> _binary { _policy,
|
||||
_id_space, Parent::Env::binary(), _policy.binary_name() };
|
||||
|
||||
Lazy_volatile_object<Env_connection<Rom_connection> > _linker { _policy,
|
||||
Constructible<Env_connection<Rom_connection> > _linker { _policy,
|
||||
_id_space, Parent::Env::linker(), _policy.linker_name() };
|
||||
|
||||
/* call 'Child_policy::init' methods for the environment sessions */
|
||||
|
@ -14,7 +14,7 @@
|
||||
#ifndef _INCLUDE__BASE__ENTRYPOINT_H_
|
||||
#define _INCLUDE__BASE__ENTRYPOINT_H_
|
||||
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <util/noncopyable.h>
|
||||
#include <base/rpc_server.h>
|
||||
#include <base/signal.h>
|
||||
@ -68,12 +68,12 @@ class Genode::Entrypoint : Genode::Noncopyable
|
||||
|
||||
Env &_env;
|
||||
|
||||
Volatile_object<Rpc_entrypoint> _rpc_ep;
|
||||
Reconstructible<Rpc_entrypoint> _rpc_ep;
|
||||
|
||||
Signal_proxy_component _signal_proxy {*this};
|
||||
Capability<Signal_proxy> _signal_proxy_cap = _rpc_ep->manage(&_signal_proxy);
|
||||
|
||||
Volatile_object<Signal_receiver> _sig_rec;
|
||||
Reconstructible<Signal_receiver> _sig_rec;
|
||||
|
||||
void (*_suspended_callback) () = nullptr;
|
||||
void (*_resumed_callback) () = nullptr;
|
||||
@ -85,13 +85,13 @@ class Genode::Entrypoint : Genode::Noncopyable
|
||||
* resume mechanism.
|
||||
*/
|
||||
void _handle_suspend() { }
|
||||
Lazy_volatile_object<Genode::Signal_handler<Entrypoint>> _suspend_dispatcher;
|
||||
Constructible<Genode::Signal_handler<Entrypoint>> _suspend_dispatcher;
|
||||
|
||||
void _dispatch_signal(Signal &sig);
|
||||
|
||||
void _process_incoming_signals();
|
||||
|
||||
Lazy_volatile_object<Signal_proxy_thread> _signal_proxy_thread;
|
||||
Constructible<Signal_proxy_thread> _signal_proxy_thread;
|
||||
|
||||
friend class Startup;
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#define _INCLUDE__BASE__HEAP_H_
|
||||
|
||||
#include <util/list.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <ram_session/ram_session.h>
|
||||
#include <region_map/region_map.h>
|
||||
#include <base/allocator_avl.h>
|
||||
@ -71,7 +71,7 @@ class Genode::Heap : public Allocator
|
||||
};
|
||||
|
||||
Lock _lock;
|
||||
Volatile_object<Allocator_avl> _alloc; /* local allocator */
|
||||
Reconstructible<Allocator_avl> _alloc; /* local allocator */
|
||||
Dataspace_pool _ds_pool; /* list of dataspaces */
|
||||
size_t _quota_limit;
|
||||
size_t _quota_used;
|
||||
|
@ -83,7 +83,7 @@ class Genode::Local_connection : Local_connection_base
|
||||
|
||||
typedef typename CONNECTION::Session_type SESSION;
|
||||
|
||||
Lazy_volatile_object <typename SESSION::Client> _client;
|
||||
Constructible <typename SESSION::Client> _client;
|
||||
|
||||
public:
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
#include <util/xml_generator.h>
|
||||
#include <util/list.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <session/capability.h>
|
||||
#include <base/id_space.h>
|
||||
#include <base/env.h>
|
||||
@ -60,17 +60,17 @@ class Genode::Session_state : public Parent::Client, public Parent::Server,
|
||||
|
||||
Factory *_factory = nullptr;
|
||||
|
||||
Volatile_object<Id_space<Parent::Client>::Element> _id_at_client;
|
||||
Reconstructible<Id_space<Parent::Client>::Element> _id_at_client;
|
||||
|
||||
Args _args;
|
||||
Affinity _affinity;
|
||||
|
||||
public:
|
||||
|
||||
Lazy_volatile_object<Id_space<Parent::Server>::Element> id_at_server;
|
||||
Constructible<Id_space<Parent::Server>::Element> id_at_server;
|
||||
|
||||
/* ID for session requests towards the parent */
|
||||
Lazy_volatile_object<Id_space<Parent::Client>::Element> id_at_parent;
|
||||
Constructible<Id_space<Parent::Client>::Element> id_at_parent;
|
||||
|
||||
Parent::Client parent_client;
|
||||
|
||||
|
171
repos/base/include/util/reconstructible.h
Normal file
171
repos/base/include/util/reconstructible.h
Normal file
@ -0,0 +1,171 @@
|
||||
/*
|
||||
* \brief Utility for in-place (re-)construction of objects
|
||||
* \author Norman Feske
|
||||
* \date 2014-01-10
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2014 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__UTIL__RECONSTRUCTIBLE_H_
|
||||
#define _INCLUDE__UTIL__RECONSTRUCTIBLE_H_
|
||||
|
||||
#include <util/construct_at.h>
|
||||
#include <base/stdint.h>
|
||||
#include <util/noncopyable.h>
|
||||
|
||||
namespace Genode {
|
||||
template<typename> class Reconstructible;
|
||||
template<typename> class Constructible;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Place holder for an object to be repeatedly constructed and destructed
|
||||
*
|
||||
* This class template acts as a smart pointer that refers to an object
|
||||
* contained within the smart pointer itself. The contained object may be
|
||||
* repeatedly constructed and destructed while staying in the same place. This
|
||||
* is useful for replacing aggregated members during the lifetime of a compound
|
||||
* object.
|
||||
*
|
||||
* \param MT type
|
||||
*/
|
||||
template <typename MT>
|
||||
class Genode::Reconstructible : Noncopyable
|
||||
{
|
||||
private:
|
||||
|
||||
/**
|
||||
* Static reservation of memory for the embedded object
|
||||
*/
|
||||
char _space[sizeof(MT)] __attribute__((aligned(sizeof(addr_t))));
|
||||
|
||||
/**
|
||||
* True if the volatile object contains a constructed object
|
||||
*/
|
||||
bool _constructed = false;
|
||||
|
||||
template <typename... ARGS> void _do_construct(ARGS &&... args)
|
||||
{
|
||||
construct_at<MT>(_space, args...);
|
||||
_constructed = true;
|
||||
}
|
||||
|
||||
MT *_ptr() { return reinterpret_cast<MT *>(_space); }
|
||||
MT const *_const_ptr() const { return reinterpret_cast<MT const *>(_space); }
|
||||
|
||||
void _check_constructed() const
|
||||
{
|
||||
if (!_constructed)
|
||||
throw Deref_unconstructed_object();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* Dummy type used as a hook for 'Constructible' to bypass the
|
||||
* default constructor by invoking the 'Reconstructible(Lazy *)'
|
||||
* constructor.
|
||||
*/
|
||||
struct Lazy { };
|
||||
|
||||
/**
|
||||
* Constructor that omits the initial construction of the object
|
||||
*/
|
||||
Reconstructible(Lazy *) { }
|
||||
|
||||
public:
|
||||
|
||||
class Deref_unconstructed_object { };
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* The arguments are forwarded to the constructor of the embedded
|
||||
* object.
|
||||
*/
|
||||
template <typename... ARGS>
|
||||
Reconstructible(ARGS &&... args)
|
||||
{
|
||||
_do_construct(args...);
|
||||
}
|
||||
|
||||
~Reconstructible() { destruct(); }
|
||||
|
||||
/**
|
||||
* Construct new object in place
|
||||
*
|
||||
* If the 'Reconstructible' already hosts a constructed object, the old
|
||||
* object will be destructed first.
|
||||
*/
|
||||
template <typename... ARGS>
|
||||
void construct(ARGS &&... args)
|
||||
{
|
||||
destruct();
|
||||
_do_construct(args...);
|
||||
}
|
||||
|
||||
/**
|
||||
* Destruct object
|
||||
*/
|
||||
void destruct()
|
||||
{
|
||||
if (!_constructed)
|
||||
return;
|
||||
|
||||
/* invoke destructor */
|
||||
_ptr()->~MT();
|
||||
|
||||
_constructed = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true of volatile object contains a constructed object
|
||||
*/
|
||||
bool constructed() const { return _constructed; }
|
||||
|
||||
/**
|
||||
* Return true of volatile object contains a constructed object
|
||||
*
|
||||
* \deprecated use 'constructed' instead
|
||||
*/
|
||||
bool is_constructed() const { return constructed(); }
|
||||
|
||||
/**
|
||||
* Access contained object
|
||||
*/
|
||||
MT *operator -> () { _check_constructed(); return _ptr(); }
|
||||
MT const *operator -> () const { _check_constructed(); return _const_ptr(); }
|
||||
|
||||
MT &operator * () { _check_constructed(); return *_ptr(); }
|
||||
MT const &operator * () const { _check_constructed(); return *_const_ptr(); }
|
||||
|
||||
void print(Output &out) const
|
||||
{
|
||||
if (_constructed)
|
||||
_const_ptr()->print(out);
|
||||
else
|
||||
out.out_string("<unconstructed>");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Reconstructible object that holds no initially constructed object
|
||||
*/
|
||||
template <typename MT>
|
||||
struct Genode::Constructible : Reconstructible<MT>
|
||||
{
|
||||
template <typename... ARGS>
|
||||
Constructible(ARGS &&... args)
|
||||
:
|
||||
Reconstructible<MT>((typename Reconstructible<MT>::Lazy *)nullptr)
|
||||
{ }
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__UTIL__RECONSTRUCTIBLE_H_ */
|
@ -2,6 +2,8 @@
|
||||
* \brief Utility for manual in-place construction of objects
|
||||
* \author Norman Feske
|
||||
* \date 2014-01-10
|
||||
*
|
||||
* \deprecated use 'util/reconstructible.h' instead
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -14,158 +16,23 @@
|
||||
#ifndef _INCLUDE__UTIL__VOLATILE_OBJECT_H_
|
||||
#define _INCLUDE__UTIL__VOLATILE_OBJECT_H_
|
||||
|
||||
#include <util/construct_at.h>
|
||||
#include <base/stdint.h>
|
||||
#include <util/noncopyable.h>
|
||||
#include <util/reconstructible.h>
|
||||
|
||||
#warning "'util/volatile_object.h' is deprecated, use 'util/reconstructible.h' instead (see https://github.com/genodelabs/genode/issues/2151)"
|
||||
|
||||
namespace Genode {
|
||||
template<typename> class Volatile_object;
|
||||
template<typename> class Lazy_volatile_object;
|
||||
|
||||
template <typename T>
|
||||
struct Volatile_object : Reconstructible<T>
|
||||
{
|
||||
using Reconstructible<T>::Reconstructible;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct Lazy_volatile_object : Constructible<T>
|
||||
{
|
||||
using Constructible<T>::Constructible;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Place holder for an object to be repeatedly constructed and destructed
|
||||
*
|
||||
* This class template acts as a smart pointer that refers to an object
|
||||
* contained within the smart pointer itself. The contained object may be
|
||||
* repeatedly constructed and destructed while staying in the same place. This
|
||||
* is useful for replacing aggregated members during the lifetime of a compound
|
||||
* object.
|
||||
*
|
||||
* \param MT type
|
||||
*/
|
||||
template <typename MT>
|
||||
class Genode::Volatile_object : Noncopyable
|
||||
{
|
||||
private:
|
||||
|
||||
/**
|
||||
* Static reservation of memory for the embedded object
|
||||
*/
|
||||
char _space[sizeof(MT)] __attribute__((aligned(sizeof(addr_t))));
|
||||
|
||||
/**
|
||||
* True if the volatile object contains a constructed object
|
||||
*/
|
||||
bool _constructed = false;
|
||||
|
||||
template <typename... ARGS> void _do_construct(ARGS &&... args)
|
||||
{
|
||||
construct_at<MT>(_space, args...);
|
||||
_constructed = true;
|
||||
}
|
||||
|
||||
MT *_ptr() { return reinterpret_cast<MT *>(_space); }
|
||||
MT const *_const_ptr() const { return reinterpret_cast<MT const *>(_space); }
|
||||
|
||||
void _check_constructed() const
|
||||
{
|
||||
if (!_constructed)
|
||||
throw Deref_unconstructed_object();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* Dummy type used as a hook for 'Lazy_volatile_object' to bypass the
|
||||
* default constructor by invoking the 'Volatile_object(Lazy *)'
|
||||
* constructor.
|
||||
*/
|
||||
struct Lazy { };
|
||||
|
||||
/**
|
||||
* Constructor that omits the initial construction of the object
|
||||
*/
|
||||
Volatile_object(Lazy *) { }
|
||||
|
||||
public:
|
||||
|
||||
class Deref_unconstructed_object { };
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* The arguments are forwarded to the constructor of the embedded
|
||||
* object.
|
||||
*/
|
||||
template <typename... ARGS>
|
||||
Volatile_object(ARGS &&... args)
|
||||
{
|
||||
_do_construct(args...);
|
||||
}
|
||||
|
||||
~Volatile_object() { destruct(); }
|
||||
|
||||
/**
|
||||
* Construct new object in place
|
||||
*
|
||||
* If the 'Volatile_object' already hosts a constructed object, the old
|
||||
* object will be destructed first.
|
||||
*/
|
||||
template <typename... ARGS>
|
||||
void construct(ARGS &&... args)
|
||||
{
|
||||
destruct();
|
||||
_do_construct(args...);
|
||||
}
|
||||
|
||||
/**
|
||||
* Destruct object
|
||||
*/
|
||||
void destruct()
|
||||
{
|
||||
if (!_constructed)
|
||||
return;
|
||||
|
||||
/* invoke destructor */
|
||||
_ptr()->~MT();
|
||||
|
||||
_constructed = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true of volatile object contains a constructed object
|
||||
*/
|
||||
bool constructed() const { return _constructed; }
|
||||
|
||||
/**
|
||||
* Return true of volatile object contains a constructed object
|
||||
*
|
||||
* \deprecated use 'constructed' instead
|
||||
*/
|
||||
bool is_constructed() const { return constructed(); }
|
||||
|
||||
/**
|
||||
* Access contained object
|
||||
*/
|
||||
MT *operator -> () { _check_constructed(); return _ptr(); }
|
||||
MT const *operator -> () const { _check_constructed(); return _const_ptr(); }
|
||||
|
||||
MT &operator * () { _check_constructed(); return *_ptr(); }
|
||||
MT const &operator * () const { _check_constructed(); return *_const_ptr(); }
|
||||
|
||||
void print(Output &out) const
|
||||
{
|
||||
if (_constructed)
|
||||
_const_ptr()->print(out);
|
||||
else
|
||||
out.out_string("<unconstructed>");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Volatile object that holds no initially constructed object
|
||||
*/
|
||||
template <typename MT>
|
||||
struct Genode::Lazy_volatile_object : Volatile_object<MT>
|
||||
{
|
||||
template <typename... ARGS>
|
||||
Lazy_volatile_object(ARGS &&... args)
|
||||
:
|
||||
Volatile_object<MT>((typename Volatile_object<MT>::Lazy *)0)
|
||||
{ }
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__UTIL__VOLATILE_OBJECT_H_ */
|
||||
|
@ -302,7 +302,7 @@ int main()
|
||||
Genode::size_t const ram_quota = platform()->ram_alloc()->avail() - 224*1024;
|
||||
log("", ram_quota / (1024*1024), " MiB RAM assigned to init");
|
||||
|
||||
static Volatile_object<Core_child>
|
||||
static Reconstructible<Core_child>
|
||||
init(services, *env()->ram_session(), env()->ram_session_cap(),
|
||||
ram_quota, core_cpu, core_cpu_cap);
|
||||
|
||||
|
@ -58,7 +58,7 @@ namespace {
|
||||
void block() { _sig_rec.wait_for_signal(); }
|
||||
};
|
||||
|
||||
Lazy_volatile_object<Blockade> _session_blockade;
|
||||
Constructible<Blockade> _session_blockade;
|
||||
|
||||
Env(Genode::Entrypoint &ep) : _ep(ep) { env_ptr = this; }
|
||||
|
||||
|
@ -96,7 +96,7 @@ class Log_console : public Console
|
||||
void reconnect()
|
||||
{
|
||||
/*
|
||||
* We cannot use a 'Volatile_object' because we have to skip
|
||||
* We cannot use a 'Reconstructible' because we have to skip
|
||||
* the object destruction inside a freshly forked process.
|
||||
* Otherwise, the attempt to destruct the capability contained
|
||||
* in the 'Log' object would result in an inconsistent ref counter
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <base/thread.h>
|
||||
#include <base/sleep.h>
|
||||
#include <base/trace/events.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
|
||||
/* base-internal includes */
|
||||
#include <base/internal/globals.h>
|
||||
@ -37,7 +37,7 @@ class Signal_handler_thread : Thread, Lock
|
||||
* thread because on some platforms (e.g., Fiasco.OC), the calling
|
||||
* thread context is used for implementing the signal-source protocol.
|
||||
*/
|
||||
Lazy_volatile_object<Signal_source_client> _signal_source;
|
||||
Constructible<Signal_source_client> _signal_source;
|
||||
|
||||
void entry()
|
||||
{
|
||||
@ -76,11 +76,11 @@ class Signal_handler_thread : Thread, Lock
|
||||
/*
|
||||
* The signal-handler thread will be constructed before global constructors are
|
||||
* called and, consequently, must not be a global static object. Otherwise, the
|
||||
* Lazy_volatile_object constructor will be executed twice.
|
||||
* 'Constructible' constructor will be executed twice.
|
||||
*/
|
||||
static Lazy_volatile_object<Signal_handler_thread> & signal_handler_thread()
|
||||
static Constructible<Signal_handler_thread> & signal_handler_thread()
|
||||
{
|
||||
static Lazy_volatile_object<Signal_handler_thread> inst;
|
||||
static Constructible<Signal_handler_thread> inst;
|
||||
return inst;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <base/env.h>
|
||||
#include <base/heap.h>
|
||||
#include <util/string.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
|
||||
/* base-internal includes */
|
||||
#include <base/internal/globals.h>
|
||||
|
@ -75,11 +75,11 @@ struct Linker::File
|
||||
*/
|
||||
struct Linker::Elf_file : File
|
||||
{
|
||||
Env &env;
|
||||
Lazy_volatile_object<Rom_connection> rom_connection;
|
||||
Rom_session_client rom;
|
||||
Ram_dataspace_capability ram_cap[Phdr::MAX_PHDR];
|
||||
bool const loaded;
|
||||
Env &env;
|
||||
Constructible<Rom_connection> rom_connection;
|
||||
Rom_session_client rom;
|
||||
Ram_dataspace_capability ram_cap[Phdr::MAX_PHDR];
|
||||
bool const loaded;
|
||||
|
||||
typedef String<64> Name;
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <region_map/client.h>
|
||||
#include <base/allocator_avl.h>
|
||||
#include <util/retry.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
|
||||
/* base-internal includes */
|
||||
#include <base/internal/page_size.h>
|
||||
@ -60,7 +60,7 @@ class Linker::Region_map
|
||||
|
||||
public:
|
||||
|
||||
typedef Lazy_volatile_object<Region_map> Constructible_region_map;
|
||||
typedef Constructible<Region_map> Constructible_region_map;
|
||||
|
||||
static Constructible_region_map &r();
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <base/exception.h>
|
||||
#include <base/env.h>
|
||||
#include <base/shared_object.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <util/fifo.h>
|
||||
#include <util/misc_math.h>
|
||||
#include <util/string.h>
|
||||
|
@ -89,7 +89,7 @@ class Linker::Elf_object : public Object, public Fifo<Elf_object>::Element
|
||||
/*
|
||||
* Optional ELF file, skipped for initial 'Ld' initialization
|
||||
*/
|
||||
Lazy_volatile_object<Elf_file> _elf_file;
|
||||
Constructible<Elf_file> _elf_file;
|
||||
|
||||
|
||||
bool _object_init(Object::Name const &name, Elf::Addr reloc_base)
|
||||
@ -557,9 +557,9 @@ class Linker::Config
|
||||
};
|
||||
|
||||
|
||||
static Genode::Lazy_volatile_object<Heap> &heap()
|
||||
static Genode::Constructible<Heap> &heap()
|
||||
{
|
||||
return *unmanaged_singleton<Lazy_volatile_object<Heap>>();
|
||||
return *unmanaged_singleton<Constructible<Heap>>();
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <base/component.h>
|
||||
#include <base/heap.h>
|
||||
#include <base/attached_rom_dataspace.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <cpu_session/connection.h>
|
||||
#include <cpu_thread/client.h>
|
||||
|
||||
@ -44,7 +44,7 @@ struct Helper : Thread
|
||||
|
||||
void entry()
|
||||
{
|
||||
Lazy_volatile_object<Helper> helper[CHILDREN];
|
||||
Constructible<Helper> helper[CHILDREN];
|
||||
|
||||
for (unsigned i = 0; i < CHILDREN; ++i)
|
||||
helper[i].construct(_env);
|
||||
@ -65,7 +65,7 @@ static void test_stack_alloc(Env &env)
|
||||
*/
|
||||
enum { HELPER = 10, CHILDREN = 9 };
|
||||
|
||||
Lazy_volatile_object<Helper<CHILDREN> > helper[HELPER];
|
||||
Constructible<Helper<CHILDREN> > helper[HELPER];
|
||||
|
||||
for (unsigned i = 0; i < HELPER; ++i) helper[i].construct(env);
|
||||
for (unsigned i = 0; i < HELPER; ++i) helper[i]->start();
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include <dataspace/capability.h>
|
||||
#include <framebuffer_session/framebuffer_session.h>
|
||||
#include <timer_session/connection.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <os/attached_dataspace.h>
|
||||
#include <os/attached_ram_dataspace.h>
|
||||
#include <os/attached_rom_dataspace.h>
|
||||
@ -78,7 +78,7 @@ class Framebuffer::Session_component : public Genode::Rpc_object<Session>
|
||||
{
|
||||
private:
|
||||
|
||||
template <typename T> using Lazy = Genode::Lazy_volatile_object<T>;
|
||||
template <typename T> using Lazy = Genode::Constructible<T>;
|
||||
|
||||
Driver _driver;
|
||||
Genode::Attached_rom_dataspace &_config;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/**
|
||||
/*
|
||||
* \brief Helper class to make the Genode Env globally available
|
||||
* \author Sebastian Sumpf
|
||||
* \date 2016-06-21
|
||||
@ -17,7 +17,7 @@
|
||||
#include <base/attached_rom_dataspace.h>
|
||||
#include <base/env.h>
|
||||
#include <base/heap.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
|
||||
namespace Lx_kit {
|
||||
class Env;
|
||||
|
@ -16,7 +16,7 @@
|
||||
#define _LX_KIT__INTERNAL__IO_PORT_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <io_port_session/client.h>
|
||||
|
||||
namespace Lx { class Io_port; }
|
||||
@ -25,10 +25,10 @@ class Lx::Io_port
|
||||
{
|
||||
private:
|
||||
|
||||
unsigned _base = 0;
|
||||
unsigned _size = 0;
|
||||
Genode::Io_port_session_capability _cap;
|
||||
Genode::Lazy_volatile_object<Genode::Io_port_session_client> _port;
|
||||
unsigned _base = 0;
|
||||
unsigned _size = 0;
|
||||
Genode::Io_port_session_capability _cap;
|
||||
Genode::Constructible<Genode::Io_port_session_client> _port;
|
||||
|
||||
bool _valid(unsigned port) {
|
||||
return _cap.valid() && port >= _base && port < _base + _size; }
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <base/tslab.h>
|
||||
#include <os/server.h>
|
||||
#include <timer_session/connection.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
|
||||
/* Linux kit includes */
|
||||
#include <lx_kit/internal/list.h>
|
||||
|
@ -27,15 +27,15 @@
|
||||
|
||||
#include <irq_session/connection.h>
|
||||
#include <util/list.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
|
||||
|
||||
namespace Platform { struct Device; }
|
||||
|
||||
struct Platform::Device : Platform::Abstract_device, Genode::List<Device>::Element
|
||||
{
|
||||
unsigned irq_num;
|
||||
Genode::Lazy_volatile_object<Genode::Irq_connection> irq_connection;
|
||||
unsigned irq_num;
|
||||
Genode::Constructible<Genode::Irq_connection> irq_connection;
|
||||
|
||||
Device(unsigned irq) : irq_num(irq) { }
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
/*
|
||||
* Lx_kit enviroment instance
|
||||
*/
|
||||
static Genode::Lazy_volatile_object<Lx_kit::Env> _env;
|
||||
static Genode::Constructible<Lx_kit::Env> _env;
|
||||
|
||||
|
||||
Lx_kit::Env &Lx_kit::env()
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <nitpicker_gfx/box_painter.h>
|
||||
#include <nitpicker_gfx/texture_painter.h>
|
||||
#include <os/attached_dataspace.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <os/texture_rgb565.h>
|
||||
#include <os/texture_rgb888.h>
|
||||
|
||||
@ -102,7 +102,7 @@ struct Backdrop::Main
|
||||
}
|
||||
};
|
||||
|
||||
Lazy_volatile_object<Buffer> buffer;
|
||||
Constructible<Buffer> buffer;
|
||||
|
||||
Nitpicker::Session::View_handle view_handle = nitpicker.create_view();
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#define _CONFIG_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <os/session_policy.h>
|
||||
#include <util/color.h>
|
||||
|
||||
@ -28,7 +28,7 @@ namespace Decorator {
|
||||
typedef Genode::String<200> Window_title;
|
||||
|
||||
using Genode::Allocator;
|
||||
using Genode::Volatile_object;
|
||||
using Genode::Reconstructible;
|
||||
}
|
||||
|
||||
|
||||
@ -114,7 +114,7 @@ class Decorator::Config
|
||||
|
||||
Genode::Allocator &_alloc;
|
||||
|
||||
Volatile_object<Buffered_xml> _buffered_config;
|
||||
Reconstructible<Buffered_xml> _buffered_config;
|
||||
|
||||
/**
|
||||
* Maximum number of configured window controls
|
||||
|
@ -61,7 +61,7 @@ class Launcher::Fading_dialog : private Input_event_handler
|
||||
|
||||
Slave::Connection<Rom_connection> _hover_rom;
|
||||
|
||||
Lazy_volatile_object<Attached_dataspace> _hover_ds;
|
||||
Constructible<Attached_dataspace> _hover_ds;
|
||||
|
||||
/* hovered element reported by menu view */
|
||||
Slave::Connection<Report::Connection> _hover_report;
|
||||
|
@ -14,7 +14,7 @@
|
||||
/* Genode includes */
|
||||
#include <base/component.h>
|
||||
#include <decorator/xml_utils.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <os/attached_rom_dataspace.h>
|
||||
#include <nitpicker_session/connection.h>
|
||||
|
||||
|
@ -81,7 +81,7 @@ class Launcher::Panel_dialog : Input_event_handler, Dialog_generator,
|
||||
Xml_node xml() const { return _xml; }
|
||||
};
|
||||
|
||||
Lazy_volatile_object<Buffered_xml> _config;
|
||||
Constructible<Buffered_xml> _config;
|
||||
|
||||
List<Element> _elements;
|
||||
|
||||
|
@ -26,7 +26,7 @@ struct Menu_view::Main
|
||||
{
|
||||
Nitpicker::Connection nitpicker;
|
||||
|
||||
Lazy_volatile_object<Nitpicker_buffer> buffer;
|
||||
Constructible<Nitpicker_buffer> buffer;
|
||||
|
||||
Nitpicker::Session::View_handle view_handle = nitpicker.create_view();
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include <os/pixel_rgb565.h>
|
||||
#include <os/pixel_alpha8.h>
|
||||
#include <os/texture_rgb888.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <nitpicker_gfx/text_painter.h>
|
||||
|
||||
namespace Menu_view {
|
||||
|
@ -56,7 +56,7 @@ struct Decorator::Main : Window_factory_base
|
||||
Signal_handler<Main> _pointer_handler = {
|
||||
_env.ep(), *this, &Main::_handle_pointer_update };
|
||||
|
||||
Lazy_volatile_object<Attached_rom_dataspace> _pointer;
|
||||
Constructible<Attached_rom_dataspace> _pointer;
|
||||
|
||||
Window_base::Hover _hover;
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include <decorator/window.h>
|
||||
#include <nitpicker_session/connection.h>
|
||||
#include <os/attached_dataspace.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
|
||||
/* demo includes */
|
||||
#include <util/lazy_value.h>
|
||||
@ -232,14 +232,14 @@ class Decorator::Window : public Window_base, public Animator::Item
|
||||
* decorations.
|
||||
*/
|
||||
Nitpicker::Connection _nitpicker_top_bottom;
|
||||
Genode::Lazy_volatile_object<Nitpicker_buffer> _buffer_top_bottom;
|
||||
Genode::Constructible<Nitpicker_buffer> _buffer_top_bottom;
|
||||
|
||||
/**
|
||||
* Nitpicker session that contains the left and right window
|
||||
* decorations.
|
||||
*/
|
||||
Nitpicker::Connection _nitpicker_left_right;
|
||||
Genode::Lazy_volatile_object<Nitpicker_buffer> _buffer_left_right;
|
||||
Genode::Constructible<Nitpicker_buffer> _buffer_left_right;
|
||||
|
||||
Nitpicker_view _bottom_view { _nitpicker, _nitpicker_top_bottom },
|
||||
_right_view { _nitpicker, _nitpicker_left_right },
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <os/pixel_rgb565.h>
|
||||
#include <os/pixel_alpha8.h>
|
||||
#include <os/static_root.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <nitpicker_gfx/texture_painter.h>
|
||||
#include <util/lazy_value.h>
|
||||
#include <timer_session/connection.h>
|
||||
@ -49,8 +49,8 @@ namespace Nit_fader {
|
||||
using Genode::Attached_ram_dataspace;
|
||||
using Genode::Texture;
|
||||
using Genode::Surface;
|
||||
using Genode::Volatile_object;
|
||||
using Genode::Lazy_volatile_object;
|
||||
using Genode::Reconstructible;
|
||||
using Genode::Constructible;
|
||||
|
||||
typedef Genode::Pixel_rgb565 Pixel_rgb565;
|
||||
typedef Genode::Pixel_alpha8 Pixel_alpha8;
|
||||
@ -140,7 +140,7 @@ class Nit_fader::Framebuffer_session_component
|
||||
Nitpicker::Connection &_nitpicker;
|
||||
Src_buffer &_src_buffer;
|
||||
|
||||
Lazy_volatile_object<Dst_buffer> _dst_buffer;
|
||||
Constructible<Dst_buffer> _dst_buffer;
|
||||
|
||||
|
||||
Lazy_value<int> _fade;
|
||||
@ -263,7 +263,7 @@ class Nit_fader::Nitpicker_session_component
|
||||
|
||||
Server::Entrypoint &_ep;
|
||||
|
||||
Volatile_object<Src_buffer> _src_buffer { Area(1, 1), false };
|
||||
Reconstructible<Src_buffer> _src_buffer { Area(1, 1), false };
|
||||
|
||||
Nitpicker::Connection _nitpicker;
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <framebuffer_session/client.h>
|
||||
#include <cap_session/connection.h>
|
||||
#include <os/attached_rom_dataspace.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <util/xml_node.h>
|
||||
|
||||
/* local includes */
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include <os/attached_rom_dataspace.h>
|
||||
#include <os/reporter.h>
|
||||
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <util/xml_node.h>
|
||||
|
||||
#include <acpica/acpica.h>
|
||||
@ -111,7 +111,7 @@ struct Acpica::Main
|
||||
Genode::Attached_rom_dataspace config { env, "config" };
|
||||
|
||||
Genode::Signal_handler<Acpica::Main> sci_irq;
|
||||
Genode::Lazy_volatile_object<Genode::Irq_connection> sci_conn;
|
||||
Genode::Constructible<Genode::Irq_connection> sci_conn;
|
||||
|
||||
Acpica::Reportstate * report = nullptr;
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <acpica/acpica.h>
|
||||
#include <platform_session/client.h>
|
||||
|
||||
@ -46,7 +46,7 @@ struct Acpica::Env
|
||||
: env(env), heap(heap) { }
|
||||
};
|
||||
|
||||
static Genode::Lazy_volatile_object<Acpica::Env> instance;
|
||||
static Genode::Constructible<Acpica::Env> instance;
|
||||
|
||||
|
||||
Genode::Allocator & Acpica::heap() { return instance->heap; }
|
||||
|
@ -26,7 +26,7 @@ namespace Genode {
|
||||
/**
|
||||
* Return singleton instance of config
|
||||
*/
|
||||
Volatile_object<Config> &config();
|
||||
Reconstructible<Config> &config();
|
||||
}
|
||||
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#ifndef _INCLUDE__OS__DYNAMIC_ROM_SESSION_H_
|
||||
#define _INCLUDE__OS__DYNAMIC_ROM_SESSION_H_
|
||||
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <base/rpc_server.h>
|
||||
#include <base/session_label.h>
|
||||
#include <base/attached_ram_dataspace.h>
|
||||
@ -64,7 +64,7 @@ class Genode::Dynamic_rom_session : public Rpc_object<Rom_session>
|
||||
|
||||
size_t _ds_size = 4096;
|
||||
|
||||
Lazy_volatile_object<Attached_ram_dataspace> _ds;
|
||||
Constructible<Attached_ram_dataspace> _ds;
|
||||
|
||||
void _notify_client()
|
||||
{
|
||||
|
@ -14,7 +14,7 @@
|
||||
#ifndef _INCLUDE__OS__REPORTER_H_
|
||||
#define _INCLUDE__OS__REPORTER_H_
|
||||
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <os/attached_dataspace.h>
|
||||
#include <report_session/connection.h>
|
||||
#include <util/xml_generator.h>
|
||||
@ -47,7 +47,7 @@ class Genode::Reporter : Noncopyable
|
||||
: report(name, buffer_size) { }
|
||||
};
|
||||
|
||||
Lazy_volatile_object<Connection> _conn;
|
||||
Constructible<Connection> _conn;
|
||||
|
||||
/**
|
||||
* Return size of report buffer
|
||||
|
@ -15,13 +15,13 @@
|
||||
#define _INCLUDE__REPORT_ROM__ROM_MODULE_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <os/session_policy.h>
|
||||
#include <base/attached_ram_dataspace.h>
|
||||
|
||||
namespace Rom {
|
||||
using Genode::size_t;
|
||||
using Genode::Lazy_volatile_object;
|
||||
using Genode::Constructible;
|
||||
using Genode::Attached_ram_dataspace;
|
||||
|
||||
class Module;
|
||||
@ -138,7 +138,7 @@ struct Rom::Module : Module_list::Element, Readable_module
|
||||
* allow for the immediate release of the underlying backing store when
|
||||
* the module gets destructed.
|
||||
*/
|
||||
Lazy_volatile_object<Attached_ram_dataspace> _ds;
|
||||
Constructible<Attached_ram_dataspace> _ds;
|
||||
|
||||
/**
|
||||
* Content size, which may less than the capacilty of '_ds'.
|
||||
|
@ -49,7 +49,7 @@ class Rom::Session_component : public Genode::Rpc_object<Genode::Rom_session>,
|
||||
throw Genode::Root::Invalid_args(); }
|
||||
}
|
||||
|
||||
Lazy_volatile_object<Genode::Attached_ram_dataspace> _ds;
|
||||
Constructible<Genode::Attached_ram_dataspace> _ds;
|
||||
|
||||
size_t _content_size = 0;
|
||||
|
||||
|
67
repos/os/run/reconstructible.run
Normal file
67
repos/os/run/reconstructible.run
Normal file
@ -0,0 +1,67 @@
|
||||
build "core init test/reconstructible"
|
||||
|
||||
create_boot_directory
|
||||
|
||||
install_config {
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="ROM"/>
|
||||
<service name="RAM"/>
|
||||
<service name="CPU"/>
|
||||
<service name="RM"/>
|
||||
<service name="PD"/>
|
||||
<service name="LOG"/>
|
||||
</parent-provides>
|
||||
<default-route>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</default-route>
|
||||
<start name="test-reconstructible">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
</start>
|
||||
</config>
|
||||
}
|
||||
|
||||
build_boot_image "core init test-reconstructible"
|
||||
|
||||
append qemu_args "-nographic -m 64"
|
||||
|
||||
run_genode_until {child "test-reconstructible" exited with exit value 0.*\n} 10
|
||||
|
||||
grep_output {-> test-reconstructible}
|
||||
|
||||
compare_output_to {
|
||||
[init -> test-reconstructible] --- test-reconstructible started ---
|
||||
[init -> test-reconstructible] construct Object 1
|
||||
[init -> test-reconstructible] construct Object 2
|
||||
[init -> test-reconstructible] -- create Compound object --
|
||||
[init -> test-reconstructible] construct Member_with_reference
|
||||
[init -> test-reconstructible] construct Compound
|
||||
[init -> test-reconstructible] compound.member.constructed returns 1
|
||||
[init -> test-reconstructible] compound.lazy_member.constructed returns 0
|
||||
[init -> test-reconstructible] -- construct lazy member --
|
||||
[init -> test-reconstructible] construct Member_with_reference
|
||||
[init -> test-reconstructible] compound.lazy_member.constructed returns 1
|
||||
[init -> test-reconstructible] -- call method on member (with reference to Object 1) --
|
||||
[init -> test-reconstructible] const method called on Object 1
|
||||
[init -> test-reconstructible] -- reconstruct member with Object 2 as reference --
|
||||
[init -> test-reconstructible] destruct Member_with_reference
|
||||
[init -> test-reconstructible] construct Member_with_reference
|
||||
[init -> test-reconstructible] -- call method on member --
|
||||
[init -> test-reconstructible] const method called on Object 2
|
||||
[init -> test-reconstructible] -- destruct member --
|
||||
[init -> test-reconstructible] destruct Member_with_reference
|
||||
[init -> test-reconstructible] -- try to call method on member, catch exception --
|
||||
[init -> test-reconstructible] got exception, as expected
|
||||
[init -> test-reconstructible] -- destruct Compound and Objects 1 and 2 --
|
||||
[init -> test-reconstructible] destruct Compound
|
||||
[init -> test-reconstructible] destruct Member_with_reference
|
||||
[init -> test-reconstructible] destruct Object 2
|
||||
[init -> test-reconstructible] destruct Object 1
|
||||
[init -> test-reconstructible] -- construct Throwing object
|
||||
[init -> test-reconstructible] construct Throwing -> don't throw
|
||||
[init -> test-reconstructible] destruct Throwing
|
||||
[init -> test-reconstructible] construct Throwing -> throw exception
|
||||
[init -> test-reconstructible] -- catched exception as expected
|
||||
[init -> test-reconstructible] --- test-reconstructible finished ---
|
||||
}
|
||||
|
@ -1,67 +0,0 @@
|
||||
build "core init test/volatile_object"
|
||||
|
||||
create_boot_directory
|
||||
|
||||
install_config {
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="ROM"/>
|
||||
<service name="RAM"/>
|
||||
<service name="CPU"/>
|
||||
<service name="RM"/>
|
||||
<service name="PD"/>
|
||||
<service name="LOG"/>
|
||||
</parent-provides>
|
||||
<default-route>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</default-route>
|
||||
<start name="test-volatile_object">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
</start>
|
||||
</config>
|
||||
}
|
||||
|
||||
build_boot_image "core init test-volatile_object"
|
||||
|
||||
append qemu_args "-nographic -m 64"
|
||||
|
||||
run_genode_until {child "test-volatile_object" exited with exit value 0.*\n} 10
|
||||
|
||||
grep_output {-> test-volatile_object}
|
||||
|
||||
compare_output_to {
|
||||
[init -> test-volatile_object] --- test-volatile_object started ---
|
||||
[init -> test-volatile_object] construct Object 1
|
||||
[init -> test-volatile_object] construct Object 2
|
||||
[init -> test-volatile_object] -- create Compound object --
|
||||
[init -> test-volatile_object] construct Member_with_reference
|
||||
[init -> test-volatile_object] construct Compound
|
||||
[init -> test-volatile_object] compound.member.constructed returns 1
|
||||
[init -> test-volatile_object] compound.lazy_member.constructed returns 0
|
||||
[init -> test-volatile_object] -- construct lazy member --
|
||||
[init -> test-volatile_object] construct Member_with_reference
|
||||
[init -> test-volatile_object] compound.lazy_member.constructed returns 1
|
||||
[init -> test-volatile_object] -- call method on member (with reference to Object 1) --
|
||||
[init -> test-volatile_object] const method called on Object 1
|
||||
[init -> test-volatile_object] -- reconstruct member with Object 2 as reference --
|
||||
[init -> test-volatile_object] destruct Member_with_reference
|
||||
[init -> test-volatile_object] construct Member_with_reference
|
||||
[init -> test-volatile_object] -- call method on member --
|
||||
[init -> test-volatile_object] const method called on Object 2
|
||||
[init -> test-volatile_object] -- destruct member --
|
||||
[init -> test-volatile_object] destruct Member_with_reference
|
||||
[init -> test-volatile_object] -- try to call method on member, catch exception --
|
||||
[init -> test-volatile_object] got exception, as expected
|
||||
[init -> test-volatile_object] -- destruct Compound and Objects 1 and 2 --
|
||||
[init -> test-volatile_object] destruct Compound
|
||||
[init -> test-volatile_object] destruct Member_with_reference
|
||||
[init -> test-volatile_object] destruct Object 2
|
||||
[init -> test-volatile_object] destruct Object 1
|
||||
[init -> test-volatile_object] -- construct Throwing object
|
||||
[init -> test-volatile_object] construct Throwing -> don't throw
|
||||
[init -> test-volatile_object] destruct Throwing
|
||||
[init -> test-volatile_object] construct Throwing -> throw exception
|
||||
[init -> test-volatile_object] -- catched exception as expected
|
||||
[init -> test-volatile_object] --- test-volatile_object finished ---
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include <base/attached_rom_dataspace.h>
|
||||
#include <util/print_lines.h>
|
||||
#include <base/component.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
|
||||
namespace Rom_logger { struct Main; }
|
||||
|
||||
@ -27,7 +27,7 @@ struct Rom_logger::Main
|
||||
|
||||
Genode::Attached_rom_dataspace _config_rom { _env, "config" };
|
||||
|
||||
Genode::Lazy_volatile_object<Genode::Attached_rom_dataspace> _rom_ds;
|
||||
Genode::Constructible<Genode::Attached_rom_dataspace> _rom_ds;
|
||||
|
||||
typedef Genode::String<100> Rom_name;
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <os/attached_rom_dataspace.h>
|
||||
#include <util/print_lines.h>
|
||||
#include <os/server.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
|
||||
#include <base/heap.h>
|
||||
#include <base/allocator_avl.h>
|
||||
@ -49,7 +49,7 @@ struct Rom_to_file::Main
|
||||
|
||||
File_system::Connection _fs;
|
||||
|
||||
Lazy_volatile_object<Attached_rom_dataspace> _rom_ds;
|
||||
Constructible<Attached_rom_dataspace> _rom_ds;
|
||||
|
||||
typedef Genode::String<100> Rom_name;
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <util/xml_node.h>
|
||||
#include <util/color.h>
|
||||
#include <os/attached_rom_dataspace.h>
|
||||
@ -199,7 +199,7 @@ struct Main
|
||||
Label label;
|
||||
Color color;
|
||||
|
||||
Genode::Volatile_object<Status_bar_buffer> status_bar_buffer { nitpicker };
|
||||
Genode::Reconstructible<Status_bar_buffer> status_bar_buffer { nitpicker };
|
||||
|
||||
Nitpicker::Session::View_handle const view { nitpicker.create_view() };
|
||||
|
||||
|
@ -48,7 +48,7 @@ struct Xray_trigger::Main
|
||||
/**
|
||||
* Hover model as reported by nitpicker
|
||||
*/
|
||||
Genode::Lazy_volatile_object<Genode::Attached_rom_dataspace> _hover_ds;
|
||||
Genode::Constructible<Genode::Attached_rom_dataspace> _hover_ds;
|
||||
|
||||
/**
|
||||
* Reporter for posting the result of our policy decision
|
||||
|
@ -1122,7 +1122,7 @@ class Acpi_table
|
||||
/* BIOS range to scan for RSDP */
|
||||
enum { BIOS_BASE = 0xe0000, BIOS_SIZE = 0x20000 };
|
||||
|
||||
Genode::Lazy_volatile_object<Genode::Attached_io_mem_dataspace> _mmio;
|
||||
Genode::Constructible<Genode::Attached_io_mem_dataspace> _mmio;
|
||||
|
||||
/**
|
||||
* Search for RSDP pointer signature in area
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <os/attached_mmio.h>
|
||||
#include <os/server.h>
|
||||
#include <util/retry.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
|
||||
static bool constexpr verbose = false;
|
||||
|
||||
|
@ -181,9 +181,9 @@ struct Ata_driver : Port_driver
|
||||
typedef ::String<Identity::Serial_number> Serial_string;
|
||||
typedef ::String<Identity::Model_number> Model_string;
|
||||
|
||||
Genode::Lazy_volatile_object<Identity> info;
|
||||
Genode::Lazy_volatile_object<Serial_string> serial;
|
||||
Genode::Lazy_volatile_object<Model_string> model;
|
||||
Genode::Constructible<Identity> info;
|
||||
Genode::Constructible<Serial_string> serial;
|
||||
Genode::Constructible<Model_string> model;
|
||||
|
||||
Io_command *io_cmd = nullptr;
|
||||
Block::Packet_descriptor pending[32];
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <irq_session/connection.h>
|
||||
#include <platform_session/connection.h>
|
||||
#include <platform_device/client.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
|
||||
#include <ahci.h>
|
||||
|
||||
@ -34,12 +34,12 @@ struct X86_hba : Platform::Hba
|
||||
|
||||
Genode::Env &env;
|
||||
|
||||
Platform::Connection pci { env };
|
||||
Platform::Device_capability pci_device_cap;
|
||||
Lazy_volatile_object<Platform::Device_client> pci_device;
|
||||
Lazy_volatile_object<Irq_session_client> irq;
|
||||
addr_t res_base;
|
||||
size_t res_size;
|
||||
Platform::Connection pci { env };
|
||||
Platform::Device_capability pci_device_cap;
|
||||
Constructible<Platform::Device_client> pci_device;
|
||||
Constructible<Irq_session_client> irq;
|
||||
addr_t res_base;
|
||||
size_t res_size;
|
||||
|
||||
X86_hba(Genode::Env &env) : env(env)
|
||||
{
|
||||
|
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <os/attached_io_mem_dataspace.h>
|
||||
#include <os/attached_ram_dataspace.h>
|
||||
#include <os/static_root.h>
|
||||
@ -35,11 +35,11 @@ class Framebuffer::Session_component : public Genode::Rpc_object<Framebuffer::Se
|
||||
{
|
||||
private:
|
||||
|
||||
size_t const _width;
|
||||
size_t const _height;
|
||||
Lazy_volatile_object<Attached_ram_dataspace> _bb_mem;
|
||||
Attached_io_mem_dataspace _fb_mem;
|
||||
Timer::Connection _timer;
|
||||
size_t const _width;
|
||||
size_t const _height;
|
||||
Constructible<Attached_ram_dataspace> _bb_mem;
|
||||
Attached_io_mem_dataspace _fb_mem;
|
||||
Timer::Connection _timer;
|
||||
|
||||
void _refresh_buffered(int x, int y, int w, int h)
|
||||
{
|
||||
|
@ -37,7 +37,7 @@ class Platform::Irq_session_component : public Genode::Rpc_object<Genode::Irq_se
|
||||
Genode::Irq_sigh _irq_sigh;
|
||||
Genode::Irq_session::Info _msi_info;
|
||||
|
||||
Genode::Lazy_volatile_object<Genode::Irq_connection> _irq_conn;
|
||||
Genode::Constructible<Genode::Irq_connection> _irq_conn;
|
||||
|
||||
public:
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <base/component.h>
|
||||
#include <base/env.h>
|
||||
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
|
||||
#include <os/attached_rom_dataspace.h>
|
||||
|
||||
@ -35,11 +35,11 @@ struct Platform::Main
|
||||
Genode::Env &_env;
|
||||
Genode::Sliced_heap sliced_heap { _env.ram(), _env.rm() };
|
||||
|
||||
Genode::Lazy_volatile_object<Genode::Attached_rom_dataspace> acpi_rom;
|
||||
Genode::Lazy_volatile_object<Platform::Root> root;
|
||||
Genode::Constructible<Genode::Attached_rom_dataspace> acpi_rom;
|
||||
Genode::Constructible<Platform::Root> root;
|
||||
|
||||
Genode::Lazy_volatile_object<Genode::Attached_rom_dataspace> system_state;
|
||||
Genode::Lazy_volatile_object<Genode::Attached_rom_dataspace> acpi_ready;
|
||||
Genode::Constructible<Genode::Attached_rom_dataspace> system_state;
|
||||
Genode::Constructible<Genode::Attached_rom_dataspace> acpi_ready;
|
||||
|
||||
Genode::Signal_handler<Platform::Main> _acpi_report;
|
||||
Genode::Signal_handler<Platform::Main> _system_report;
|
||||
|
@ -42,7 +42,7 @@ class Platform::Device_component : public Genode::Rpc_object<Platform::Device>,
|
||||
unsigned short _irq_line;
|
||||
Irq_session_component *_irq_session = nullptr;
|
||||
|
||||
Genode::Lazy_volatile_object<Genode::Io_mem_connection> _io_mem_config_extended;
|
||||
Genode::Constructible<Genode::Io_mem_connection> _io_mem_config_extended;
|
||||
|
||||
class Io_mem : public Genode::Io_mem_connection,
|
||||
public Genode::List<Io_mem>::Element
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
#include <util/mmio.h>
|
||||
#include <util/retry.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
|
||||
/* os */
|
||||
#include <io_mem_session/connection.h>
|
||||
@ -84,7 +84,7 @@ class Platform::Rmrr : public Genode::List<Platform::Rmrr>::Element
|
||||
Genode::Io_mem_dataspace_capability _cap;
|
||||
Genode::List<Bdf> _bdf_list;
|
||||
|
||||
Genode::Lazy_volatile_object<Genode::Io_mem_connection> _io_mem;
|
||||
Genode::Constructible<Genode::Io_mem_connection> _io_mem;
|
||||
|
||||
public:
|
||||
|
||||
|
@ -80,12 +80,12 @@ Config::Config()
|
||||
{ }
|
||||
|
||||
|
||||
Volatile_object<Config> &Genode::config()
|
||||
Reconstructible<Config> &Genode::config()
|
||||
{
|
||||
static bool config_failed = false;
|
||||
if (!config_failed) {
|
||||
try {
|
||||
static Volatile_object<Config> config_inst;
|
||||
static Reconstructible<Config> config_inst;
|
||||
return config_inst;
|
||||
} catch (Genode::Rom_connection::Rom_connection_failed) {
|
||||
Genode::error("Could not obtain config file");
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
#include <log_session/connection.h>
|
||||
#include <vfs/single_file_system.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
|
||||
namespace Vfs { class Log_file_system; }
|
||||
|
||||
@ -28,8 +28,8 @@ class Vfs::Log_file_system : public Single_file_system
|
||||
typedef Genode::String<64> Label;
|
||||
Label _label;
|
||||
|
||||
Genode::Lazy_volatile_object<Genode::Log_connection> _log_connection;
|
||||
Genode::Lazy_volatile_object<Genode::Log_session_client> _log_client;
|
||||
Genode::Constructible<Genode::Log_connection> _log_connection;
|
||||
Genode::Constructible<Genode::Log_session_client> _log_client;
|
||||
|
||||
Genode::Log_session & _log_session(Genode::Env &env)
|
||||
{
|
||||
|
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <util/arg_string.h>
|
||||
#include <base/heap.h>
|
||||
#include <base/component.h>
|
||||
@ -30,7 +30,7 @@ namespace Dynamic_rom {
|
||||
using Genode::Rpc_object;
|
||||
using Genode::Sliced_heap;
|
||||
using Genode::Env;
|
||||
using Genode::Lazy_volatile_object;
|
||||
using Genode::Constructible;
|
||||
using Genode::Signal_context_capability;
|
||||
using Genode::Signal_handler;
|
||||
using Genode::Xml_node;
|
||||
@ -54,7 +54,7 @@ class Dynamic_rom::Session_component : public Rpc_object<Genode::Rom_session>
|
||||
unsigned _last_content_idx = ~0;
|
||||
Signal_context_capability _sigh;
|
||||
|
||||
Lazy_volatile_object<Genode::Attached_ram_dataspace> _ram_ds;
|
||||
Constructible<Genode::Attached_ram_dataspace> _ram_ds;
|
||||
|
||||
void _notify_client()
|
||||
{
|
||||
|
@ -167,7 +167,7 @@ class Loader::Session_component : public Rpc_object<Session>
|
||||
|
||||
Signal_context_capability view_ready_sigh;
|
||||
|
||||
Lazy_volatile_object<Nitpicker::Session_component> session;
|
||||
Constructible<Nitpicker::Session_component> session;
|
||||
|
||||
Local_nitpicker_factory(Entrypoint &ep, Ram_session &ram)
|
||||
: _ep(ep), _ram(ram) { }
|
||||
@ -215,7 +215,7 @@ class Loader::Session_component : public Rpc_object<Session>
|
||||
Local_nitpicker_factory _nitpicker_factory { _env.ep(), _local_ram };
|
||||
Local_nitpicker_service _nitpicker_service { _nitpicker_factory };
|
||||
Signal_context_capability _fault_sigh;
|
||||
Lazy_volatile_object<Child> _child;
|
||||
Constructible<Child> _child;
|
||||
|
||||
/**
|
||||
* Return virtual nitpicker session component
|
||||
|
@ -29,7 +29,7 @@ namespace Genode {
|
||||
Attached_ram_dataspace _fg;
|
||||
Attached_ram_dataspace _bg;
|
||||
|
||||
Lazy_volatile_object<Attached_rom_dataspace> _parent_rom;
|
||||
Constructible<Attached_rom_dataspace> _parent_rom;
|
||||
|
||||
bool _bg_has_pending_data;
|
||||
|
||||
|
@ -18,13 +18,13 @@
|
||||
#include <net/ipv4.h>
|
||||
#include <net/ethernet.h>
|
||||
#include <util/avl_tree.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
|
||||
namespace Net {
|
||||
|
||||
class Arp_cache;
|
||||
class Arp_cache_entry;
|
||||
using Arp_cache_entry_slot = Genode::Lazy_volatile_object<Arp_cache_entry>;
|
||||
using Arp_cache_entry_slot = Genode::Constructible<Arp_cache_entry>;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1132,7 +1132,7 @@ struct Nitpicker::Main
|
||||
Framebuffer_screen(Framebuffer::Session &fb) : framebuffer(fb) { }
|
||||
};
|
||||
|
||||
Genode::Volatile_object<Framebuffer_screen> fb_screen = { framebuffer };
|
||||
Genode::Reconstructible<Framebuffer_screen> fb_screen = { framebuffer };
|
||||
|
||||
void handle_fb_mode();
|
||||
|
||||
@ -1150,7 +1150,7 @@ struct Nitpicker::Main
|
||||
* on the first call of 'handle_config'.
|
||||
*/
|
||||
Genode::Heap domain_registry_heap { env.ram(), env.rm() };
|
||||
Genode::Volatile_object<Domain_registry> domain_registry {
|
||||
Genode::Reconstructible<Domain_registry> domain_registry {
|
||||
domain_registry_heap, Genode::Xml_node("<config/>") };
|
||||
|
||||
User_state user_state = { global_keys, fb_screen->screen.size() };
|
||||
|
@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <util/arg_string.h>
|
||||
#include <util/xml_generator.h>
|
||||
#include <base/heap.h>
|
||||
@ -27,7 +27,7 @@ namespace Rom_filter {
|
||||
using Genode::Rpc_object;
|
||||
using Genode::Sliced_heap;
|
||||
using Genode::env;
|
||||
using Genode::Lazy_volatile_object;
|
||||
using Genode::Constructible;
|
||||
using Genode::Xml_generator;
|
||||
using Genode::size_t;
|
||||
|
||||
@ -61,7 +61,7 @@ class Rom_filter::Session_component : public Rpc_object<Genode::Rom_session>,
|
||||
|
||||
Session_list &_sessions;
|
||||
|
||||
Lazy_volatile_object<Genode::Attached_ram_dataspace> _ram_ds;
|
||||
Constructible<Genode::Attached_ram_dataspace> _ram_ds;
|
||||
|
||||
public:
|
||||
|
||||
@ -157,7 +157,7 @@ struct Rom_filter::Main : Input_rom_registry::Input_rom_changed_fn,
|
||||
|
||||
Input_rom_registry _input_rom_registry { *env()->heap(), _ep, *this };
|
||||
|
||||
Genode::Lazy_volatile_object<Genode::Attached_ram_dataspace> _xml_ds;
|
||||
Genode::Constructible<Genode::Attached_ram_dataspace> _xml_ds;
|
||||
|
||||
size_t _xml_output_len = 0;
|
||||
|
||||
|
@ -47,7 +47,7 @@ class Track : Thread_deprecated<8192>
|
||||
{
|
||||
private:
|
||||
|
||||
Lazy_volatile_object<Audio_out::Connection> _audio_out[CHN_CNT];
|
||||
Constructible<Audio_out::Connection> _audio_out[CHN_CNT];
|
||||
|
||||
String<64> const _name;
|
||||
|
||||
|
@ -45,7 +45,7 @@ class Click
|
||||
{
|
||||
private:
|
||||
|
||||
Lazy_volatile_object<Audio_out::Connection> _audio_out[CHANNELS];
|
||||
Constructible<Audio_out::Connection> _audio_out[CHANNELS];
|
||||
|
||||
Attached_rom_dataspace _sample_ds;
|
||||
char const * const _base = _sample_ds.local_addr<char const>();
|
||||
|
@ -165,7 +165,7 @@ void Component::construct(Genode::Env &env)
|
||||
log("--- bomb started ---");
|
||||
|
||||
/* try to create timer session, if it fails, bomb is our parent */
|
||||
static Lazy_volatile_object<Timer::Connection> timer;
|
||||
static Constructible<Timer::Connection> timer;
|
||||
try { timer.construct(env); } catch (Parent::Service_denied) { }
|
||||
|
||||
if (timer.constructed())
|
||||
|
@ -141,7 +141,7 @@ struct Faulting_child_test
|
||||
{
|
||||
static char const *name() { return "failure detection in immediate child"; }
|
||||
|
||||
Lazy_volatile_object<Test_child> _child;
|
||||
Constructible<Test_child> _child;
|
||||
|
||||
void start_iteration(Env &env, Signal_context_capability fault_sigh)
|
||||
{
|
||||
@ -158,7 +158,7 @@ struct Faulting_loader_child_test
|
||||
{
|
||||
static char const *name() { return "failure detection in loaded child"; }
|
||||
|
||||
Lazy_volatile_object<Loader::Connection> loader;
|
||||
Constructible<Loader::Connection> loader;
|
||||
|
||||
void start_iteration(Env &env, Signal_context_capability fault_sigh)
|
||||
{
|
||||
@ -201,7 +201,7 @@ struct Faulting_loader_grand_child_test
|
||||
|
||||
static size_t config_size() { return strlen(config()); }
|
||||
|
||||
Lazy_volatile_object<Loader::Connection> loader;
|
||||
Constructible<Loader::Connection> loader;
|
||||
|
||||
void start_iteration(Env &env, Signal_context_capability fault_sigh)
|
||||
{
|
||||
@ -227,9 +227,9 @@ struct Main
|
||||
{
|
||||
Env &_env;
|
||||
|
||||
Lazy_volatile_object<Iterative_test<Faulting_child_test> > _test_1;
|
||||
Lazy_volatile_object<Iterative_test<Faulting_loader_child_test> > _test_2;
|
||||
Lazy_volatile_object<Iterative_test<Faulting_loader_grand_child_test> > _test_3;
|
||||
Constructible<Iterative_test<Faulting_child_test> > _test_1;
|
||||
Constructible<Iterative_test<Faulting_loader_child_test> > _test_2;
|
||||
Constructible<Iterative_test<Faulting_loader_grand_child_test> > _test_3;
|
||||
|
||||
Signal_handler<Main> _test_1_finished_handler {
|
||||
_env.ep(), *this, &Main::_handle_test_1_finished };
|
||||
|
@ -19,14 +19,14 @@
|
||||
#include <dataspace/client.h>
|
||||
#include <framebuffer_session/connection.h>
|
||||
#include <os/attached_dataspace.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
|
||||
|
||||
class Test_environment
|
||||
{
|
||||
private:
|
||||
|
||||
using Ds = Genode::Lazy_volatile_object<Genode::Attached_dataspace>;
|
||||
using Ds = Genode::Constructible<Genode::Attached_dataspace>;
|
||||
|
||||
enum Color {
|
||||
BLACK = 0x0,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* \brief Test for 'Volatile_object'
|
||||
* \brief Test for 'Reconstructible'
|
||||
* \author Norman Feske
|
||||
* \date 2013-01-10
|
||||
*/
|
||||
@ -12,11 +12,11 @@
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/reconstructible.h>
|
||||
#include <base/log.h>
|
||||
|
||||
using Genode::Volatile_object;
|
||||
using Genode::Lazy_volatile_object;
|
||||
using Genode::Reconstructible;
|
||||
using Genode::Constructible;
|
||||
using Genode::log;
|
||||
|
||||
|
||||
@ -59,8 +59,8 @@ struct Member_with_reference
|
||||
|
||||
struct Compound
|
||||
{
|
||||
Volatile_object<Member_with_reference> member;
|
||||
Lazy_volatile_object<Member_with_reference> lazy_member;
|
||||
Reconstructible<Member_with_reference> member;
|
||||
Constructible<Member_with_reference> lazy_member;
|
||||
|
||||
Compound(Object &object)
|
||||
:
|
||||
@ -115,7 +115,7 @@ int main(int, char **)
|
||||
{
|
||||
using namespace Genode;
|
||||
|
||||
log("--- test-volatile_object started ---");
|
||||
log("--- test-reconstructible started ---");
|
||||
|
||||
{
|
||||
Object object_1(1);
|
||||
@ -149,7 +149,7 @@ int main(int, char **)
|
||||
log("-- try to call method on member, catch exception --");
|
||||
try {
|
||||
call_const_method(compound); }
|
||||
catch (typename Volatile_object<Member_with_reference>::Deref_unconstructed_object) {
|
||||
catch (typename Reconstructible<Member_with_reference>::Deref_unconstructed_object) {
|
||||
log("got exception, as expected"); }
|
||||
|
||||
log("-- destruct Compound and Objects 1 and 2 --");
|
||||
@ -159,14 +159,14 @@ int main(int, char **)
|
||||
log("-- construct Throwing object");
|
||||
Bool const b_false(false), b_true(true);
|
||||
|
||||
Volatile_object<Throwing> inst(b_false);
|
||||
Reconstructible<Throwing> inst(b_false);
|
||||
inst.construct(b_true);
|
||||
Genode::error("expected contructor to throw");
|
||||
} catch (int i) {
|
||||
log("-- catched exception as expected");
|
||||
}
|
||||
|
||||
log("--- test-volatile_object finished ---");
|
||||
log("--- test-reconstructible finished ---");
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
TARGET = test-volatile_object
|
||||
TARGET = test-reconstructible
|
||||
SRC_CC = main.cc
|
||||
LIBS = base
|
@ -117,7 +117,7 @@ class Noux_connection
|
||||
|
||||
/*
|
||||
* Obtain new noux connection. Note that we cannot reconstruct
|
||||
* the connection via a 'Volatile_object' because this would
|
||||
* the connection via a 'Reconstructible' because this would
|
||||
* result in an inconsistent referernce count when attempting
|
||||
* to destruct the session capability in the just-cleared
|
||||
* capability space.
|
||||
|
@ -94,12 +94,12 @@ class Noux::Rom_session_component : public Rpc_object<Rom_session>
|
||||
~Vfs_dataspace() { root_dir.release(name.string(), ds); }
|
||||
};
|
||||
|
||||
Lazy_volatile_object<Vfs_dataspace> _rom_from_vfs;
|
||||
Constructible<Vfs_dataspace> _rom_from_vfs;
|
||||
|
||||
/**
|
||||
* Wrapped ROM session at core
|
||||
*/
|
||||
Lazy_volatile_object<Rom_connection> _rom_from_parent;
|
||||
Constructible<Rom_connection> _rom_from_parent;
|
||||
|
||||
Dataspace_capability _init_ds_cap(Name const &name)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user