diff --git a/repos/base-sel4/src/core/include/platform_pd.h b/repos/base-sel4/src/core/include/platform_pd.h index 04078a4d9..c2e3eb346 100644 --- a/repos/base-sel4/src/core/include/platform_pd.h +++ b/repos/base-sel4/src/core/include/platform_pd.h @@ -44,7 +44,7 @@ class Genode::Platform_pd : public Address_space Cnode _cspace_cnode_1st; - Lazy_volatile_object _cspace_cnode_2nd[1UL << CSPACE_SIZE_LOG2_1ST]; + Constructible _cspace_cnode_2nd[1UL << CSPACE_SIZE_LOG2_1ST]; Native_capability _parent; diff --git a/repos/base-sel4/src/core/include/vm_space.h b/repos/base-sel4/src/core/include/vm_space.h index b61a0fefc..c73d7d3b1 100644 --- a/repos/base-sel4/src/core/include/vm_space.h +++ b/repos/base-sel4/src/core/include/vm_space.h @@ -16,7 +16,7 @@ /* Genode includes */ #include -#include +#include #include #include #include @@ -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; + Constructible _cnode; public: diff --git a/repos/base/include/base/attached_rom_dataspace.h b/repos/base/include/base/attached_rom_dataspace.h index 96f2cf7ce..269d3691d 100644 --- a/repos/base/include/base/attached_rom_dataspace.h +++ b/repos/base/include/base/attached_rom_dataspace.h @@ -14,7 +14,7 @@ #ifndef _INCLUDE__BASE__ATTACHED_ROM_DATASPACE_H_ #define _INCLUDE__BASE__ATTACHED_ROM_DATASPACE_H_ -#include +#include #include #include #include @@ -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 _ds; + Constructible _ds; /** * Try to attach the ROM module, ignore invalid dataspaces diff --git a/repos/base/include/base/child.h b/repos/base/include/base/child.h index 461b2ca19..c5e826e67 100644 --- a/repos/base/include/base/child.h +++ b/repos/base/include/base/child.h @@ -311,7 +311,7 @@ class Genode::Child : protected Rpc_object, Env_connection _binary { _policy, _id_space, Parent::Env::binary(), _policy.binary_name() }; - Lazy_volatile_object > _linker { _policy, + Constructible > _linker { _policy, _id_space, Parent::Env::linker(), _policy.linker_name() }; /* call 'Child_policy::init' methods for the environment sessions */ diff --git a/repos/base/include/base/entrypoint.h b/repos/base/include/base/entrypoint.h index 96860e349..87d485fa8 100644 --- a/repos/base/include/base/entrypoint.h +++ b/repos/base/include/base/entrypoint.h @@ -14,7 +14,7 @@ #ifndef _INCLUDE__BASE__ENTRYPOINT_H_ #define _INCLUDE__BASE__ENTRYPOINT_H_ -#include +#include #include #include #include @@ -68,12 +68,12 @@ class Genode::Entrypoint : Genode::Noncopyable Env &_env; - Volatile_object _rpc_ep; + Reconstructible _rpc_ep; Signal_proxy_component _signal_proxy {*this}; Capability _signal_proxy_cap = _rpc_ep->manage(&_signal_proxy); - Volatile_object _sig_rec; + Reconstructible _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> _suspend_dispatcher; + Constructible> _suspend_dispatcher; void _dispatch_signal(Signal &sig); void _process_incoming_signals(); - Lazy_volatile_object _signal_proxy_thread; + Constructible _signal_proxy_thread; friend class Startup; diff --git a/repos/base/include/base/heap.h b/repos/base/include/base/heap.h index f9ebac787..f0dd86f82 100644 --- a/repos/base/include/base/heap.h +++ b/repos/base/include/base/heap.h @@ -15,7 +15,7 @@ #define _INCLUDE__BASE__HEAP_H_ #include -#include +#include #include #include #include @@ -71,7 +71,7 @@ class Genode::Heap : public Allocator }; Lock _lock; - Volatile_object _alloc; /* local allocator */ + Reconstructible _alloc; /* local allocator */ Dataspace_pool _ds_pool; /* list of dataspaces */ size_t _quota_limit; size_t _quota_used; diff --git a/repos/base/include/base/local_connection.h b/repos/base/include/base/local_connection.h index bb064d2c1..21bc5aac2 100644 --- a/repos/base/include/base/local_connection.h +++ b/repos/base/include/base/local_connection.h @@ -83,7 +83,7 @@ class Genode::Local_connection : Local_connection_base typedef typename CONNECTION::Session_type SESSION; - Lazy_volatile_object _client; + Constructible _client; public: diff --git a/repos/base/include/base/session_state.h b/repos/base/include/base/session_state.h index 21241758d..859d140a5 100644 --- a/repos/base/include/base/session_state.h +++ b/repos/base/include/base/session_state.h @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include @@ -60,17 +60,17 @@ class Genode::Session_state : public Parent::Client, public Parent::Server, Factory *_factory = nullptr; - Volatile_object::Element> _id_at_client; + Reconstructible::Element> _id_at_client; Args _args; Affinity _affinity; public: - Lazy_volatile_object::Element> id_at_server; + Constructible::Element> id_at_server; /* ID for session requests towards the parent */ - Lazy_volatile_object::Element> id_at_parent; + Constructible::Element> id_at_parent; Parent::Client parent_client; diff --git a/repos/base/include/util/reconstructible.h b/repos/base/include/util/reconstructible.h new file mode 100644 index 000000000..b6f1e9779 --- /dev/null +++ b/repos/base/include/util/reconstructible.h @@ -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 +#include +#include + +namespace Genode { + template class Reconstructible; + template 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 +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 void _do_construct(ARGS &&... args) + { + construct_at(_space, args...); + _constructed = true; + } + + MT *_ptr() { return reinterpret_cast(_space); } + MT const *_const_ptr() const { return reinterpret_cast(_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 + 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 + 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(""); + } +}; + + +/** + * Reconstructible object that holds no initially constructed object + */ +template +struct Genode::Constructible : Reconstructible +{ + template + Constructible(ARGS &&... args) + : + Reconstructible((typename Reconstructible::Lazy *)nullptr) + { } +}; + +#endif /* _INCLUDE__UTIL__RECONSTRUCTIBLE_H_ */ diff --git a/repos/base/include/util/volatile_object.h b/repos/base/include/util/volatile_object.h index 170cc0bb3..14b4ac622 100644 --- a/repos/base/include/util/volatile_object.h +++ b/repos/base/include/util/volatile_object.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 -#include -#include +#include + +#warning "'util/volatile_object.h' is deprecated, use 'util/reconstructible.h' instead (see https://github.com/genodelabs/genode/issues/2151)" namespace Genode { - template class Volatile_object; - template class Lazy_volatile_object; + + template + struct Volatile_object : Reconstructible + { + using Reconstructible::Reconstructible; + }; + + template + struct Lazy_volatile_object : Constructible + { + using Constructible::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 -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 void _do_construct(ARGS &&... args) - { - construct_at(_space, args...); - _constructed = true; - } - - MT *_ptr() { return reinterpret_cast(_space); } - MT const *_const_ptr() const { return reinterpret_cast(_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 - 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 - 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(""); - } -}; - - -/** - * Volatile object that holds no initially constructed object - */ -template -struct Genode::Lazy_volatile_object : Volatile_object -{ - template - Lazy_volatile_object(ARGS &&... args) - : - Volatile_object((typename Volatile_object::Lazy *)0) - { } -}; - #endif /* _INCLUDE__UTIL__VOLATILE_OBJECT_H_ */ diff --git a/repos/base/src/core/main.cc b/repos/base/src/core/main.cc index 5d6ce3633..20290f748 100644 --- a/repos/base/src/core/main.cc +++ b/repos/base/src/core/main.cc @@ -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 + static Reconstructible init(services, *env()->ram_session(), env()->ram_session_cap(), ram_quota, core_cpu, core_cpu_cap); diff --git a/repos/base/src/lib/base/component.cc b/repos/base/src/lib/base/component.cc index e5cd3c0ad..d01720be2 100644 --- a/repos/base/src/lib/base/component.cc +++ b/repos/base/src/lib/base/component.cc @@ -58,7 +58,7 @@ namespace { void block() { _sig_rec.wait_for_signal(); } }; - Lazy_volatile_object _session_blockade; + Constructible _session_blockade; Env(Genode::Entrypoint &ep) : _ep(ep) { env_ptr = this; } diff --git a/repos/base/src/lib/base/log_console.cc b/repos/base/src/lib/base/log_console.cc index fad7497ce..443a23594 100644 --- a/repos/base/src/lib/base/log_console.cc +++ b/repos/base/src/lib/base/log_console.cc @@ -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 diff --git a/repos/base/src/lib/base/signal.cc b/repos/base/src/lib/base/signal.cc index 105285890..7e0065c68 100644 --- a/repos/base/src/lib/base/signal.cc +++ b/repos/base/src/lib/base/signal.cc @@ -18,7 +18,7 @@ #include #include #include -#include +#include /* base-internal includes */ #include @@ -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; + Constructible _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() +static Constructible & signal_handler_thread() { - static Lazy_volatile_object inst; + static Constructible inst; return inst; } diff --git a/repos/base/src/lib/cxx/malloc_free.cc b/repos/base/src/lib/cxx/malloc_free.cc index f8b8e93a0..776fc38bd 100644 --- a/repos/base/src/lib/cxx/malloc_free.cc +++ b/repos/base/src/lib/cxx/malloc_free.cc @@ -18,7 +18,7 @@ #include #include #include -#include +#include /* base-internal includes */ #include diff --git a/repos/base/src/lib/ldso/include/file.h b/repos/base/src/lib/ldso/include/file.h index 46ab97d0d..c8a09935b 100644 --- a/repos/base/src/lib/ldso/include/file.h +++ b/repos/base/src/lib/ldso/include/file.h @@ -75,11 +75,11 @@ struct Linker::File */ struct Linker::Elf_file : File { - Env &env; - Lazy_volatile_object rom_connection; - Rom_session_client rom; - Ram_dataspace_capability ram_cap[Phdr::MAX_PHDR]; - bool const loaded; + Env &env; + Constructible rom_connection; + Rom_session_client rom; + Ram_dataspace_capability ram_cap[Phdr::MAX_PHDR]; + bool const loaded; typedef String<64> Name; diff --git a/repos/base/src/lib/ldso/include/region_map.h b/repos/base/src/lib/ldso/include/region_map.h index 2ac5fc93f..c91c1059f 100644 --- a/repos/base/src/lib/ldso/include/region_map.h +++ b/repos/base/src/lib/ldso/include/region_map.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include /* base-internal includes */ #include @@ -60,7 +60,7 @@ class Linker::Region_map public: - typedef Lazy_volatile_object Constructible_region_map; + typedef Constructible Constructible_region_map; static Constructible_region_map &r(); diff --git a/repos/base/src/lib/ldso/include/types.h b/repos/base/src/lib/ldso/include/types.h index f84515c16..5fbffd64a 100644 --- a/repos/base/src/lib/ldso/include/types.h +++ b/repos/base/src/lib/ldso/include/types.h @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/repos/base/src/lib/ldso/main.cc b/repos/base/src/lib/ldso/main.cc index e7e8741f6..b4fd719f4 100644 --- a/repos/base/src/lib/ldso/main.cc +++ b/repos/base/src/lib/ldso/main.cc @@ -89,7 +89,7 @@ class Linker::Elf_object : public Object, public Fifo::Element /* * Optional ELF file, skipped for initial 'Ld' initialization */ - Lazy_volatile_object _elf_file; + Constructible _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() +static Genode::Constructible &heap() { - return *unmanaged_singleton>(); + return *unmanaged_singleton>(); } diff --git a/repos/base/src/test/thread/main.cc b/repos/base/src/test/thread/main.cc index c6abedcc3..115441eab 100644 --- a/repos/base/src/test/thread/main.cc +++ b/repos/base/src/test/thread/main.cc @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include @@ -44,7 +44,7 @@ struct Helper : Thread void entry() { - Lazy_volatile_object helper[CHILDREN]; + Constructible 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[HELPER]; + Constructible > helper[HELPER]; for (unsigned i = 0; i < HELPER; ++i) helper[i].construct(env); for (unsigned i = 0; i < HELPER; ++i) helper[i]->start(); diff --git a/repos/dde_linux/src/drivers/framebuffer/intel/include/component.h b/repos/dde_linux/src/drivers/framebuffer/intel/include/component.h index 5dddfc0c2..b66d5f331 100644 --- a/repos/dde_linux/src/drivers/framebuffer/intel/include/component.h +++ b/repos/dde_linux/src/drivers/framebuffer/intel/include/component.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -78,7 +78,7 @@ class Framebuffer::Session_component : public Genode::Rpc_object { private: - template using Lazy = Genode::Lazy_volatile_object; + template using Lazy = Genode::Constructible; Driver _driver; Genode::Attached_rom_dataspace &_config; diff --git a/repos/dde_linux/src/include/lx_kit/env.h b/repos/dde_linux/src/include/lx_kit/env.h index 0f764ada3..798aa7c4c 100644 --- a/repos/dde_linux/src/include/lx_kit/env.h +++ b/repos/dde_linux/src/include/lx_kit/env.h @@ -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 #include #include -#include +#include namespace Lx_kit { class Env; diff --git a/repos/dde_linux/src/include/lx_kit/internal/io_port.h b/repos/dde_linux/src/include/lx_kit/internal/io_port.h index 81efc2471..30848a84e 100644 --- a/repos/dde_linux/src/include/lx_kit/internal/io_port.h +++ b/repos/dde_linux/src/include/lx_kit/internal/io_port.h @@ -16,7 +16,7 @@ #define _LX_KIT__INTERNAL__IO_PORT_H_ /* Genode includes */ -#include +#include #include 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 _port; + unsigned _base = 0; + unsigned _size = 0; + Genode::Io_port_session_capability _cap; + Genode::Constructible _port; bool _valid(unsigned port) { return _cap.valid() && port >= _base && port < _base + _size; } diff --git a/repos/dde_linux/src/lib/lxip/timer_handler.cc b/repos/dde_linux/src/lib/lxip/timer_handler.cc index f3bc79eb9..5284c81e1 100644 --- a/repos/dde_linux/src/lib/lxip/timer_handler.cc +++ b/repos/dde_linux/src/lib/lxip/timer_handler.cc @@ -17,7 +17,7 @@ #include #include #include -#include +#include /* Linux kit includes */ #include diff --git a/repos/dde_linux/src/lib/usb/include/spec/arm/platform_device/platform_device.h b/repos/dde_linux/src/lib/usb/include/spec/arm/platform_device/platform_device.h index af0ee73da..39210e30e 100644 --- a/repos/dde_linux/src/lib/usb/include/spec/arm/platform_device/platform_device.h +++ b/repos/dde_linux/src/lib/usb/include/spec/arm/platform_device/platform_device.h @@ -27,15 +27,15 @@ #include #include -#include +#include namespace Platform { struct Device; } struct Platform::Device : Platform::Abstract_device, Genode::List::Element { - unsigned irq_num; - Genode::Lazy_volatile_object irq_connection; + unsigned irq_num; + Genode::Constructible irq_connection; Device(unsigned irq) : irq_num(irq) { } diff --git a/repos/dde_linux/src/lx_kit/env.cc b/repos/dde_linux/src/lx_kit/env.cc index df3ef6ac9..f3dc970b6 100644 --- a/repos/dde_linux/src/lx_kit/env.cc +++ b/repos/dde_linux/src/lx_kit/env.cc @@ -16,7 +16,7 @@ /* * Lx_kit enviroment instance */ -static Genode::Lazy_volatile_object _env; +static Genode::Constructible _env; Lx_kit::Env &Lx_kit::env() diff --git a/repos/gems/src/app/backdrop/main.cc b/repos/gems/src/app/backdrop/main.cc index a73323d7c..4eee4eae8 100644 --- a/repos/gems/src/app/backdrop/main.cc +++ b/repos/gems/src/app/backdrop/main.cc @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include @@ -102,7 +102,7 @@ struct Backdrop::Main } }; - Lazy_volatile_object buffer; + Constructible buffer; Nitpicker::Session::View_handle view_handle = nitpicker.create_view(); diff --git a/repos/gems/src/app/decorator/config.h b/repos/gems/src/app/decorator/config.h index a25b896b2..a95e2cbf7 100644 --- a/repos/gems/src/app/decorator/config.h +++ b/repos/gems/src/app/decorator/config.h @@ -15,7 +15,7 @@ #define _CONFIG_H_ /* Genode includes */ -#include +#include #include #include @@ -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_config; + Reconstructible _buffered_config; /** * Maximum number of configured window controls diff --git a/repos/gems/src/app/launcher/fading_dialog.h b/repos/gems/src/app/launcher/fading_dialog.h index a3cf66f1e..cc53bc00a 100644 --- a/repos/gems/src/app/launcher/fading_dialog.h +++ b/repos/gems/src/app/launcher/fading_dialog.h @@ -61,7 +61,7 @@ class Launcher::Fading_dialog : private Input_event_handler Slave::Connection _hover_rom; - Lazy_volatile_object _hover_ds; + Constructible _hover_ds; /* hovered element reported by menu view */ Slave::Connection _hover_report; diff --git a/repos/gems/src/app/launcher/main.cc b/repos/gems/src/app/launcher/main.cc index 2543f6bf1..c8dd9c58d 100644 --- a/repos/gems/src/app/launcher/main.cc +++ b/repos/gems/src/app/launcher/main.cc @@ -14,7 +14,7 @@ /* Genode includes */ #include #include -#include +#include #include #include diff --git a/repos/gems/src/app/launcher/panel_dialog.h b/repos/gems/src/app/launcher/panel_dialog.h index 1f62763d7..6bb83a49c 100644 --- a/repos/gems/src/app/launcher/panel_dialog.h +++ b/repos/gems/src/app/launcher/panel_dialog.h @@ -81,7 +81,7 @@ class Launcher::Panel_dialog : Input_event_handler, Dialog_generator, Xml_node xml() const { return _xml; } }; - Lazy_volatile_object _config; + Constructible _config; List _elements; diff --git a/repos/gems/src/app/menu_view/main.cc b/repos/gems/src/app/menu_view/main.cc index 27ce21e9a..82a7594c3 100644 --- a/repos/gems/src/app/menu_view/main.cc +++ b/repos/gems/src/app/menu_view/main.cc @@ -26,7 +26,7 @@ struct Menu_view::Main { Nitpicker::Connection nitpicker; - Lazy_volatile_object buffer; + Constructible buffer; Nitpicker::Session::View_handle view_handle = nitpicker.create_view(); diff --git a/repos/gems/src/app/menu_view/types.h b/repos/gems/src/app/menu_view/types.h index ed29f4ed0..b8d9cebe6 100644 --- a/repos/gems/src/app/menu_view/types.h +++ b/repos/gems/src/app/menu_view/types.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include namespace Menu_view { diff --git a/repos/gems/src/app/themed_decorator/main.cc b/repos/gems/src/app/themed_decorator/main.cc index b720909c0..e98784f21 100644 --- a/repos/gems/src/app/themed_decorator/main.cc +++ b/repos/gems/src/app/themed_decorator/main.cc @@ -56,7 +56,7 @@ struct Decorator::Main : Window_factory_base Signal_handler
_pointer_handler = { _env.ep(), *this, &Main::_handle_pointer_update }; - Lazy_volatile_object _pointer; + Constructible _pointer; Window_base::Hover _hover; diff --git a/repos/gems/src/app/themed_decorator/window.h b/repos/gems/src/app/themed_decorator/window.h index bd85f4439..75de78f50 100644 --- a/repos/gems/src/app/themed_decorator/window.h +++ b/repos/gems/src/app/themed_decorator/window.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include /* demo includes */ #include @@ -232,14 +232,14 @@ class Decorator::Window : public Window_base, public Animator::Item * decorations. */ Nitpicker::Connection _nitpicker_top_bottom; - Genode::Lazy_volatile_object _buffer_top_bottom; + Genode::Constructible _buffer_top_bottom; /** * Nitpicker session that contains the left and right window * decorations. */ Nitpicker::Connection _nitpicker_left_right; - Genode::Lazy_volatile_object _buffer_left_right; + Genode::Constructible _buffer_left_right; Nitpicker_view _bottom_view { _nitpicker, _nitpicker_top_bottom }, _right_view { _nitpicker, _nitpicker_left_right }, diff --git a/repos/gems/src/server/nit_fader/main.cc b/repos/gems/src/server/nit_fader/main.cc index ea167cd90..de53cc003 100644 --- a/repos/gems/src/server/nit_fader/main.cc +++ b/repos/gems/src/server/nit_fader/main.cc @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -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; + Constructible _dst_buffer; Lazy_value _fade; @@ -263,7 +263,7 @@ class Nit_fader::Nitpicker_session_component Server::Entrypoint &_ep; - Volatile_object _src_buffer { Area(1, 1), false }; + Reconstructible _src_buffer { Area(1, 1), false }; Nitpicker::Connection _nitpicker; diff --git a/repos/gems/src/server/wm/main.cc b/repos/gems/src/server/wm/main.cc index 86b4cd312..3dc69b6a5 100644 --- a/repos/gems/src/server/wm/main.cc +++ b/repos/gems/src/server/wm/main.cc @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include /* local includes */ diff --git a/repos/libports/src/app/acpica/os.cc b/repos/libports/src/app/acpica/os.cc index c1e5bf2d0..8645ccfd5 100644 --- a/repos/libports/src/app/acpica/os.cc +++ b/repos/libports/src/app/acpica/os.cc @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include @@ -111,7 +111,7 @@ struct Acpica::Main Genode::Attached_rom_dataspace config { env, "config" }; Genode::Signal_handler sci_irq; - Genode::Lazy_volatile_object sci_conn; + Genode::Constructible sci_conn; Acpica::Reportstate * report = nullptr; diff --git a/repos/libports/src/lib/acpica/env.cc b/repos/libports/src/lib/acpica/env.cc index 5d2fce739..6e81aee10 100644 --- a/repos/libports/src/lib/acpica/env.cc +++ b/repos/libports/src/lib/acpica/env.cc @@ -12,7 +12,7 @@ */ /* Genode includes */ -#include +#include #include #include @@ -46,7 +46,7 @@ struct Acpica::Env : env(env), heap(heap) { } }; -static Genode::Lazy_volatile_object instance; +static Genode::Constructible instance; Genode::Allocator & Acpica::heap() { return instance->heap; } diff --git a/repos/os/include/os/config.h b/repos/os/include/os/config.h index 6cf0748d1..857c0a575 100644 --- a/repos/os/include/os/config.h +++ b/repos/os/include/os/config.h @@ -26,7 +26,7 @@ namespace Genode { /** * Return singleton instance of config */ - Volatile_object &config(); + Reconstructible &config(); } diff --git a/repos/os/include/os/dynamic_rom_session.h b/repos/os/include/os/dynamic_rom_session.h index 55b754f2d..be0d9b97b 100644 --- a/repos/os/include/os/dynamic_rom_session.h +++ b/repos/os/include/os/dynamic_rom_session.h @@ -14,7 +14,7 @@ #ifndef _INCLUDE__OS__DYNAMIC_ROM_SESSION_H_ #define _INCLUDE__OS__DYNAMIC_ROM_SESSION_H_ -#include +#include #include #include #include @@ -64,7 +64,7 @@ class Genode::Dynamic_rom_session : public Rpc_object size_t _ds_size = 4096; - Lazy_volatile_object _ds; + Constructible _ds; void _notify_client() { diff --git a/repos/os/include/os/reporter.h b/repos/os/include/os/reporter.h index c6aba3e0c..55c6411c2 100644 --- a/repos/os/include/os/reporter.h +++ b/repos/os/include/os/reporter.h @@ -14,7 +14,7 @@ #ifndef _INCLUDE__OS__REPORTER_H_ #define _INCLUDE__OS__REPORTER_H_ -#include +#include #include #include #include @@ -47,7 +47,7 @@ class Genode::Reporter : Noncopyable : report(name, buffer_size) { } }; - Lazy_volatile_object _conn; + Constructible _conn; /** * Return size of report buffer diff --git a/repos/os/include/report_rom/rom_module.h b/repos/os/include/report_rom/rom_module.h index 7ee6aa701..588564d2c 100644 --- a/repos/os/include/report_rom/rom_module.h +++ b/repos/os/include/report_rom/rom_module.h @@ -15,13 +15,13 @@ #define _INCLUDE__REPORT_ROM__ROM_MODULE_H_ /* Genode includes */ -#include +#include #include #include 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 _ds; + Constructible _ds; /** * Content size, which may less than the capacilty of '_ds'. diff --git a/repos/os/include/report_rom/rom_service.h b/repos/os/include/report_rom/rom_service.h index f67e17ee3..1e4f5065c 100644 --- a/repos/os/include/report_rom/rom_service.h +++ b/repos/os/include/report_rom/rom_service.h @@ -49,7 +49,7 @@ class Rom::Session_component : public Genode::Rpc_object, throw Genode::Root::Invalid_args(); } } - Lazy_volatile_object _ds; + Constructible _ds; size_t _content_size = 0; diff --git a/repos/os/run/reconstructible.run b/repos/os/run/reconstructible.run new file mode 100644 index 000000000..96e28afa1 --- /dev/null +++ b/repos/os/run/reconstructible.run @@ -0,0 +1,67 @@ +build "core init test/reconstructible" + +create_boot_directory + +install_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 --- +} + diff --git a/repos/os/run/volatile_object.run b/repos/os/run/volatile_object.run deleted file mode 100644 index c15def78e..000000000 --- a/repos/os/run/volatile_object.run +++ /dev/null @@ -1,67 +0,0 @@ -build "core init test/volatile_object" - -create_boot_directory - -install_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 --- -} - diff --git a/repos/os/src/app/rom_logger/main.cc b/repos/os/src/app/rom_logger/main.cc index c098c4225..4b18ecf84 100644 --- a/repos/os/src/app/rom_logger/main.cc +++ b/repos/os/src/app/rom_logger/main.cc @@ -16,7 +16,7 @@ #include #include #include -#include +#include 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 _rom_ds; + Genode::Constructible _rom_ds; typedef Genode::String<100> Rom_name; diff --git a/repos/os/src/app/rom_to_file/main.cc b/repos/os/src/app/rom_to_file/main.cc index f443acd23..0ab1062ec 100644 --- a/repos/os/src/app/rom_to_file/main.cc +++ b/repos/os/src/app/rom_to_file/main.cc @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include @@ -49,7 +49,7 @@ struct Rom_to_file::Main File_system::Connection _fs; - Lazy_volatile_object _rom_ds; + Constructible _rom_ds; typedef Genode::String<100> Rom_name; diff --git a/repos/os/src/app/status_bar/main.cc b/repos/os/src/app/status_bar/main.cc index da5639b4f..5440e7ff4 100644 --- a/repos/os/src/app/status_bar/main.cc +++ b/repos/os/src/app/status_bar/main.cc @@ -11,7 +11,7 @@ * under the terms of the GNU General Public License version 2. */ -#include +#include #include #include #include @@ -199,7 +199,7 @@ struct Main Label label; Color color; - Genode::Volatile_object status_bar_buffer { nitpicker }; + Genode::Reconstructible status_bar_buffer { nitpicker }; Nitpicker::Session::View_handle const view { nitpicker.create_view() }; diff --git a/repos/os/src/app/xray_trigger/main.cc b/repos/os/src/app/xray_trigger/main.cc index 379baca1a..4c8b9c69b 100644 --- a/repos/os/src/app/xray_trigger/main.cc +++ b/repos/os/src/app/xray_trigger/main.cc @@ -48,7 +48,7 @@ struct Xray_trigger::Main /** * Hover model as reported by nitpicker */ - Genode::Lazy_volatile_object _hover_ds; + Genode::Constructible _hover_ds; /** * Reporter for posting the result of our policy decision diff --git a/repos/os/src/drivers/acpi/acpi.cc b/repos/os/src/drivers/acpi/acpi.cc index 050a9ff93..bcb17a421 100644 --- a/repos/os/src/drivers/acpi/acpi.cc +++ b/repos/os/src/drivers/acpi/acpi.cc @@ -1122,7 +1122,7 @@ class Acpi_table /* BIOS range to scan for RSDP */ enum { BIOS_BASE = 0xe0000, BIOS_SIZE = 0x20000 }; - Genode::Lazy_volatile_object _mmio; + Genode::Constructible _mmio; /** * Search for RSDP pointer signature in area diff --git a/repos/os/src/drivers/ahci/ahci.h b/repos/os/src/drivers/ahci/ahci.h index 3505bca70..17b669c29 100644 --- a/repos/os/src/drivers/ahci/ahci.h +++ b/repos/os/src/drivers/ahci/ahci.h @@ -18,7 +18,7 @@ #include #include #include -#include +#include static bool constexpr verbose = false; diff --git a/repos/os/src/drivers/ahci/ata_driver.h b/repos/os/src/drivers/ahci/ata_driver.h index 8316fd880..57129b472 100644 --- a/repos/os/src/drivers/ahci/ata_driver.h +++ b/repos/os/src/drivers/ahci/ata_driver.h @@ -181,9 +181,9 @@ struct Ata_driver : Port_driver typedef ::String Serial_string; typedef ::String Model_string; - Genode::Lazy_volatile_object info; - Genode::Lazy_volatile_object serial; - Genode::Lazy_volatile_object model; + Genode::Constructible info; + Genode::Constructible serial; + Genode::Constructible model; Io_command *io_cmd = nullptr; Block::Packet_descriptor pending[32]; diff --git a/repos/os/src/drivers/ahci/spec/x86/platform.cc b/repos/os/src/drivers/ahci/spec/x86/platform.cc index 1260eb20e..7958aa862 100644 --- a/repos/os/src/drivers/ahci/spec/x86/platform.cc +++ b/repos/os/src/drivers/ahci/spec/x86/platform.cc @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include @@ -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 pci_device; - Lazy_volatile_object irq; - addr_t res_base; - size_t res_size; + Platform::Connection pci { env }; + Platform::Device_capability pci_device_cap; + Constructible pci_device; + Constructible irq; + addr_t res_base; + size_t res_size; X86_hba(Genode::Env &env) : env(env) { diff --git a/repos/os/src/drivers/framebuffer/spec/rpi/main.cc b/repos/os/src/drivers/framebuffer/spec/rpi/main.cc index 56e54020b..883398889 100644 --- a/repos/os/src/drivers/framebuffer/spec/rpi/main.cc +++ b/repos/os/src/drivers/framebuffer/spec/rpi/main.cc @@ -12,7 +12,7 @@ */ /* Genode includes */ -#include +#include #include #include #include @@ -35,11 +35,11 @@ class Framebuffer::Session_component : public Genode::Rpc_object _bb_mem; - Attached_io_mem_dataspace _fb_mem; - Timer::Connection _timer; + size_t const _width; + size_t const _height; + Constructible _bb_mem; + Attached_io_mem_dataspace _fb_mem; + Timer::Connection _timer; void _refresh_buffered(int x, int y, int w, int h) { diff --git a/repos/os/src/drivers/platform/spec/x86/irq.h b/repos/os/src/drivers/platform/spec/x86/irq.h index 22684b8af..ec26bef55 100644 --- a/repos/os/src/drivers/platform/spec/x86/irq.h +++ b/repos/os/src/drivers/platform/spec/x86/irq.h @@ -37,7 +37,7 @@ class Platform::Irq_session_component : public Genode::Rpc_object _irq_conn; + Genode::Constructible _irq_conn; public: diff --git a/repos/os/src/drivers/platform/spec/x86/main.cc b/repos/os/src/drivers/platform/spec/x86/main.cc index 4706b41cc..d02d9af77 100644 --- a/repos/os/src/drivers/platform/spec/x86/main.cc +++ b/repos/os/src/drivers/platform/spec/x86/main.cc @@ -14,7 +14,7 @@ #include #include -#include +#include #include @@ -35,11 +35,11 @@ struct Platform::Main Genode::Env &_env; Genode::Sliced_heap sliced_heap { _env.ram(), _env.rm() }; - Genode::Lazy_volatile_object acpi_rom; - Genode::Lazy_volatile_object root; + Genode::Constructible acpi_rom; + Genode::Constructible root; - Genode::Lazy_volatile_object system_state; - Genode::Lazy_volatile_object acpi_ready; + Genode::Constructible system_state; + Genode::Constructible acpi_ready; Genode::Signal_handler _acpi_report; Genode::Signal_handler _system_report; diff --git a/repos/os/src/drivers/platform/spec/x86/pci_device_component.h b/repos/os/src/drivers/platform/spec/x86/pci_device_component.h index 3ce93ace9..8eeb8ec19 100644 --- a/repos/os/src/drivers/platform/spec/x86/pci_device_component.h +++ b/repos/os/src/drivers/platform/spec/x86/pci_device_component.h @@ -42,7 +42,7 @@ class Platform::Device_component : public Genode::Rpc_object, unsigned short _irq_line; Irq_session_component *_irq_session = nullptr; - Genode::Lazy_volatile_object _io_mem_config_extended; + Genode::Constructible _io_mem_config_extended; class Io_mem : public Genode::Io_mem_connection, public Genode::List::Element diff --git a/repos/os/src/drivers/platform/spec/x86/pci_session_component.h b/repos/os/src/drivers/platform/spec/x86/pci_session_component.h index b358d5e1d..14ca90894 100644 --- a/repos/os/src/drivers/platform/spec/x86/pci_session_component.h +++ b/repos/os/src/drivers/platform/spec/x86/pci_session_component.h @@ -22,7 +22,7 @@ #include #include -#include +#include /* os */ #include @@ -84,7 +84,7 @@ class Platform::Rmrr : public Genode::List::Element Genode::Io_mem_dataspace_capability _cap; Genode::List _bdf_list; - Genode::Lazy_volatile_object _io_mem; + Genode::Constructible _io_mem; public: diff --git a/repos/os/src/lib/config/config.cc b/repos/os/src/lib/config/config.cc index 51b34f4bd..b77bb410a 100644 --- a/repos/os/src/lib/config/config.cc +++ b/repos/os/src/lib/config/config.cc @@ -80,12 +80,12 @@ Config::Config() { } -Volatile_object &Genode::config() +Reconstructible &Genode::config() { static bool config_failed = false; if (!config_failed) { try { - static Volatile_object config_inst; + static Reconstructible config_inst; return config_inst; } catch (Genode::Rom_connection::Rom_connection_failed) { Genode::error("Could not obtain config file"); diff --git a/repos/os/src/lib/vfs/log_file_system.h b/repos/os/src/lib/vfs/log_file_system.h index 250a92e96..9a66016b4 100644 --- a/repos/os/src/lib/vfs/log_file_system.h +++ b/repos/os/src/lib/vfs/log_file_system.h @@ -16,7 +16,7 @@ #include #include -#include +#include 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 _log_connection; - Genode::Lazy_volatile_object _log_client; + Genode::Constructible _log_connection; + Genode::Constructible _log_client; Genode::Log_session & _log_session(Genode::Env &env) { diff --git a/repos/os/src/server/dynamic_rom/main.cc b/repos/os/src/server/dynamic_rom/main.cc index 136158ff6..90da33d64 100644 --- a/repos/os/src/server/dynamic_rom/main.cc +++ b/repos/os/src/server/dynamic_rom/main.cc @@ -12,7 +12,7 @@ */ /* Genode includes */ -#include +#include #include #include #include @@ -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 unsigned _last_content_idx = ~0; Signal_context_capability _sigh; - Lazy_volatile_object _ram_ds; + Constructible _ram_ds; void _notify_client() { diff --git a/repos/os/src/server/loader/main.cc b/repos/os/src/server/loader/main.cc index 283919b43..8e0cf6c79 100644 --- a/repos/os/src/server/loader/main.cc +++ b/repos/os/src/server/loader/main.cc @@ -167,7 +167,7 @@ class Loader::Session_component : public Rpc_object Signal_context_capability view_ready_sigh; - Lazy_volatile_object session; + Constructible session; Local_nitpicker_factory(Entrypoint &ep, Ram_session &ram) : _ep(ep), _ram(ram) { } @@ -215,7 +215,7 @@ class Loader::Session_component : public Rpc_object 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; + Constructible _child; /** * Return virtual nitpicker session component diff --git a/repos/os/src/server/loader/rom.h b/repos/os/src/server/loader/rom.h index 78a834830..1ff92184b 100644 --- a/repos/os/src/server/loader/rom.h +++ b/repos/os/src/server/loader/rom.h @@ -29,7 +29,7 @@ namespace Genode { Attached_ram_dataspace _fg; Attached_ram_dataspace _bg; - Lazy_volatile_object _parent_rom; + Constructible _parent_rom; bool _bg_has_pending_data; diff --git a/repos/os/src/server/nic_router/arp_cache.h b/repos/os/src/server/nic_router/arp_cache.h index 10e7924b6..cb277ef75 100644 --- a/repos/os/src/server/nic_router/arp_cache.h +++ b/repos/os/src/server/nic_router/arp_cache.h @@ -18,13 +18,13 @@ #include #include #include -#include +#include namespace Net { class Arp_cache; class Arp_cache_entry; - using Arp_cache_entry_slot = Genode::Lazy_volatile_object; + using Arp_cache_entry_slot = Genode::Constructible; } diff --git a/repos/os/src/server/nitpicker/main.cc b/repos/os/src/server/nitpicker/main.cc index e58f8248b..85e73aea6 100644 --- a/repos/os/src/server/nitpicker/main.cc +++ b/repos/os/src/server/nitpicker/main.cc @@ -1132,7 +1132,7 @@ struct Nitpicker::Main Framebuffer_screen(Framebuffer::Session &fb) : framebuffer(fb) { } }; - Genode::Volatile_object fb_screen = { framebuffer }; + Genode::Reconstructible 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 { + Genode::Reconstructible domain_registry { domain_registry_heap, Genode::Xml_node("") }; User_state user_state = { global_keys, fb_screen->screen.size() }; diff --git a/repos/os/src/server/rom_filter/main.cc b/repos/os/src/server/rom_filter/main.cc index 586cbf71a..fd91c4420 100644 --- a/repos/os/src/server/rom_filter/main.cc +++ b/repos/os/src/server/rom_filter/main.cc @@ -12,7 +12,7 @@ */ /* Genode includes */ -#include +#include #include #include #include @@ -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, Session_list &_sessions; - Lazy_volatile_object _ram_ds; + Constructible _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 _xml_ds; + Genode::Constructible _xml_ds; size_t _xml_output_len = 0; diff --git a/repos/os/src/test/audio_out/main.cc b/repos/os/src/test/audio_out/main.cc index 4fc1ce4a1..e415e1d50 100644 --- a/repos/os/src/test/audio_out/main.cc +++ b/repos/os/src/test/audio_out/main.cc @@ -47,7 +47,7 @@ class Track : Thread_deprecated<8192> { private: - Lazy_volatile_object _audio_out[CHN_CNT]; + Constructible _audio_out[CHN_CNT]; String<64> const _name; diff --git a/repos/os/src/test/audio_out_click/main.cc b/repos/os/src/test/audio_out_click/main.cc index 99681e5a0..4b044b77b 100644 --- a/repos/os/src/test/audio_out_click/main.cc +++ b/repos/os/src/test/audio_out_click/main.cc @@ -45,7 +45,7 @@ class Click { private: - Lazy_volatile_object _audio_out[CHANNELS]; + Constructible _audio_out[CHANNELS]; Attached_rom_dataspace _sample_ds; char const * const _base = _sample_ds.local_addr(); diff --git a/repos/os/src/test/bomb/main.cc b/repos/os/src/test/bomb/main.cc index c96076970..aaff0d434 100644 --- a/repos/os/src/test/bomb/main.cc +++ b/repos/os/src/test/bomb/main.cc @@ -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; + static Constructible timer; try { timer.construct(env); } catch (Parent::Service_denied) { } if (timer.constructed()) diff --git a/repos/os/src/test/fault_detection/main.cc b/repos/os/src/test/fault_detection/main.cc index 2a99c2444..d838391c6 100644 --- a/repos/os/src/test/fault_detection/main.cc +++ b/repos/os/src/test/fault_detection/main.cc @@ -141,7 +141,7 @@ struct Faulting_child_test { static char const *name() { return "failure detection in immediate child"; } - Lazy_volatile_object _child; + Constructible _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; + Constructible 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; + Constructible loader; void start_iteration(Env &env, Signal_context_capability fault_sigh) { @@ -227,9 +227,9 @@ struct Main { Env &_env; - Lazy_volatile_object > _test_1; - Lazy_volatile_object > _test_2; - Lazy_volatile_object > _test_3; + Constructible > _test_1; + Constructible > _test_2; + Constructible > _test_3; Signal_handler
_test_1_finished_handler { _env.ep(), *this, &Main::_handle_test_1_finished }; diff --git a/repos/os/src/test/framebuffer/main.cc b/repos/os/src/test/framebuffer/main.cc index e0130a492..a556f1d96 100644 --- a/repos/os/src/test/framebuffer/main.cc +++ b/repos/os/src/test/framebuffer/main.cc @@ -19,14 +19,14 @@ #include #include #include -#include +#include class Test_environment { private: - using Ds = Genode::Lazy_volatile_object; + using Ds = Genode::Constructible; enum Color { BLACK = 0x0, diff --git a/repos/os/src/test/volatile_object/main.cc b/repos/os/src/test/reconstructible/main.cc similarity index 86% rename from repos/os/src/test/volatile_object/main.cc rename to repos/os/src/test/reconstructible/main.cc index bffa1a828..fc831b719 100644 --- a/repos/os/src/test/volatile_object/main.cc +++ b/repos/os/src/test/reconstructible/main.cc @@ -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 +#include #include -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; - Lazy_volatile_object lazy_member; + Reconstructible member; + Constructible 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::Deref_unconstructed_object) { + catch (typename Reconstructible::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 inst(b_false); + Reconstructible 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; } diff --git a/repos/os/src/test/volatile_object/target.mk b/repos/os/src/test/reconstructible/target.mk similarity index 50% rename from repos/os/src/test/volatile_object/target.mk rename to repos/os/src/test/reconstructible/target.mk index 18d4861ef..44cf7ac0c 100644 --- a/repos/os/src/test/volatile_object/target.mk +++ b/repos/os/src/test/reconstructible/target.mk @@ -1,3 +1,3 @@ -TARGET = test-volatile_object +TARGET = test-reconstructible SRC_CC = main.cc LIBS = base diff --git a/repos/ports/src/lib/libc_noux/plugin.cc b/repos/ports/src/lib/libc_noux/plugin.cc index 874515c17..083708d0f 100644 --- a/repos/ports/src/lib/libc_noux/plugin.cc +++ b/repos/ports/src/lib/libc_noux/plugin.cc @@ -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. diff --git a/repos/ports/src/noux/rom_session_component.h b/repos/ports/src/noux/rom_session_component.h index 9395fd9f9..098cb5d69 100644 --- a/repos/ports/src/noux/rom_session_component.h +++ b/repos/ports/src/noux/rom_session_component.h @@ -94,12 +94,12 @@ class Noux::Rom_session_component : public Rpc_object ~Vfs_dataspace() { root_dir.release(name.string(), ds); } }; - Lazy_volatile_object _rom_from_vfs; + Constructible _rom_from_vfs; /** * Wrapped ROM session at core */ - Lazy_volatile_object _rom_from_parent; + Constructible _rom_from_parent; Dataspace_capability _init_ds_cap(Name const &name) {