mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-12 05:41:36 +00:00
parent
15141f3ca7
commit
807be83b1b
@ -55,7 +55,7 @@ Identifiers
|
||||
* 'Multi_word_identifiers' use underline to separate words.
|
||||
* 'CONSTANTS' and template arguments are upper case.
|
||||
* Private and protected members of a class begin with an '_'-character.
|
||||
* Accessor functions are named after their corresponding attributes:
|
||||
* Accessor methods are named after their corresponding attributes:
|
||||
|
||||
! /**
|
||||
! * Request private member variable
|
||||
@ -67,6 +67,10 @@ Identifiers
|
||||
! */
|
||||
! void value(int value) { _value = value; }
|
||||
|
||||
* Accessors that return a boolean value do not carry an 'is_' prefix. E.g.,
|
||||
a method for requesting the validity of an object should be named
|
||||
'valid()', not 'is_valid()'.
|
||||
|
||||
|
||||
Indentation
|
||||
===========
|
||||
@ -136,13 +140,13 @@ Braces
|
||||
! {
|
||||
! public:
|
||||
!
|
||||
! void function(void)
|
||||
! void method(void)
|
||||
! {
|
||||
! ...
|
||||
! }
|
||||
! };
|
||||
|
||||
except for single-line functions.
|
||||
except for one-line functions.
|
||||
|
||||
* All other occurrences of open braces (for 'if', 'while', 'do', 'for',
|
||||
'namespace', 'enum' etc.) are at the end of a line:
|
||||
@ -153,7 +157,8 @@ Braces
|
||||
! ..
|
||||
! }
|
||||
|
||||
* Surprisingly, one-line functions should be written on one line.
|
||||
* One-line functions should be written on a single line as long as the line
|
||||
length does not exceed approximately 80 characters.
|
||||
Typically, this applies for accessor functions.
|
||||
If slightly more space than one line is needed, indent as follows:
|
||||
|
||||
@ -164,10 +169,10 @@ Braces
|
||||
Comments
|
||||
========
|
||||
|
||||
Function header
|
||||
~~~~~~~~~~~~~~~
|
||||
Function/method header
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Each public or protected (but no private) function in a header-file should be
|
||||
Each public or protected (but no private) method in a header-file should be
|
||||
prepended by a header as follows:
|
||||
|
||||
! /**
|
||||
|
@ -161,12 +161,12 @@ namespace Genode {
|
||||
unsigned long badge() const {
|
||||
return convert_native_thread_id_to_badge(_last); }
|
||||
|
||||
bool is_write_fault() const { return (_pf_addr & 2); }
|
||||
bool write_fault() const { return (_pf_addr & 2); }
|
||||
|
||||
/**
|
||||
* Return true if last fault was an exception
|
||||
*/
|
||||
bool is_exception() const
|
||||
bool exception() const
|
||||
{
|
||||
/*
|
||||
* Reflection of exceptions is not supported on this platform.
|
||||
|
@ -46,7 +46,7 @@ addr_t Io_mem_session_component::_map_local(addr_t base, size_t size)
|
||||
|
||||
/* find appropriate region for mapping */
|
||||
void *local_base = 0;
|
||||
if (platform()->region_alloc()->alloc_aligned(size, &local_base, alignment).is_error())
|
||||
if (platform()->region_alloc()->alloc_aligned(size, &local_base, alignment).error())
|
||||
return 0;
|
||||
|
||||
/* call sigma0 for I/O region */
|
||||
|
@ -132,7 +132,7 @@ Irq_session_component::Irq_session_component(Range_allocator *irq_alloc,
|
||||
if (msi)
|
||||
throw Root::Unavailable();
|
||||
|
||||
if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).is_error()) {
|
||||
if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).error()) {
|
||||
PERR("Unavailable IRQ 0x%x requested", _irq_number);
|
||||
throw Root::Unavailable();
|
||||
}
|
||||
|
@ -172,12 +172,12 @@ namespace Genode {
|
||||
*/
|
||||
unsigned long badge() { return _badge; }
|
||||
|
||||
bool is_write_fault() const { return (_pf_addr & 2); }
|
||||
bool write_fault() const { return (_pf_addr & 2); }
|
||||
|
||||
/**
|
||||
* Return true if last fault was an exception
|
||||
*/
|
||||
bool is_exception() const
|
||||
bool exception() const
|
||||
{
|
||||
return _type == Ipc_pager::EXCEPTION;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ addr_t Io_mem_session_component::_map_local(addr_t base, size_t size)
|
||||
|
||||
/* find appropriate region for mapping */
|
||||
void *local_base = 0;
|
||||
if (platform()->region_alloc()->alloc_aligned(size, &local_base, alignment).is_error())
|
||||
if (platform()->region_alloc()->alloc_aligned(size, &local_base, alignment).error())
|
||||
return 0;
|
||||
|
||||
if (!map_local_io(base, (addr_t)local_base, size >> get_page_size_log2())) {
|
||||
|
@ -194,7 +194,7 @@ Irq_session_component::Irq_session_component(Range_allocator *irq_alloc,
|
||||
}
|
||||
msi_alloc.set(irq_number, 1);
|
||||
} else {
|
||||
if (!irq_alloc || irq_alloc->alloc_addr(1, irq_number).is_error()) {
|
||||
if (!irq_alloc || irq_alloc->alloc_addr(1, irq_number).error()) {
|
||||
PERR("Unavailable IRQ %ld requested.", irq_number);
|
||||
throw Root::Unavailable();
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ void Pager_entrypoint::entry()
|
||||
case Ipc_pager::PAGEFAULT:
|
||||
case Ipc_pager::EXCEPTION:
|
||||
{
|
||||
if (_pager.is_exception()) {
|
||||
if (_pager.exception()) {
|
||||
Lock::Guard guard(obj->state.lock);
|
||||
_pager.get_regs(&obj->state);
|
||||
obj->state.exceptions++;
|
||||
|
@ -34,7 +34,7 @@ using namespace Genode;
|
||||
|
||||
void Signal_source_component::release(Signal_context_component *context)
|
||||
{
|
||||
if (context && context->is_enqueued())
|
||||
if (context && context->enqueued())
|
||||
_signal_queue.remove(context);
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ void Signal_source_component::submit(Signal_context_component *context,
|
||||
/* enqueue signal to context */
|
||||
context->increment_signal_cnt(cnt);
|
||||
|
||||
if (!context->is_enqueued()) {
|
||||
if (!context->enqueued()) {
|
||||
_signal_queue.enqueue(context);
|
||||
|
||||
/* wake up client */
|
||||
|
@ -51,7 +51,7 @@ Core_region_map::attach(Dataspace_capability ds_cap, size_t size,
|
||||
void *virt_addr;
|
||||
if (!platform()->region_alloc()->alloc_aligned(page_rounded_size,
|
||||
&virt_addr,
|
||||
get_page_size_log2()).is_ok()) {
|
||||
get_page_size_log2()).ok()) {
|
||||
PERR("Could not allocate virtual address range in core of size %zd\n",
|
||||
page_rounded_size);
|
||||
return nullptr;
|
||||
@ -61,7 +61,7 @@ Core_region_map::attach(Dataspace_capability ds_cap, size_t size,
|
||||
unsigned num_pages = page_rounded_size >> get_page_size_log2();
|
||||
Page_flags const flags = Page_flags::apply_mapping(ds->writable(),
|
||||
ds->cacheability(),
|
||||
ds->is_io_mem());
|
||||
ds->io_mem());
|
||||
if (!map_local(ds->phys_addr(), (addr_t)virt_addr, num_pages, flags))
|
||||
return nullptr;
|
||||
|
||||
|
@ -113,7 +113,7 @@ class Genode::Ipc_pager
|
||||
/**
|
||||
* Access direction of current page fault
|
||||
*/
|
||||
bool is_write_fault() const;
|
||||
bool write_fault() const;
|
||||
|
||||
/**
|
||||
* Input mapping data as reply to current page fault
|
||||
|
@ -80,7 +80,7 @@ Irq_session_component::Irq_session_component(Range_allocator * const irq_alloc,
|
||||
}
|
||||
|
||||
/* allocate interrupt */
|
||||
if (_irq_alloc->alloc_addr(1, _irq_number).is_error()) {
|
||||
if (_irq_alloc->alloc_addr(1, _irq_number).error()) {
|
||||
PERR("unavailable interrupt %d requested", _irq_number);
|
||||
throw Root::Invalid_args();
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ Signal_context::Signal_context(Signal_receiver * const r, unsigned const imprint
|
||||
|
||||
void Signal_receiver::_add_deliverable(Signal_context * const c)
|
||||
{
|
||||
if (!c->_deliver_fe.is_enqueued()) {
|
||||
if (!c->_deliver_fe.enqueued()) {
|
||||
_deliver.enqueue(&c->_deliver_fe);
|
||||
}
|
||||
_listen();
|
||||
@ -199,7 +199,7 @@ void Signal_receiver::_listen()
|
||||
void Signal_receiver::_context_destructed(Signal_context * const c)
|
||||
{
|
||||
_contexts.remove(&c->_contexts_fe);
|
||||
if (!c->_deliver_fe.is_enqueued()) { return; }
|
||||
if (!c->_deliver_fe.enqueued()) { return; }
|
||||
_deliver.remove(&c->_deliver_fe);
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ addr_t Ipc_pager::fault_ip() const { return _fault.ip; }
|
||||
|
||||
addr_t Ipc_pager::fault_addr() const { return _fault.addr; }
|
||||
|
||||
bool Ipc_pager::is_write_fault() const { return _fault.writes; }
|
||||
bool Ipc_pager::write_fault() const { return _fault.writes; }
|
||||
|
||||
void Ipc_pager::set_reply_mapping(Mapping m) { _mapping = m; }
|
||||
|
||||
|
@ -38,7 +38,7 @@ void * Hw::Address_space::_table_alloc()
|
||||
{
|
||||
void * ret;
|
||||
if (!_cma()->alloc_aligned(sizeof(Translation_table), (void**)&ret,
|
||||
Translation_table::ALIGNM_LOG2).is_ok())
|
||||
Translation_table::ALIGNM_LOG2).ok())
|
||||
throw Root::Quota_exceeded();
|
||||
return ret;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ Platform_thread::~Platform_thread()
|
||||
/* detach UTCB of main threads */
|
||||
if (_main_thread) {
|
||||
Locked_ptr<Address_space> locked_ptr(_address_space);
|
||||
if (locked_ptr.is_valid())
|
||||
if (locked_ptr.valid())
|
||||
locked_ptr->flush((addr_t)_utcb_pd_addr, sizeof(Native_utcb));
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ int Platform_thread::start(void * const ip, void * const sp)
|
||||
|
||||
/* lock the address space */
|
||||
Locked_ptr<Address_space> locked_ptr(_address_space);
|
||||
if (!locked_ptr.is_valid()) {
|
||||
if (!locked_ptr.valid()) {
|
||||
PERR("invalid RM client");
|
||||
return -1;
|
||||
};
|
||||
|
@ -31,7 +31,7 @@ void Rm_client::unmap(addr_t, addr_t virt_base, size_t size)
|
||||
{
|
||||
Locked_ptr<Address_space> locked_address_space(_address_space);
|
||||
|
||||
if (locked_address_space.is_valid())
|
||||
if (locked_address_space.valid())
|
||||
locked_address_space->flush(virt_base, size);
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ void Pager_entrypoint::entry()
|
||||
/* apply mapping that was determined by the local region managers */
|
||||
{
|
||||
Locked_ptr<Address_space> locked_ptr(pt->address_space());
|
||||
if (!locked_ptr.is_valid()) return;
|
||||
if (!locked_ptr.valid()) return;
|
||||
|
||||
Hw::Address_space * as = static_cast<Hw::Address_space*>(&*locked_ptr);
|
||||
Page_flags const flags =
|
||||
|
@ -85,7 +85,7 @@ Vm_session_component::Vm_session_component(Rpc_entrypoint *ds_ep,
|
||||
|
||||
/* get some aligned space for the translation table */
|
||||
if (!cma->alloc_aligned(sizeof(Translation_table), (void**)&tt,
|
||||
Translation_table::ALIGNM_LOG2).is_ok()) {
|
||||
Translation_table::ALIGNM_LOG2).ok()) {
|
||||
PERR("failed to allocate kernel object");
|
||||
throw Root::Quota_exceeded();
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ addr_t Vm_session_component::_alloc_ds(size_t &ram_quota)
|
||||
addr_t addr;
|
||||
if (_ds_size() > ram_quota ||
|
||||
platform()->ram_alloc()->alloc_aligned(_ds_size(), (void**)&addr,
|
||||
get_page_size_log2()).is_error())
|
||||
get_page_size_log2()).error())
|
||||
throw Root::Quota_exceeded();
|
||||
ram_quota -= _ds_size();
|
||||
return addr;
|
||||
|
@ -86,7 +86,7 @@ Child::Process::Process(Dataspace_capability elf_ds,
|
||||
if (!elf.valid())
|
||||
throw Invalid_executable();
|
||||
|
||||
bool const dynamically_linked = elf.is_dynamically_linked();
|
||||
bool const dynamically_linked = elf.dynamically_linked();
|
||||
|
||||
local_rm.detach(elf_addr);
|
||||
|
||||
|
@ -397,8 +397,8 @@ Thread *Thread::myself()
|
||||
if (tls != 0)
|
||||
return ((Native_thread::Meta_data *)tls)->thread_base;
|
||||
|
||||
bool const is_main_thread = (lx_getpid() == lx_gettid());
|
||||
if (is_main_thread)
|
||||
bool const called_by_main_thread = (lx_getpid() == lx_gettid());
|
||||
if (called_by_main_thread)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
|
@ -18,18 +18,18 @@
|
||||
|
||||
#include <base/thread_state_base.h>
|
||||
|
||||
namespace Genode {
|
||||
namespace Genode { struct Thread_state; }
|
||||
|
||||
struct Thread_state : Thread_state_base
|
||||
{
|
||||
bool is_vcpu;
|
||||
addr_t sel_exc_base;
|
||||
|
||||
Thread_state() : is_vcpu(false), sel_exc_base(~0UL) { }
|
||||
struct Genode::Thread_state : Thread_state_base
|
||||
{
|
||||
bool vcpu;
|
||||
addr_t sel_exc_base;
|
||||
|
||||
Thread_state(bool is_vcpu, addr_t sel_exc_base)
|
||||
: is_vcpu(is_vcpu), sel_exc_base(sel_exc_base) { }
|
||||
};
|
||||
}
|
||||
Thread_state() : vcpu(false), sel_exc_base(~0UL) { }
|
||||
|
||||
Thread_state(bool vcpu, addr_t sel_exc_base)
|
||||
: vcpu(vcpu), sel_exc_base(sel_exc_base) { }
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__BASE__THREAD_STATE_H_ */
|
||||
|
@ -30,7 +30,7 @@ struct Genode::Native_thread
|
||||
|
||||
addr_t ec_sel; /* selector for execution context */
|
||||
addr_t exc_pt_sel; /* base of event portal window */
|
||||
bool is_vcpu;
|
||||
bool vcpu; /* true if thread is a virtual CPU */
|
||||
|
||||
/* receive window for capability selectors received at the server side */
|
||||
Receive_window rcv_window;
|
||||
@ -38,7 +38,7 @@ struct Genode::Native_thread
|
||||
Native_capability pager_cap;
|
||||
|
||||
Native_thread() : ec_sel(INVALID_INDEX),
|
||||
exc_pt_sel(INVALID_INDEX), is_vcpu(false) { }
|
||||
exc_pt_sel(INVALID_INDEX), vcpu(false) { }
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__NOVA__NATIVE_THREAD_H_ */
|
||||
|
@ -40,7 +40,7 @@ static inline void * alloc_region(Dataspace_component *ds, const size_t size)
|
||||
size_t align_log2 = log2(ds->size());
|
||||
for (; align_log2 >= get_page_size_log2(); align_log2--) {
|
||||
if (platform()->region_alloc()->alloc_aligned(size,
|
||||
&virt_addr, align_log2).is_ok())
|
||||
&virt_addr, align_log2).ok())
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -126,12 +126,12 @@ namespace Genode {
|
||||
/**
|
||||
* Return true if fault was a write fault
|
||||
*/
|
||||
bool is_write_fault() const { return _fault_type & ERR_W; }
|
||||
bool write_fault() const { return _fault_type & ERR_W; }
|
||||
|
||||
/**
|
||||
* Return true if last fault was an exception
|
||||
*/
|
||||
bool is_exception() const
|
||||
bool exception() const
|
||||
{
|
||||
/*
|
||||
* Reflection of exceptions is not supported on this platform.
|
||||
|
@ -56,9 +56,9 @@ namespace Genode {
|
||||
addr_t _sel_sc() const { return _id_base + 2; }
|
||||
|
||||
/* convenience function to access _feature variable */
|
||||
inline bool is_main_thread() const { return _features & MAIN_THREAD; }
|
||||
inline bool is_vcpu() const { return _features & VCPU; }
|
||||
inline bool is_worker() const { return _features & WORKER; }
|
||||
inline bool main_thread() const { return _features & MAIN_THREAD; }
|
||||
inline bool vcpu() const { return _features & VCPU; }
|
||||
inline bool worker() const { return _features & WORKER; }
|
||||
|
||||
public:
|
||||
|
||||
|
@ -70,7 +70,7 @@ static bool msi(Genode::addr_t irq_sel, Genode::addr_t phys_mem,
|
||||
Genode::Signal_context_capability sig_cap)
|
||||
{
|
||||
void * virt = 0;
|
||||
if (platform()->region_alloc()->alloc_aligned(4096, &virt, 12).is_error())
|
||||
if (platform()->region_alloc()->alloc_aligned(4096, &virt, 12).error())
|
||||
return false;
|
||||
|
||||
Genode::addr_t virt_addr = reinterpret_cast<Genode::addr_t>(virt);
|
||||
@ -216,7 +216,7 @@ Irq_session_component::Irq_session_component(Range_allocator *irq_alloc,
|
||||
throw Root::Unavailable();
|
||||
}
|
||||
|
||||
if (!irq_alloc || irq_alloc->alloc_addr(1, irq_number).is_error()) {
|
||||
if (!irq_alloc || irq_alloc->alloc_addr(1, irq_number).error()) {
|
||||
PERR("Unavailable IRQ 0x%lx requested", irq_number);
|
||||
throw Root::Unavailable();
|
||||
}
|
||||
|
@ -611,7 +611,7 @@ Platform::Platform() :
|
||||
addr_t const virt = mapped_cmd_line + get_page_size() * 2;
|
||||
addr_t const phys = round_page(mem_desc->aux);
|
||||
|
||||
if (region_alloc()->alloc_addr(get_page_size(), virt).is_ok()) {
|
||||
if (region_alloc()->alloc_addr(get_page_size(), virt).ok()) {
|
||||
/* we got the virtual region */
|
||||
err = map_local(__main_thread_utcb, phys, virt, 1,
|
||||
Nova::Rights(true, false, false), true);
|
||||
|
@ -55,7 +55,7 @@ int Platform_thread::start(void *ip, void *sp)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!_pd || (is_main_thread() && !is_vcpu() &&
|
||||
if (!_pd || (main_thread() && !vcpu() &&
|
||||
_pd->parent_pt_sel() == Native_thread::INVALID_INDEX)) {
|
||||
PERR("protection domain undefined");
|
||||
return -2;
|
||||
@ -68,9 +68,9 @@ int Platform_thread::start(void *ip, void *sp)
|
||||
return -8;
|
||||
}
|
||||
|
||||
if (!is_main_thread()) {
|
||||
if (!main_thread()) {
|
||||
addr_t const initial_sp = reinterpret_cast<addr_t>(sp);
|
||||
addr_t const utcb = is_vcpu() ? 0 : round_page(initial_sp);
|
||||
addr_t const utcb = vcpu() ? 0 : round_page(initial_sp);
|
||||
|
||||
if (_sel_exc_base == Native_thread::INVALID_INDEX) {
|
||||
PERR("exception base not specified");
|
||||
@ -114,9 +114,9 @@ int Platform_thread::start(void *ip, void *sp)
|
||||
|
||||
addr_t pd_core_sel = Platform_pd::pd_core_sel();
|
||||
addr_t pd_utcb = 0;
|
||||
_sel_exc_base = is_vcpu() ? _pager->exc_pt_vcpu() : _pager->exc_pt_sel_client();
|
||||
_sel_exc_base = vcpu() ? _pager->exc_pt_vcpu() : _pager->exc_pt_sel_client();
|
||||
|
||||
if (!is_vcpu()) {
|
||||
if (!vcpu()) {
|
||||
pd_utcb = stack_area_virtual_base() + stack_virtual_size() - get_page_size();
|
||||
|
||||
addr_t remap_src[] = { _pd->parent_pt_sel(), _pager->Object_pool<Pager_object>::Entry::cap().local_name() };
|
||||
@ -136,7 +136,7 @@ int Platform_thread::start(void *ip, void *sp)
|
||||
addr_t const rights = Obj_crd::RIGHT_EC_RECALL |
|
||||
Obj_crd::RIGHT_PT_CTRL | Obj_crd::RIGHT_PT_CALL |
|
||||
Obj_crd::RIGHT_SM_UP | Obj_crd::RIGHT_SM_DOWN;
|
||||
unsigned pts = is_vcpu() ? NUM_INITIAL_VCPU_PT_LOG2 : NUM_INITIAL_PT_LOG2;
|
||||
unsigned pts = vcpu() ? NUM_INITIAL_VCPU_PT_LOG2 : NUM_INITIAL_PT_LOG2;
|
||||
|
||||
enum { KEEP_FREE_PAGES_NOT_AVAILABLE_FOR_UPGRADE = 2, UPPER_LIMIT_PAGES = 32 };
|
||||
Obj_crd initial_pts(_sel_exc_base, pts, rights);
|
||||
@ -215,7 +215,7 @@ Native_capability Platform_thread::pause()
|
||||
cancel_blocking();
|
||||
|
||||
/* local thread may never get be canceled if it doesn't receive an IPC */
|
||||
if (is_worker()) return Native_capability();
|
||||
if (worker()) return Native_capability();
|
||||
|
||||
return notify_sm;
|
||||
}
|
||||
@ -225,7 +225,7 @@ void Platform_thread::resume()
|
||||
{
|
||||
using namespace Nova;
|
||||
|
||||
if (!is_worker()) {
|
||||
if (!worker()) {
|
||||
uint8_t res;
|
||||
do {
|
||||
if (!_pd) {
|
||||
@ -256,7 +256,7 @@ Thread_state Platform_thread::state()
|
||||
if (_pager->copy_thread_state(&s))
|
||||
return s;
|
||||
|
||||
if (is_worker()) {
|
||||
if (worker()) {
|
||||
s.sp = _pager->initial_esp();
|
||||
return s;
|
||||
}
|
||||
@ -274,18 +274,18 @@ void Platform_thread::state(Thread_state s)
|
||||
/*
|
||||
* s.sel_exc_base exception base of thread in caller
|
||||
* protection domain - not in Core !
|
||||
* s.is_vcpu If true it will run as vCPU,
|
||||
* s.vcpu If true it will run as vCPU,
|
||||
* otherwise it will be a thread.
|
||||
*/
|
||||
if (!is_main_thread())
|
||||
if (!main_thread())
|
||||
_sel_exc_base = s.sel_exc_base;
|
||||
|
||||
if (!s.is_vcpu)
|
||||
if (!s.vcpu)
|
||||
return;
|
||||
|
||||
_features |= VCPU;
|
||||
|
||||
if (is_main_thread() && _pager)
|
||||
if (main_thread() && _pager)
|
||||
_pager->prepare_vCPU_portals();
|
||||
}
|
||||
|
||||
@ -304,7 +304,7 @@ Native_capability Platform_thread::single_step_sync(bool on)
|
||||
|
||||
Native_capability cap = _pager->single_step(on);
|
||||
|
||||
if (is_worker()) return Native_capability();
|
||||
if (worker()) return Native_capability();
|
||||
|
||||
return cap;
|
||||
}
|
||||
@ -334,7 +334,7 @@ unsigned long long Platform_thread::execution_time() const
|
||||
* For local ECs, we simply return 0 as local ECs are executed with the
|
||||
* time of their callers.
|
||||
*/
|
||||
if (is_worker())
|
||||
if (worker())
|
||||
return time;
|
||||
|
||||
uint8_t res = Nova::sc_ctrl(_sel_sc(), time);
|
||||
|
@ -42,7 +42,7 @@ static inline void * alloc_region(Dataspace_component *ds, const size_t size)
|
||||
size_t align_log2 = log2(ds->size());
|
||||
for (; align_log2 >= get_page_size_log2(); align_log2--) {
|
||||
if (platform()->region_alloc()->alloc_aligned(size,
|
||||
&virt_addr, align_log2).is_ok())
|
||||
&virt_addr, align_log2).ok())
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,6 @@ void Rm_client::unmap(addr_t, addr_t virt_base, size_t size)
|
||||
{
|
||||
Locked_ptr<Address_space> locked_address_space(_address_space);
|
||||
|
||||
if (locked_address_space.is_valid())
|
||||
if (locked_address_space.valid())
|
||||
locked_address_space->flush(virt_base, size);
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ void Thread::start()
|
||||
/* create EC at core */
|
||||
Thread_state state;
|
||||
state.sel_exc_base = native_thread().exc_pt_sel;
|
||||
state.is_vcpu = native_thread().is_vcpu;
|
||||
state.vcpu = native_thread().vcpu;
|
||||
|
||||
/* local thread have no start instruction pointer - set via portal entry */
|
||||
addr_t thread_ip = global ? reinterpret_cast<addr_t>(_thread_start) : 0;
|
||||
@ -183,7 +183,7 @@ void Thread::start()
|
||||
using namespace Nova;
|
||||
|
||||
/* request exception portals for normal threads */
|
||||
if (!native_thread().is_vcpu) {
|
||||
if (!native_thread().vcpu) {
|
||||
request_event_portal(pager_cap, native_thread().exc_pt_sel, 0, NUM_INITIAL_PT_LOG2);
|
||||
|
||||
/* default: we don't accept any mappings or translations */
|
||||
|
@ -161,12 +161,12 @@ namespace Genode {
|
||||
/**
|
||||
* Return true if last fault was a write fault
|
||||
*/
|
||||
bool is_write_fault() const { return L4_Label(_faulter_tag) & 2; }
|
||||
bool write_fault() const { return L4_Label(_faulter_tag) & 2; }
|
||||
|
||||
/**
|
||||
* Return true if last fault was an exception
|
||||
*/
|
||||
bool is_exception() const
|
||||
bool exception() const
|
||||
{
|
||||
/*
|
||||
* A page-fault message has one of the op bits (lower 3 bits of the
|
||||
|
@ -144,7 +144,7 @@ Irq_session_component::Irq_session_component(Range_allocator *irq_alloc,
|
||||
if (msi)
|
||||
throw Root::Unavailable();
|
||||
|
||||
if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).is_error()) {
|
||||
if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).error()) {
|
||||
PERR("Unavailable IRQ 0x%x requested", _irq_number);
|
||||
throw Root::Unavailable();
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ void Ipc_pager::wait_for_fault()
|
||||
*/
|
||||
|
||||
/* exception */
|
||||
if (is_exception()) {
|
||||
if (exception()) {
|
||||
L4_StoreMR(1, &_fault_ip);
|
||||
|
||||
if (verbose_exception)
|
||||
|
@ -24,6 +24,6 @@ void Rm_client::unmap(addr_t, addr_t virt_base, size_t size)
|
||||
{
|
||||
Locked_ptr<Address_space> locked_address_space(_address_space);
|
||||
|
||||
if (locked_address_space.is_valid())
|
||||
if (locked_address_space.valid())
|
||||
locked_address_space->flush(virt_base, size);
|
||||
}
|
||||
|
@ -168,12 +168,12 @@ namespace Genode {
|
||||
/**
|
||||
* Return true if last fault was a write fault
|
||||
*/
|
||||
bool is_write_fault() const { return (_flags & 2); }
|
||||
bool write_fault() const { return (_flags & 2); }
|
||||
|
||||
/**
|
||||
* Return true if last fault was an exception
|
||||
*/
|
||||
bool is_exception() const
|
||||
bool exception() const
|
||||
{
|
||||
/*
|
||||
* Reflection of exceptions is not supported on this platform.
|
||||
|
@ -83,7 +83,7 @@ addr_t Io_mem_session_component::_map_local(addr_t base, size_t size)
|
||||
|
||||
/* find appropriate region for mapping */
|
||||
void *result = 0;
|
||||
if (platform()->region_alloc()->alloc_aligned(size, &result, alignment).is_error())
|
||||
if (platform()->region_alloc()->alloc_aligned(size, &result, alignment).error())
|
||||
PERR("alloc_aligned failed!");
|
||||
|
||||
local_base = (addr_t)result;
|
||||
|
@ -137,7 +137,7 @@ Irq_session_component::Irq_session_component(Range_allocator *irq_alloc,
|
||||
if (msi)
|
||||
throw Root::Unavailable();
|
||||
|
||||
if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).is_error()) {
|
||||
if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).error()) {
|
||||
PERR("Unavailable IRQ 0x%x requested", _irq_number);
|
||||
throw Root::Unavailable();
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ enum { PAGER_STACK_ELEMENTS = 512 };
|
||||
static unsigned long _core_pager_stack[PAGER_STACK_ELEMENTS];
|
||||
|
||||
|
||||
static inline bool is_write_fault(Pistachio::L4_Word_t flags) {
|
||||
static inline bool write_fault(Pistachio::L4_Word_t flags) {
|
||||
return (flags & 2) == 1; }
|
||||
|
||||
|
||||
@ -169,7 +169,7 @@ static void _core_pager_loop()
|
||||
/* check for NULL pointer */
|
||||
if (pf_addr < page_size) {
|
||||
PERR("possible null pointer %s at address %lx at EIP %lx in",
|
||||
is_write_fault(flags) ? "WRITE" : "READ/EXEC", pf_addr, pf_ip);
|
||||
write_fault(flags) ? "WRITE" : "READ/EXEC", pf_addr, pf_ip);
|
||||
print_l4_thread_id(t);
|
||||
/* do not unblock faulter */
|
||||
break;
|
||||
@ -177,7 +177,7 @@ static void _core_pager_loop()
|
||||
/* page-fault address is not in RAM */
|
||||
|
||||
PERR("%s access outside of RAM at %lx IP %lx",
|
||||
is_write_fault(flags) ? "WRITE" : "READ", pf_addr, pf_ip);
|
||||
write_fault(flags) ? "WRITE" : "READ", pf_addr, pf_ip);
|
||||
print_l4_thread_id(t);
|
||||
/* do not unblock faulter */
|
||||
break;
|
||||
|
@ -141,12 +141,12 @@ namespace Genode {
|
||||
/**
|
||||
* Return true if page fault was a write fault
|
||||
*/
|
||||
bool is_write_fault() const { return _pf_write; }
|
||||
bool write_fault() const { return _pf_write; }
|
||||
|
||||
/**
|
||||
* Return true if last fault was an exception
|
||||
*/
|
||||
bool is_exception() const
|
||||
bool exception() const
|
||||
{
|
||||
/*
|
||||
* Reflection of exceptions is not supported on this platform.
|
||||
|
@ -38,7 +38,7 @@ struct Genode::Untyped_memory
|
||||
phys_alloc.alloc_aligned(num_pages*get_page_size(), &out_ptr,
|
||||
get_page_size_log2());
|
||||
|
||||
if (alloc_ret.is_error()) {
|
||||
if (alloc_ret.error()) {
|
||||
PERR("%s: allocation of untyped memory failed", __FUNCTION__);
|
||||
throw Phys_alloc_failed();
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ Irq_session_component::Irq_session_component(Range_allocator *irq_alloc,
|
||||
if (msi)
|
||||
throw Root::Unavailable();
|
||||
|
||||
if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).is_error()) {
|
||||
if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).error()) {
|
||||
PERR("Unavailable IRQ 0x%x requested", _irq_number);
|
||||
throw Root::Unavailable();
|
||||
}
|
||||
|
@ -302,7 +302,7 @@ void Platform::_init_rom_modules()
|
||||
Range_allocator::Alloc_return const alloc_ret =
|
||||
_unused_phys_alloc.alloc_aligned(modules_size, &out_ptr, get_page_size_log2());
|
||||
|
||||
if (alloc_ret.is_error()) {
|
||||
if (alloc_ret.error()) {
|
||||
PERR("could not reserve phys CNode space for boot modules");
|
||||
struct Init_rom_modules_failed { };
|
||||
throw Init_rom_modules_failed();
|
||||
|
@ -21,6 +21,6 @@ void Rm_client::unmap(addr_t core_local_base, addr_t virt_base, size_t size)
|
||||
{
|
||||
Locked_ptr<Address_space> locked_address_space(_address_space);
|
||||
|
||||
if (locked_address_space.is_valid())
|
||||
if (locked_address_space.valid())
|
||||
locked_address_space->flush(virt_base, size);
|
||||
}
|
||||
|
@ -150,8 +150,14 @@ struct Genode::Range_allocator : Allocator
|
||||
Value const value;
|
||||
Alloc_return(Value value) : value(value) { }
|
||||
|
||||
bool is_ok() const { return value == OK; }
|
||||
bool is_error() const { return !is_ok(); }
|
||||
bool ok() const { return value == OK; }
|
||||
bool error() const { return !ok(); }
|
||||
|
||||
/*
|
||||
* \deprecated use 'ok' and 'error' instead
|
||||
*/
|
||||
bool is_ok() const { return ok(); }
|
||||
bool is_error() const { return error(); }
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -282,7 +282,7 @@ class Genode::Allocator_avl_base : public Range_allocator
|
||||
bool alloc(size_t size, void **out_addr) override
|
||||
{
|
||||
return (Allocator_avl_base::alloc_aligned(
|
||||
size, out_addr, log2(sizeof(addr_t))).is_ok());
|
||||
size, out_addr, log2(sizeof(addr_t))).ok());
|
||||
}
|
||||
|
||||
void free(void *addr, size_t) override { free(addr); }
|
||||
|
@ -109,7 +109,7 @@ class Genode::Attached_rom_dataspace
|
||||
* the existing dataspace, we can keep everything in place. The
|
||||
* dataspace content gets updated by the call of '_rom.update'.
|
||||
*/
|
||||
if (_ds.is_constructed() && _rom.update() == true)
|
||||
if (_ds.constructed() && _rom.update() == true)
|
||||
return;
|
||||
|
||||
/*
|
||||
@ -123,7 +123,15 @@ class Genode::Attached_rom_dataspace
|
||||
/**
|
||||
* Return true of content is present
|
||||
*/
|
||||
bool is_valid() const { return _ds.is_constructed(); }
|
||||
bool valid() const { return _ds.constructed(); }
|
||||
|
||||
/**
|
||||
* Return true of content is present
|
||||
*
|
||||
* \noapi
|
||||
* \deprecated use 'valid' instead
|
||||
*/
|
||||
bool is_valid() const { return valid(); }
|
||||
|
||||
/**
|
||||
* Return dataspace content as XML node
|
||||
@ -135,7 +143,7 @@ class Genode::Attached_rom_dataspace
|
||||
Xml_node xml() const
|
||||
{
|
||||
try {
|
||||
if (is_valid() && local_addr<void const>())
|
||||
if (valid() && local_addr<void const>())
|
||||
return Xml_node(local_addr<char>(), size());
|
||||
} catch (Xml_node::Invalid_syntax) { }
|
||||
|
||||
|
@ -140,7 +140,7 @@ class Genode::Object_pool
|
||||
|
||||
{
|
||||
Locked_ptr lock_ptr(ptr);
|
||||
Object_pointer op = lock_ptr.is_valid()
|
||||
Object_pointer op = lock_ptr.valid()
|
||||
? dynamic_cast<Object_pointer>(&lock_ptr->obj) : nullptr;
|
||||
return func(op);
|
||||
}
|
||||
@ -170,7 +170,7 @@ class Genode::Object_pool
|
||||
Weak_ptr ptr = obj->_lock.weak_ptr();
|
||||
{
|
||||
Locked_ptr lock_ptr(ptr);
|
||||
if (!lock_ptr.is_valid()) return;
|
||||
if (!lock_ptr.valid()) return;
|
||||
|
||||
_tree.remove(obj);
|
||||
}
|
||||
|
@ -106,9 +106,17 @@ class Genode::Rpc_in_buffer : public Rpc_in_buffer_base
|
||||
/**
|
||||
* Return true if buffer contains a valid null-terminated string
|
||||
*/
|
||||
bool is_valid_string() const {
|
||||
bool valid_string() const {
|
||||
return (_size <= MAX_SIZE) && (_size > 0) && (_base[_size - 1] == '\0'); }
|
||||
|
||||
/**
|
||||
* Return true if buffer contains a valid null-terminated string
|
||||
*
|
||||
* \noapi
|
||||
* \deprecated use valid_string instead
|
||||
*/
|
||||
bool is_valid_string() const { return valid_string(); }
|
||||
|
||||
/**
|
||||
* Return buffer content as null-terminated string
|
||||
*
|
||||
@ -117,9 +125,9 @@ class Genode::Rpc_in_buffer : public Rpc_in_buffer_base
|
||||
* The method returns an empty string if the buffer does not hold
|
||||
* a valid null-terminated string. To distinguish a buffer holding
|
||||
* an invalid string from a buffer holding a valid empty string,
|
||||
* the function 'is_valid_string' can be used.
|
||||
* the function 'valid_string' can be used.
|
||||
*/
|
||||
char const *string() const { return is_valid_string() ? base() : ""; }
|
||||
char const *string() const { return valid_string() ? base() : ""; }
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__BASE__RPC_ARGS_H_ */
|
||||
|
@ -118,9 +118,14 @@ class Genode::Trace::Buffer
|
||||
|
||||
public:
|
||||
|
||||
size_t length() const { return _entry->len; }
|
||||
char const *data() const { return _entry->data; }
|
||||
bool is_last() const { return _entry == 0; }
|
||||
size_t length() const { return _entry->len; }
|
||||
char const *data() const { return _entry->data; }
|
||||
bool last() const { return _entry == 0; }
|
||||
|
||||
/*
|
||||
* \deprecated use 'last' instead
|
||||
*/
|
||||
bool is_last() const { return last(); }
|
||||
};
|
||||
|
||||
Entry first() const
|
||||
@ -130,7 +135,7 @@ class Genode::Trace::Buffer
|
||||
|
||||
Entry next(Entry entry) const
|
||||
{
|
||||
if (entry.is_last())
|
||||
if (entry.last())
|
||||
return Entry(0);
|
||||
|
||||
if (entry.length() == 0)
|
||||
|
@ -49,9 +49,9 @@ struct Genode::Trace::Logger
|
||||
|
||||
Logger();
|
||||
|
||||
bool is_initialized() { return control != 0; }
|
||||
bool initialized() { return control != 0; }
|
||||
|
||||
bool is_init_pending() { return pending_init; }
|
||||
bool init_pending() { return pending_init; }
|
||||
|
||||
void init_pending(bool val) { pending_init = val; }
|
||||
|
||||
|
@ -313,7 +313,7 @@ struct Genode::Weak_object : Genode::Weak_object_base
|
||||
* Locked pointer
|
||||
*
|
||||
* A locked pointer is constructed from a weak pointer. After construction,
|
||||
* its validity can (and should) be checked by calling the 'is_valid'
|
||||
* its validity can (and should) be checked by calling the 'valid'
|
||||
* method. If the locked pointer is valid, the pointed-to object is known to
|
||||
* be locked until the locked pointer is destroyed. During this time, the
|
||||
* locked pointer can safely be de-referenced.
|
||||
@ -338,7 +338,15 @@ struct Genode::Locked_ptr : Genode::Locked_ptr_base
|
||||
* Only if valid, the locked pointer can be de-referenced. Otherwise,
|
||||
* the attempt will result in a null-pointer access.
|
||||
*/
|
||||
bool is_valid() const { return curr != nullptr; }
|
||||
bool valid() const { return curr != nullptr; }
|
||||
|
||||
/**
|
||||
* Returns true if the locked pointer is valid
|
||||
*
|
||||
* \noapi
|
||||
* \deprecated use 'valid' instead
|
||||
*/
|
||||
bool is_valid() const { return valid(); }
|
||||
};
|
||||
|
||||
|
||||
|
@ -202,7 +202,7 @@ class Genode::Root_component : public Rpc_object<Typed_root<SESSION_TYPE> >,
|
||||
Session_capability session(Root::Session_args const &args,
|
||||
Affinity const &affinity) override
|
||||
{
|
||||
if (!args.is_valid_string()) throw Root::Invalid_args();
|
||||
if (!args.valid_string()) throw Root::Invalid_args();
|
||||
|
||||
POLICY::aquire(args.string());
|
||||
|
||||
@ -246,7 +246,7 @@ class Genode::Root_component : public Rpc_object<Typed_root<SESSION_TYPE> >,
|
||||
|
||||
void upgrade(Session_capability session, Root::Upgrade_args const &args) override
|
||||
{
|
||||
if (!args.is_valid_string()) throw Root::Invalid_args();
|
||||
if (!args.valid_string()) throw Root::Invalid_args();
|
||||
|
||||
_ep->apply(session, [&] (SESSION_TYPE *s) {
|
||||
if (!s) return;
|
||||
|
@ -39,17 +39,25 @@ class Genode::Fifo
|
||||
|
||||
friend class Fifo;
|
||||
|
||||
QT *_next;
|
||||
bool _is_enqueued;
|
||||
QT *_next;
|
||||
bool _enqueued;
|
||||
|
||||
public:
|
||||
|
||||
Element(): _next(0), _is_enqueued(false) { }
|
||||
Element(): _next(0), _enqueued(false) { }
|
||||
|
||||
/**
|
||||
* Return true is fifo element is enqueued in a fifo
|
||||
*/
|
||||
bool is_enqueued() { return _is_enqueued; }
|
||||
bool enqueued() { return _enqueued; }
|
||||
|
||||
/**
|
||||
* Return true is fifo element is enqueued in a fifo
|
||||
*
|
||||
* \noapi
|
||||
* \deprecated use 'enqueued' instead
|
||||
*/
|
||||
bool is_enqueued() { return enqueued(); }
|
||||
|
||||
/**
|
||||
* Return next element in queue
|
||||
@ -107,7 +115,7 @@ class Genode::Fifo
|
||||
}
|
||||
|
||||
qe->Element::_next = 0;
|
||||
qe->Element::_is_enqueued = 0;
|
||||
qe->Element::_enqueued = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -116,7 +124,7 @@ class Genode::Fifo
|
||||
void enqueue(QT *e)
|
||||
{
|
||||
e->Fifo::Element::_next = 0;
|
||||
e->Fifo::Element::_is_enqueued = true;
|
||||
e->Fifo::Element::_enqueued = true;
|
||||
|
||||
if (empty()) {
|
||||
_tail = _head = e;
|
||||
@ -146,7 +154,7 @@ class Genode::Fifo
|
||||
/* mark fifo queue element as free */
|
||||
if (result) {
|
||||
result->Fifo::Element::_next = 0;
|
||||
result->Fifo::Element::_is_enqueued = false;
|
||||
result->Fifo::Element::_enqueued = false;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -130,7 +130,14 @@ class Genode::Volatile_object
|
||||
/**
|
||||
* Return true of volatile object contains a constructed object
|
||||
*/
|
||||
bool is_constructed() const { return _constructed; }
|
||||
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
|
||||
|
@ -304,7 +304,7 @@ class Genode::Xml_node
|
||||
/**
|
||||
* Return true if tag is the start of a valid XML node
|
||||
*/
|
||||
bool is_node() const { return _type == START || _type == EMPTY; }
|
||||
bool node() const { return _type == START || _type == EMPTY; }
|
||||
|
||||
/**
|
||||
* Return first token of tag
|
||||
@ -507,7 +507,7 @@ class Genode::Xml_node
|
||||
}
|
||||
|
||||
/* count sub nodes at depth 1 */
|
||||
if (depth == 1 && curr_tag.is_node())
|
||||
if (depth == 1 && curr_tag.node())
|
||||
_num_sub_nodes++;
|
||||
|
||||
/* keep track of the current depth */
|
||||
@ -758,12 +758,20 @@ class Genode::Xml_node
|
||||
/**
|
||||
* Return true if node is the last of a node sequence
|
||||
*/
|
||||
bool is_last(const char *type = 0) const
|
||||
bool last(const char *type = 0) const
|
||||
{
|
||||
try { next(type); return false; }
|
||||
catch (Nonexistent_sub_node) { return true; }
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if node is the last of a node sequence
|
||||
*
|
||||
* \noapi
|
||||
* \deprecated use 'last' instead
|
||||
*/
|
||||
bool is_last(const char *type = 0) const { return last(); }
|
||||
|
||||
/**
|
||||
* Return sub node with specified index
|
||||
*
|
||||
|
@ -45,7 +45,7 @@ Mapped_mem_allocator::alloc_aligned(size_t size, void **out_addr, int align, add
|
||||
/* allocate physical pages */
|
||||
Alloc_return ret1 = _phys_alloc->alloc_aligned(page_rounded_size,
|
||||
&phys_addr, align, from, to);
|
||||
if (!ret1.is_ok()) {
|
||||
if (!ret1.ok()) {
|
||||
PERR("Could not allocate physical memory region of size %zu\n",
|
||||
page_rounded_size);
|
||||
return ret1;
|
||||
@ -54,7 +54,7 @@ Mapped_mem_allocator::alloc_aligned(size_t size, void **out_addr, int align, add
|
||||
/* allocate range in core's virtual address space */
|
||||
Alloc_return ret2 = _virt_alloc->alloc_aligned(page_rounded_size,
|
||||
out_addr, align);
|
||||
if (!ret2.is_ok()) {
|
||||
if (!ret2.ok()) {
|
||||
PERR("Could not allocate virtual address range in core of size %zu\n",
|
||||
page_rounded_size);
|
||||
|
||||
|
@ -174,7 +174,7 @@ class Genode::Mapped_mem_allocator : public Genode::Core_mem_translator
|
||||
*************************/
|
||||
|
||||
bool alloc(size_t size, void **out_addr) override {
|
||||
return alloc_aligned(size, out_addr, log2(sizeof(addr_t))).is_ok(); }
|
||||
return alloc_aligned(size, out_addr, log2(sizeof(addr_t))).ok(); }
|
||||
void free(void *addr, size_t) override;
|
||||
size_t consumed() const override { return _phys_alloc->consumed(); }
|
||||
size_t overhead(size_t size) const override {
|
||||
@ -300,7 +300,7 @@ class Genode::Core_mem_allocator : public Genode::Core_mem_translator
|
||||
*************************/
|
||||
|
||||
bool alloc(size_t size, void **out_addr) override {
|
||||
return alloc_aligned(size, out_addr, log2(sizeof(addr_t))).is_ok(); }
|
||||
return alloc_aligned(size, out_addr, log2(sizeof(addr_t))).ok(); }
|
||||
|
||||
void free(void *addr, size_t size) override
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ namespace Genode {
|
||||
addr_t const _phys_addr; /* address of dataspace in physical memory */
|
||||
addr_t _core_local_addr; /* address of core-local mapping */
|
||||
size_t const _size; /* size of dataspace in bytes */
|
||||
bool const _is_io_mem; /* dataspace is I/O mem, not to be touched */
|
||||
bool const _io_mem; /* dataspace is I/O mem, not to be touched */
|
||||
Cache_attribute const _cache; /* access memory cached, write-combined, or
|
||||
uncached respectively */
|
||||
bool const _writable; /* false if dataspace is read-only */
|
||||
@ -73,7 +73,7 @@ namespace Genode {
|
||||
Dataspace_component()
|
||||
:
|
||||
_phys_addr(0), _core_local_addr(0), _size(0),
|
||||
_is_io_mem(false), _cache(CACHED), _writable(false),
|
||||
_io_mem(false), _cache(CACHED), _writable(false),
|
||||
_owner(0), _managed(false) { }
|
||||
|
||||
/**
|
||||
@ -86,7 +86,7 @@ namespace Genode {
|
||||
Dataspace_owner *owner)
|
||||
:
|
||||
_phys_addr(core_local_addr), _core_local_addr(core_local_addr),
|
||||
_size(round_page(size)), _is_io_mem(false),
|
||||
_size(round_page(size)), _io_mem(false),
|
||||
_cache(cache), _writable(writable),
|
||||
_owner(owner), _managed(false) { }
|
||||
|
||||
@ -105,7 +105,7 @@ namespace Genode {
|
||||
bool writable, Dataspace_owner *owner)
|
||||
:
|
||||
_phys_addr(phys_addr), _core_local_addr(core_local_addr),
|
||||
_size(size), _is_io_mem(true), _cache(cache),
|
||||
_size(size), _io_mem(true), _cache(cache),
|
||||
_writable(writable), _owner(owner), _managed(false) { }
|
||||
|
||||
/**
|
||||
@ -121,7 +121,7 @@ namespace Genode {
|
||||
virtual Native_capability sub_rm() { return Dataspace_capability(); }
|
||||
|
||||
addr_t core_local_addr() const { return _core_local_addr; }
|
||||
bool is_io_mem() const { return _is_io_mem; }
|
||||
bool io_mem() const { return _io_mem; }
|
||||
Cache_attribute cacheability() const { return _cache; }
|
||||
|
||||
/**
|
||||
@ -156,10 +156,11 @@ namespace Genode {
|
||||
** Dataspace interface **
|
||||
*************************/
|
||||
|
||||
size_t size() { return _size; }
|
||||
addr_t phys_addr() { return _phys_addr; }
|
||||
bool writable() { return _writable; }
|
||||
bool is_managed() { return _managed; }
|
||||
size_t size() override { return _size; }
|
||||
addr_t phys_addr() override { return _phys_addr; }
|
||||
bool writable() override { return _writable; }
|
||||
|
||||
bool managed() { return _managed; }
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ namespace Genode {
|
||||
|
||||
size_t write(String const &string_buf)
|
||||
{
|
||||
if (!(string_buf.is_valid_string())) {
|
||||
if (!(string_buf.valid_string())) {
|
||||
PERR("corrupted string");
|
||||
return 0;
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ class Genode::Signal_source_component : public Signal_source_rpc_object
|
||||
|
||||
Genode::Signal_context_component::~Signal_context_component()
|
||||
{
|
||||
if (is_enqueued() && _source)
|
||||
if (enqueued() && _source)
|
||||
_source->release(this);
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ class Genode::Trace::Policy : public Genode::List<Genode::Trace::Policy>::Elemen
|
||||
|
||||
Allocator &md_alloc() { return _md_alloc; }
|
||||
|
||||
bool is_owned_by(Policy_owner const &owner) const
|
||||
bool owned_by(Policy_owner const &owner) const
|
||||
{
|
||||
return &_owner == &owner;
|
||||
}
|
||||
@ -81,7 +81,7 @@ class Genode::Trace::Policy_registry
|
||||
Policy *_unsynchronized_lookup(Policy_owner const &owner, Policy_id id)
|
||||
{
|
||||
for (Policy *p = _policies.first(); p; p = p->next())
|
||||
if (p->is_owned_by(owner) && p->has_id(id))
|
||||
if (p->owned_by(owner) && p->has_id(id))
|
||||
return p;
|
||||
|
||||
throw Nonexistent_policy();
|
||||
@ -90,7 +90,7 @@ class Genode::Trace::Policy_registry
|
||||
Policy *_any_policy_owned_by(Policy_owner const &owner)
|
||||
{
|
||||
for (Policy *p = _policies.first(); p; p = p->next())
|
||||
if (p->is_owned_by(owner))
|
||||
if (p->owned_by(owner))
|
||||
return p;
|
||||
|
||||
return 0;
|
||||
@ -123,7 +123,7 @@ class Genode::Trace::Policy_registry
|
||||
Policy *tmp = p;
|
||||
p = p->next();
|
||||
|
||||
if (tmp->is_owned_by(owner) && tmp->has_id(id)) {
|
||||
if (tmp->owned_by(owner) && tmp->has_id(id)) {
|
||||
_policies.remove(tmp);
|
||||
destroy(&tmp->md_alloc(), tmp);
|
||||
}
|
||||
|
@ -115,16 +115,16 @@ class Genode::Trace::Source
|
||||
return true;
|
||||
}
|
||||
|
||||
bool is_owned_by(Source_owner const *owner) { return owner == _owner; }
|
||||
bool owned_by(Source_owner const *owner) { return owner == _owner; }
|
||||
|
||||
void release_ownership(Source_owner const *owner)
|
||||
{
|
||||
if (is_owned_by(owner))
|
||||
if (owned_by(owner))
|
||||
_owner = 0;
|
||||
}
|
||||
|
||||
bool error() const { return _control.has_error(); }
|
||||
bool enabled() const { return _control.is_enabled(); }
|
||||
bool enabled() const { return _control.enabled(); }
|
||||
|
||||
|
||||
/***********************************
|
||||
|
@ -144,12 +144,12 @@ class Genode::Trace::Subject
|
||||
Locked_ptr<Source> source(_source);
|
||||
|
||||
/* source vanished */
|
||||
if (!source.is_valid())
|
||||
if (!source.valid())
|
||||
return Subject_info::DEAD;
|
||||
|
||||
if (source->enabled())
|
||||
return source->is_owned_by(this) ? Subject_info::TRACED
|
||||
: Subject_info::FOREIGN;
|
||||
return source->owned_by(this) ? Subject_info::TRACED
|
||||
: Subject_info::FOREIGN;
|
||||
if (source->error())
|
||||
return Subject_info::ERROR;
|
||||
|
||||
@ -200,7 +200,7 @@ class Genode::Trace::Subject
|
||||
/* inform trace source about the new buffer */
|
||||
Locked_ptr<Source> source(_source);
|
||||
|
||||
if (!source.is_valid())
|
||||
if (!source.valid())
|
||||
throw Source_is_dead();
|
||||
|
||||
if (!source->try_acquire(this))
|
||||
@ -214,7 +214,7 @@ class Genode::Trace::Subject
|
||||
/* inform trace source about the new buffer */
|
||||
Locked_ptr<Source> source(_source);
|
||||
|
||||
if (source.is_valid())
|
||||
if (source.valid())
|
||||
source->disable();
|
||||
}
|
||||
|
||||
@ -228,7 +228,7 @@ class Genode::Trace::Subject
|
||||
/* inform trace source about the new buffer */
|
||||
Locked_ptr<Source> source(_source);
|
||||
|
||||
if (!source.is_valid())
|
||||
if (!source.valid())
|
||||
throw Source_is_dead();
|
||||
|
||||
source->enable();
|
||||
@ -242,7 +242,7 @@ class Genode::Trace::Subject
|
||||
{
|
||||
Locked_ptr<Source> source(_source);
|
||||
|
||||
if (source.is_valid()) {
|
||||
if (source.valid()) {
|
||||
Trace::Source::Info const info = source->info();
|
||||
execution_time = info.execution_time;
|
||||
affinity = info.affinity;
|
||||
@ -261,7 +261,7 @@ class Genode::Trace::Subject
|
||||
Locked_ptr<Source> source(_source);
|
||||
|
||||
/* source vanished */
|
||||
if (!source.is_valid())
|
||||
if (!source.valid())
|
||||
return 0;
|
||||
|
||||
return _buffer.flush() + _policy.flush();
|
||||
|
@ -35,7 +35,7 @@ void Pager_entrypoint::entry()
|
||||
|
||||
Pool::apply(_pager.badge(), [&] (Pager_object *obj) {
|
||||
if (obj) {
|
||||
if (_pager.is_exception())
|
||||
if (_pager.exception())
|
||||
obj->submit_exception_signal();
|
||||
else
|
||||
/* send reply if page-fault handling succeeded */
|
||||
|
@ -157,7 +157,7 @@ Ram_dataspace_capability Ram_session_component::alloc(size_t ds_size, Cache_attr
|
||||
bool alloc_succeeded = false;
|
||||
for (size_t align_log2 = log2(ds_size); align_log2 >= 12; align_log2--) {
|
||||
if (_ram_alloc->alloc_aligned(ds_size, &ds_addr, align_log2,
|
||||
_phys_start, _phys_end).is_ok()) {
|
||||
_phys_start, _phys_end).ok()) {
|
||||
alloc_succeeded = true;
|
||||
break;
|
||||
}
|
||||
|
@ -162,8 +162,8 @@ int Rm_client::pager(Ipc_pager &pager)
|
||||
{
|
||||
using Fault_area = Region_map_component::Fault_area;
|
||||
|
||||
Region_map::State::Fault_type pf_type = pager.is_write_fault() ? Region_map::State::WRITE_FAULT
|
||||
: Region_map::State::READ_FAULT;
|
||||
Region_map::State::Fault_type pf_type = pager.write_fault() ? Region_map::State::WRITE_FAULT
|
||||
: Region_map::State::READ_FAULT;
|
||||
addr_t pf_addr = pager.fault_addr();
|
||||
addr_t pf_ip = pager.fault_ip();
|
||||
|
||||
@ -231,7 +231,7 @@ int Rm_client::pager(Ipc_pager &pager)
|
||||
}
|
||||
|
||||
Mapping mapping(dst_fault_area.base(), src_fault_area.base(),
|
||||
dsc->cacheability(), dsc->is_io_mem(),
|
||||
dsc->cacheability(), dsc->io_mem(),
|
||||
map_size_log2, dsc->writable());
|
||||
|
||||
/*
|
||||
@ -242,7 +242,7 @@ int Rm_client::pager(Ipc_pager &pager)
|
||||
* pages that are not locally mapped, the 'map_core_local' function may be
|
||||
* empty.
|
||||
*/
|
||||
if (!dsc->is_io_mem())
|
||||
if (!dsc->io_mem())
|
||||
mapping.prepare_map_operation();
|
||||
|
||||
/* answer page fault with a flex-page mapping */
|
||||
@ -359,7 +359,7 @@ Region_map_component::attach(Dataspace_capability ds_cap, size_t size,
|
||||
Range_allocator::Alloc_return alloc_return =
|
||||
_map.alloc_aligned(size, &r, align_log2);
|
||||
|
||||
if (alloc_return.is_ok())
|
||||
if (alloc_return.ok())
|
||||
break;
|
||||
else if (alloc_return.value == Range_allocator::Alloc_return::OUT_OF_METADATA) {
|
||||
_map.free(r);
|
||||
@ -499,7 +499,7 @@ void Region_map_component::detach(Local_addr local_addr)
|
||||
* base-class's function. Hence, we cannot check the return value of this
|
||||
* function to determine if the dataspace is a managed dataspace. Instead,
|
||||
* we introduced a dataspace member '_managed' with the non-virtual accessor
|
||||
* function 'is_managed'.
|
||||
* function 'managed'.
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -521,7 +521,7 @@ void Region_map_component::detach(Local_addr local_addr)
|
||||
* client.
|
||||
*/
|
||||
if (!platform()->supports_direct_unmap()
|
||||
&& dsc->is_managed() && dsc->core_local_addr() == 0) {
|
||||
&& dsc->managed() && dsc->core_local_addr() == 0) {
|
||||
PWRN("unmapping of managed dataspaces not yet supported");
|
||||
break;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ using namespace Genode;
|
||||
|
||||
void Signal_source_component::release(Signal_context_component *context)
|
||||
{
|
||||
if (context && context->is_enqueued())
|
||||
if (context && context->enqueued())
|
||||
_signal_queue.remove(context);
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ void Signal_source_component::submit(Signal_context_component *context,
|
||||
|
||||
} else {
|
||||
|
||||
if (!context->is_enqueued())
|
||||
if (!context->enqueued())
|
||||
_signal_queue.enqueue(context);
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ class Stack_area_region_map : public Region_map
|
||||
void *phys_base;
|
||||
Range_allocator *ra = platform_specific()->ram_alloc();
|
||||
if (ra->alloc_aligned(size, &phys_base,
|
||||
get_page_size_log2()).is_error()) {
|
||||
get_page_size_log2()).error()) {
|
||||
PERR("could not allocate backing store for new stack");
|
||||
return (addr_t)0;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ class Genode::Elf_binary
|
||||
/**
|
||||
* Check for dynamic elf
|
||||
*/
|
||||
bool is_dynamically_linked() { return (_dynamic && _interp); }
|
||||
bool dynamically_linked() { return (_dynamic && _interp); }
|
||||
|
||||
|
||||
/************************
|
||||
|
@ -161,7 +161,18 @@ class Genode::Trace::Control
|
||||
|
||||
bool has_error() const { return _acknowledged_state == ERROR; }
|
||||
|
||||
bool is_enabled() const { return _acknowledged_state == ENABLED; }
|
||||
/**
|
||||
* Return true if tracing is enabled
|
||||
*/
|
||||
bool enabled() const { return _acknowledged_state == ENABLED; }
|
||||
|
||||
/**
|
||||
* Return true if tracing is enabled
|
||||
*
|
||||
* \noapi
|
||||
* \deprecated use 'enabled' instead
|
||||
*/
|
||||
bool is_enabled() const { return enabled(); }
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__BASE__INTERNAL__TRACE_CONTROL_H_ */
|
||||
|
@ -301,7 +301,7 @@ void Child::notify_resource_avail() const
|
||||
|
||||
void Child::announce(Parent::Service_name const &name, Root_capability root)
|
||||
{
|
||||
if (!name.is_valid_string()) return;
|
||||
if (!name.valid_string()) return;
|
||||
|
||||
_policy.announce_service(name.string(), root, heap(), &_server);
|
||||
}
|
||||
@ -311,7 +311,7 @@ Session_capability Child::session(Parent::Service_name const &name,
|
||||
Parent::Session_args const &args,
|
||||
Affinity const &affinity)
|
||||
{
|
||||
if (!name.is_valid_string() || !args.is_valid_string()) throw Unavailable();
|
||||
if (!name.valid_string() || !args.valid_string()) throw Unavailable();
|
||||
|
||||
/* return sessions that we created for the child */
|
||||
if (!strcmp("Env::ram_session", name.string())) return _ram;
|
||||
@ -382,7 +382,7 @@ void Child::upgrade(Session_capability to_session, Parent::Upgrade_args const &a
|
||||
return;
|
||||
}
|
||||
|
||||
if (!args.is_valid_string()) {
|
||||
if (!args.valid_string()) {
|
||||
PWRN("no valid session-upgrade arguments");
|
||||
return;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ Child::Process::Loaded_executable::Loaded_executable(Dataspace_capability elf_ds
|
||||
* If the specified executable is a dynamically linked program, we load
|
||||
* the dynamic linker instead.
|
||||
*/
|
||||
if (elf.is_dynamically_linked()) {
|
||||
if (elf.dynamically_linked()) {
|
||||
|
||||
local_rm.detach(elf_addr);
|
||||
|
||||
|
@ -108,7 +108,7 @@ Heap::Dataspace *Heap::_allocate_dataspace(size_t size, bool enforce_separate_me
|
||||
_alloc->add_range((addr_t)ds_addr, size);
|
||||
|
||||
/* allocate the Dataspace structure */
|
||||
if (_alloc->alloc_aligned(sizeof(Heap::Dataspace), &ds_meta_data_addr, log2(sizeof(addr_t))).is_error()) {
|
||||
if (_alloc->alloc_aligned(sizeof(Heap::Dataspace), &ds_meta_data_addr, log2(sizeof(addr_t))).error()) {
|
||||
PWRN("could not allocate dataspace meta data - this should never happen");
|
||||
return 0;
|
||||
}
|
||||
@ -125,7 +125,7 @@ Heap::Dataspace *Heap::_allocate_dataspace(size_t size, bool enforce_separate_me
|
||||
|
||||
bool Heap::_try_local_alloc(size_t size, void **out_addr)
|
||||
{
|
||||
if (_alloc->alloc_aligned(size, out_addr, log2(sizeof(addr_t))).is_error())
|
||||
if (_alloc->alloc_aligned(size, out_addr, log2(sizeof(addr_t))).error())
|
||||
return false;
|
||||
|
||||
_quota_used += size;
|
||||
|
@ -192,11 +192,11 @@ Trace::Logger *Thread::_logger()
|
||||
: main_trace_logger();
|
||||
|
||||
/* logger is already being initialized */
|
||||
if (logger->is_init_pending())
|
||||
if (logger->init_pending())
|
||||
return logger;
|
||||
|
||||
/* lazily initialize trace object */
|
||||
if (!logger->is_initialized()) {
|
||||
if (!logger->initialized()) {
|
||||
logger->init_pending(true);
|
||||
|
||||
Thread_capability thread_cap = myself ? myself->_thread_cap
|
||||
|
@ -87,11 +87,11 @@ class Linker::Rm_area
|
||||
{
|
||||
addr_t addr = vaddr;
|
||||
|
||||
if (addr && (_range.alloc_addr(size, addr).is_error()))
|
||||
if (addr && (_range.alloc_addr(size, addr).error()))
|
||||
throw Region_conflict();
|
||||
else if (!addr &&
|
||||
_range.alloc_aligned(size, (void **)&addr,
|
||||
get_page_size_log2()).is_error())
|
||||
get_page_size_log2()).error())
|
||||
{
|
||||
throw Region_conflict();
|
||||
}
|
||||
|
@ -35,12 +35,12 @@ void Genode::Weak_object_base::debug_info() const
|
||||
}
|
||||
|
||||
|
||||
static int weak_ptr_is_valid;
|
||||
static int weak_ptr_valid;
|
||||
|
||||
|
||||
void Genode::Weak_ptr_base::debug_info() const
|
||||
{
|
||||
weak_ptr_is_valid = (_obj != nullptr);
|
||||
weak_ptr_valid = (_obj != nullptr);
|
||||
}
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ static void assert_weak_ptr_valid(Genode::Weak_ptr_base const &ptr, bool valid)
|
||||
{
|
||||
ptr.debug_info();
|
||||
|
||||
if (weak_ptr_is_valid == valid)
|
||||
if (weak_ptr_valid == valid)
|
||||
return;
|
||||
|
||||
PERR("weak pointer unexpectedly %s", valid ? "valid" : "invalid");
|
||||
@ -76,17 +76,17 @@ static void assert_weak_ptr_valid(Genode::Weak_ptr_base const &ptr, bool valid)
|
||||
** Test for the tracking of weak pointers **
|
||||
********************************************/
|
||||
|
||||
static bool object_is_constructed;
|
||||
static bool object_constructed;
|
||||
|
||||
|
||||
struct Object : Genode::Weak_object<Object>
|
||||
{
|
||||
Object() { object_is_constructed = true; }
|
||||
Object() { object_constructed = true; }
|
||||
|
||||
~Object()
|
||||
{
|
||||
Weak_object<Object>::lock_for_destruction();
|
||||
object_is_constructed = false;
|
||||
object_constructed = false;
|
||||
}
|
||||
};
|
||||
|
||||
@ -161,11 +161,11 @@ struct Destruct_thread : Genode::Thread_deprecated<4096>
|
||||
|
||||
static void assert_constructed(bool expect_constructed)
|
||||
{
|
||||
if (object_is_constructed == expect_constructed)
|
||||
if (object_constructed == expect_constructed)
|
||||
return;
|
||||
|
||||
PERR("object unexpectedly %sconstructed",
|
||||
!object_is_constructed ? "not" : "");
|
||||
!object_constructed ? "not" : "");
|
||||
throw Fatal_error();
|
||||
}
|
||||
|
||||
@ -230,7 +230,7 @@ static void test_acquisition_failure()
|
||||
{
|
||||
Locked_ptr<Object> locked_ptr(ptr);
|
||||
|
||||
if (!locked_ptr.is_valid()) {
|
||||
if (!locked_ptr.valid()) {
|
||||
PERR("locked pointer unexpectedly invalid");
|
||||
throw Fatal_error();
|
||||
}
|
||||
@ -245,7 +245,7 @@ static void test_acquisition_failure()
|
||||
{
|
||||
Locked_ptr<Object> locked_ptr(ptr);
|
||||
|
||||
if (locked_ptr.is_valid()) {
|
||||
if (locked_ptr.valid()) {
|
||||
PERR("locked pointer unexpectedly valid");
|
||||
throw Fatal_error();
|
||||
}
|
||||
@ -262,13 +262,13 @@ struct Object_with_delayed_destruction
|
||||
{
|
||||
Timer::Connection timer;
|
||||
|
||||
Object_with_delayed_destruction() { object_is_constructed = true; }
|
||||
Object_with_delayed_destruction() { object_constructed = true; }
|
||||
|
||||
~Object_with_delayed_destruction()
|
||||
{
|
||||
Weak_object<Object_with_delayed_destruction>::lock_for_destruction();
|
||||
timer.msleep(2000);
|
||||
object_is_constructed = false;
|
||||
object_constructed = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -86,7 +86,7 @@ class Pci_driver : public Bsd::Bus_driver
|
||||
}
|
||||
|
||||
void *ptr = nullptr;
|
||||
bool err = Allocator_avl::alloc_aligned(size, &ptr, align).is_error();
|
||||
bool err = Allocator_avl::alloc_aligned(size, &ptr, align).error();
|
||||
|
||||
return err ? 0 : (addr_t)ptr;
|
||||
}
|
||||
|
@ -365,7 +365,7 @@ extern "C" void *dde_dma_alloc(dde_size_t size, dde_size_t align,
|
||||
dde_size_t offset)
|
||||
{
|
||||
void *ptr;
|
||||
if (allocator().alloc_aligned(size, &ptr, Genode::log2(align)).is_error()) {
|
||||
if (allocator().alloc_aligned(size, &ptr, Genode::log2(align)).error()) {
|
||||
PERR("memory allocation failed in alloc_memblock (size=%zu, align=%zx,"
|
||||
" offset=%zx)", (Genode::size_t)size, (Genode::size_t)align, (Genode::size_t)offset);
|
||||
return 0;
|
||||
|
@ -94,17 +94,17 @@ class Framebuffer::Session_component : public Genode::Rpc_object<Session>
|
||||
{
|
||||
_in_update = false;
|
||||
|
||||
if (_fb_ds.is_constructed())
|
||||
if (_fb_ds.constructed())
|
||||
_fb_ds.destruct();
|
||||
|
||||
_fb_ds.construct(framebuffer_dataspace());
|
||||
if (!_fb_ds.is_constructed())
|
||||
if (!_fb_ds.constructed())
|
||||
PERR("framebuffer dataspace not initialized");
|
||||
|
||||
if (_buffered) {
|
||||
_bb_ds.construct(Genode::env()->ram_session(),
|
||||
_width * _height * _bytes_per_pixel);
|
||||
if (!_bb_ds.is_constructed()) {
|
||||
if (!_bb_ds.constructed()) {
|
||||
PERR("buffered mode enabled, but buffer not initialized");
|
||||
return Genode::Dataspace_capability();
|
||||
}
|
||||
|
@ -1205,7 +1205,7 @@ void update_genode_report()
|
||||
reporter.enabled(false);
|
||||
}
|
||||
|
||||
if (!reporter.is_enabled()) return;
|
||||
if (!reporter.enabled()) return;
|
||||
|
||||
try {
|
||||
|
||||
|
@ -151,7 +151,7 @@ struct Wlan_configration
|
||||
* configuration yet to fool wpa_supplicant to keep it scanning
|
||||
* for the non exisiting network.
|
||||
*/
|
||||
if (!config_rom.is_valid()) {
|
||||
if (!config_rom.valid()) {
|
||||
_active_dummy_configuration();
|
||||
return;
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ struct Device : List<Device>::Element
|
||||
{
|
||||
list()->insert(this);
|
||||
|
||||
if (device_list_reporter().is_enabled())
|
||||
if (device_list_reporter().enabled())
|
||||
report_device_list();
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ struct Device : List<Device>::Element
|
||||
{
|
||||
list()->remove(this);
|
||||
|
||||
if (device_list_reporter().is_enabled())
|
||||
if (device_list_reporter().enabled())
|
||||
report_device_list();
|
||||
}
|
||||
|
||||
@ -756,7 +756,7 @@ class Usb::Root : public Genode::Root_component<Session_component>
|
||||
|
||||
Genode::Xml_node config = Genode::config()->xml_node();
|
||||
|
||||
if (!_config_reporter.is_enabled())
|
||||
if (!_config_reporter.enabled())
|
||||
_config_reporter.enabled(true);
|
||||
|
||||
bool const uhci = config.attribute_value<bool>("uhci", false);
|
||||
|
@ -98,7 +98,7 @@ struct Usb::Pl2303_driver : Completion
|
||||
Interface iface = device.interface(0);
|
||||
|
||||
/* error or write packet */
|
||||
if (!p.succeded || !p.is_read_transfer()) {
|
||||
if (!p.succeded || !p.read_transfer()) {
|
||||
iface.release(p);
|
||||
return;
|
||||
}
|
||||
|
@ -140,13 +140,13 @@ namespace Allocator {
|
||||
{
|
||||
void *addr;
|
||||
|
||||
if (!_range.alloc_aligned(size, &addr, align).is_error())
|
||||
if (!_range.alloc_aligned(size, &addr, align).error())
|
||||
return addr;
|
||||
|
||||
if (!_alloc_block())
|
||||
return 0;
|
||||
|
||||
if (_range.alloc_aligned(size, &addr, align).is_error()) {
|
||||
if (_range.alloc_aligned(size, &addr, align).error()) {
|
||||
PERR("Backend allocator: Unable to allocate memory (size: %zu align: %d:)",
|
||||
size, align);
|
||||
return 0;
|
||||
|
@ -222,7 +222,7 @@ class File_system::Session_component : public Session_rpc_object
|
||||
if (!_writable && create)
|
||||
throw Permission_denied();
|
||||
|
||||
if (!path.is_valid_string())
|
||||
if (!path.valid_string())
|
||||
throw Name_too_long();
|
||||
|
||||
Directory *dir = _root.subdir(path_str, create);
|
||||
|
@ -65,10 +65,10 @@ class Scout::Element
|
||||
/**
|
||||
* Accessor functionse
|
||||
*/
|
||||
Point position() const { return _position; }
|
||||
Area size() const { return _size; }
|
||||
Area min_size() const { return _min_size; }
|
||||
bool is_bottom() const { return _flags.bottom; }
|
||||
Point position() const { return _position; }
|
||||
Area size() const { return _size; }
|
||||
Area min_size() const { return _min_size; }
|
||||
bool bottom() const { return _flags.bottom; }
|
||||
|
||||
void findable(int flag) { _flags.findable = flag; }
|
||||
|
||||
|
@ -119,7 +119,7 @@ class Scout::Platform
|
||||
|
||||
void _import_events()
|
||||
{
|
||||
if (_input.is_pending() == false) return;
|
||||
if (_input.pending() == false) return;
|
||||
|
||||
for (int i = 0, num = _input.flush(); i < num; i++)
|
||||
{
|
||||
|
@ -198,7 +198,7 @@ void Parent_element::geometry(Rect rect)
|
||||
{
|
||||
::Element::geometry(rect);
|
||||
|
||||
if (!_last || !_last->is_bottom()) return;
|
||||
if (!_last || !_last->bottom()) return;
|
||||
|
||||
_last->geometry(Rect(Point(_last->position().x(),
|
||||
rect.h() - _last->size().h()), _last->size()));
|
||||
|
@ -294,7 +294,7 @@ class Log_session_component : public Genode::Rpc_object<Genode::Log_session>
|
||||
|
||||
Genode::size_t write(String const &log_text)
|
||||
{
|
||||
if (!log_text.is_valid_string()) {
|
||||
if (!log_text.valid_string()) {
|
||||
PERR("corrupted string");
|
||||
return 0;
|
||||
}
|
||||
@ -441,7 +441,7 @@ int main(int argc, char **argv)
|
||||
unsigned key_cnt = 0;
|
||||
while (1) {
|
||||
|
||||
while (!nitpicker.input()->is_pending()) {
|
||||
while (!nitpicker.input()->pending()) {
|
||||
if (log_window.draw())
|
||||
nitpicker.framebuffer()->refresh(0, 0, log_win_w, log_win_h);
|
||||
timer.msleep(20);
|
||||
|
@ -99,7 +99,7 @@ class Cpu_load_display::Timeline : public Genode::List<Timeline>::Element
|
||||
|
||||
bool idle() const { return _sum_activity == 0; }
|
||||
|
||||
bool is_kernel() const
|
||||
bool kernel() const
|
||||
{
|
||||
return _label == Label("kernel");
|
||||
}
|
||||
@ -293,7 +293,7 @@ class Cpu_load_display::Scene : public Nano3d::Scene<PT>
|
||||
{
|
||||
_trace_subjects.update();
|
||||
|
||||
if (!_trace_subjects.is_valid())
|
||||
if (!_trace_subjects.valid())
|
||||
return;
|
||||
|
||||
_cpu_registry.advance(++_now);
|
||||
@ -348,7 +348,7 @@ class Cpu_load_display::Scene : public Nano3d::Scene<PT>
|
||||
|
||||
cpu.for_each_timeline([&] (Timeline const &timeline) {
|
||||
|
||||
if (timeline.is_kernel())
|
||||
if (timeline.kernel())
|
||||
return;
|
||||
|
||||
bool first = true;
|
||||
|
@ -252,7 +252,7 @@ void Decorator::Main::handle_nitpicker_sync(unsigned)
|
||||
|
||||
bool model_updated = false;
|
||||
|
||||
if (window_layout_update_needed && window_layout.is_valid()) {
|
||||
if (window_layout_update_needed && window_layout.valid()) {
|
||||
|
||||
try {
|
||||
Xml_node xml(window_layout.local_addr<char>(),
|
||||
@ -265,7 +265,7 @@ void Decorator::Main::handle_nitpicker_sync(unsigned)
|
||||
* A decorator element might have appeared or disappeared under
|
||||
* the pointer.
|
||||
*/
|
||||
if (pointer.is_valid())
|
||||
if (pointer.valid())
|
||||
update_hover_report(Xml_node(pointer.local_addr<char>()),
|
||||
window_stack, hover, hover_reporter);
|
||||
|
||||
@ -309,7 +309,7 @@ void Decorator::Main::handle_pointer_update(unsigned)
|
||||
{
|
||||
pointer.update();
|
||||
|
||||
if (pointer.is_valid())
|
||||
if (pointer.valid())
|
||||
update_hover_report(Xml_node(pointer.local_addr<char>()),
|
||||
window_stack, hover, hover_reporter);
|
||||
}
|
||||
|
@ -434,7 +434,7 @@ class Decorator::Window : public Window_base
|
||||
outer_geometry().cut(geometry(), top, left, right, bottom);
|
||||
}
|
||||
|
||||
bool is_in_front_of(Window_base const &neighbor) const override
|
||||
bool in_front_of(Window_base const &neighbor) const override
|
||||
{
|
||||
return _neighbor == neighbor.frontmost_view();
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ struct Floating_window_layouter::Main : Operations
|
||||
if (!window)
|
||||
return;
|
||||
|
||||
window->is_maximized(!window->is_maximized());
|
||||
window->maximized(!window->maximized());
|
||||
|
||||
generate_resize_request_model();
|
||||
}
|
||||
@ -250,7 +250,7 @@ struct Floating_window_layouter::Main : Operations
|
||||
*/
|
||||
void handle_input(unsigned)
|
||||
{
|
||||
while (input.is_pending())
|
||||
while (input.pending())
|
||||
_user_state.handle_input(input_ds.local_addr<Input::Event>(),
|
||||
input.flush(), Genode::config()->xml_node());
|
||||
}
|
||||
@ -297,10 +297,10 @@ struct Floating_window_layouter::Main : Operations
|
||||
Reporter focus_reporter = { "focus" };
|
||||
|
||||
|
||||
bool focused_window_is_maximized() const
|
||||
bool focused_window_maximized() const
|
||||
{
|
||||
Window const *w = lookup_window_by_id(_user_state.focused_window_id());
|
||||
return w && w->is_maximized();
|
||||
return w && w->maximized();
|
||||
}
|
||||
|
||||
void import_window_list(Xml_node);
|
||||
@ -376,7 +376,7 @@ void Floating_window_layouter::Main::import_window_list(Xml_node window_list_xml
|
||||
if (policy.has_attribute("xpos") && policy.has_attribute("ypos"))
|
||||
initial_position = point_attribute(node);
|
||||
|
||||
win->is_maximized(policy.attribute_value("maximized", false));
|
||||
win->maximized(policy.attribute_value("maximized", false));
|
||||
|
||||
} catch (Genode::Session_policy::No_policy_defined) { }
|
||||
|
||||
@ -387,10 +387,10 @@ void Floating_window_layouter::Main::import_window_list(Xml_node window_list_xml
|
||||
win->title(string_attribute(node, "title", Window::Title("")));
|
||||
win->has_alpha(node.has_attribute("has_alpha")
|
||||
&& node.attribute("has_alpha").has_value("yes"));
|
||||
win->is_hidden(node.has_attribute("hidden")
|
||||
&& node.attribute("hidden").has_value("yes"));
|
||||
win->is_resizeable(node.has_attribute("resizeable")
|
||||
&& node.attribute("resizeable").has_value("yes"));
|
||||
win->hidden(node.has_attribute("hidden")
|
||||
&& node.attribute("hidden").has_value("yes"));
|
||||
win->resizeable(node.has_attribute("resizeable")
|
||||
&& node.attribute("resizeable").has_value("yes"));
|
||||
}
|
||||
} catch (...) { }
|
||||
}
|
||||
@ -402,13 +402,13 @@ void Floating_window_layouter::Main::generate_window_layout_model()
|
||||
{
|
||||
for (Window *w = windows.first(); w; w = w->next()) {
|
||||
|
||||
bool const is_hovered = w->has_id(_user_state.hover_state().window_id);
|
||||
bool const is_focused = w->has_id(_user_state.focused_window_id());
|
||||
bool const hovered = w->has_id(_user_state.hover_state().window_id);
|
||||
bool const focused = w->has_id(_user_state.focused_window_id());
|
||||
|
||||
Window::Element const highlight =
|
||||
is_hovered ? _user_state.hover_state().element : Window::Element::UNDEFINED;
|
||||
hovered ? _user_state.hover_state().element : Window::Element::UNDEFINED;
|
||||
|
||||
w->serialize(xml, is_focused, highlight);
|
||||
w->serialize(xml, focused, highlight);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ class Floating_window_layouter::User_state
|
||||
|
||||
Focus_history &_focus_history;
|
||||
|
||||
bool _is_key(Input::Event const &ev) const
|
||||
bool _key(Input::Event const &ev) const
|
||||
{
|
||||
if (ev.type() != Input::Event::PRESS
|
||||
&& ev.type() != Input::Event::RELEASE)
|
||||
@ -286,7 +286,7 @@ void Floating_window_layouter::User_state::_handle_event(Input::Event const &e,
|
||||
}
|
||||
|
||||
/* handle key sequences */
|
||||
if (_is_key(e)) {
|
||||
if (_key(e)) {
|
||||
|
||||
if (e.type() == Input::Event::PRESS && _key_cnt == 1)
|
||||
_key_sequence_tracker.reset();
|
||||
|
@ -97,13 +97,13 @@ class Floating_window_layouter::Window : public List<Window>::Element
|
||||
/**
|
||||
* Window is temporarily not visible
|
||||
*/
|
||||
bool _is_hidden = false;
|
||||
bool _hidden = false;
|
||||
|
||||
bool _is_resizeable = false;
|
||||
bool _resizeable = false;
|
||||
|
||||
bool _is_maximized = false;
|
||||
bool _maximized = false;
|
||||
|
||||
bool _is_dragged = false;
|
||||
bool _dragged = false;
|
||||
|
||||
/*
|
||||
* Number of times the window has been topped. This value is used by
|
||||
@ -146,7 +146,7 @@ class Floating_window_layouter::Window : public List<Window>::Element
|
||||
|
||||
_requested_size = _geometry.area();
|
||||
|
||||
_is_dragged = true;
|
||||
_dragged = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -204,9 +204,9 @@ class Floating_window_layouter::Window : public List<Window>::Element
|
||||
|
||||
void has_alpha(bool has_alpha) { _has_alpha = has_alpha; }
|
||||
|
||||
void is_hidden(bool is_hidden) { _is_hidden = is_hidden; }
|
||||
void hidden(bool hidden) { _hidden = hidden; }
|
||||
|
||||
void is_resizeable(bool is_resizeable) { _is_resizeable = is_resizeable; }
|
||||
void resizeable(bool resizeable) { _resizeable = resizeable; }
|
||||
|
||||
bool label_matches(Label const &label) const { return label == _label; }
|
||||
|
||||
@ -217,7 +217,7 @@ class Floating_window_layouter::Window : public List<Window>::Element
|
||||
*/
|
||||
void size(Area size)
|
||||
{
|
||||
if (_is_maximized) {
|
||||
if (_maximized) {
|
||||
_geometry = Rect(_maximized_geometry.p1(), size);
|
||||
return;
|
||||
}
|
||||
@ -251,7 +251,7 @@ class Floating_window_layouter::Window : public List<Window>::Element
|
||||
void serialize(Xml_generator &xml, bool focused, Element highlight)
|
||||
{
|
||||
/* omit window from the layout if hidden */
|
||||
if (_is_hidden)
|
||||
if (_hidden)
|
||||
return;
|
||||
|
||||
xml.node("window", [&]() {
|
||||
@ -289,7 +289,7 @@ class Floating_window_layouter::Window : public List<Window>::Element
|
||||
if (_has_alpha)
|
||||
xml.attribute("has_alpha", "yes");
|
||||
|
||||
if (_is_resizeable) {
|
||||
if (_resizeable) {
|
||||
xml.attribute("maximizer", "yes");
|
||||
xml.attribute("closer", "yes");
|
||||
}
|
||||
@ -299,10 +299,10 @@ class Floating_window_layouter::Window : public List<Window>::Element
|
||||
void drag(Window::Element element, Point clicked, Point curr)
|
||||
{
|
||||
/* prevent maximized windows from being dragged */
|
||||
if (is_maximized())
|
||||
if (maximized())
|
||||
return;
|
||||
|
||||
if (!_is_dragged)
|
||||
if (!_dragged)
|
||||
_initiate_drag_operation(element);
|
||||
|
||||
_apply_drag_operation(curr - clicked);
|
||||
@ -311,7 +311,7 @@ class Floating_window_layouter::Window : public List<Window>::Element
|
||||
void finalize_drag_operation()
|
||||
{
|
||||
_requested_size = _geometry.area();
|
||||
_is_dragged = false;
|
||||
_dragged = false;
|
||||
_drag_left_border = false;
|
||||
_drag_right_border = false;
|
||||
_drag_top_border = false;
|
||||
@ -322,23 +322,23 @@ class Floating_window_layouter::Window : public List<Window>::Element
|
||||
|
||||
void close() { _requested_size = Area(0, 0); }
|
||||
|
||||
bool is_maximized() const { return _is_maximized; }
|
||||
bool maximized() const { return _maximized; }
|
||||
|
||||
void is_maximized(bool is_maximized)
|
||||
void maximized(bool maximized)
|
||||
{
|
||||
/* enter maximized state */
|
||||
if (!_is_maximized && is_maximized) {
|
||||
if (!_maximized && maximized) {
|
||||
_unmaximized_geometry = _geometry;
|
||||
_requested_size = _maximized_geometry.area();
|
||||
}
|
||||
|
||||
/* leave maximized state */
|
||||
if (_is_maximized && !is_maximized) {
|
||||
if (_maximized && !maximized) {
|
||||
_requested_size = _unmaximized_geometry.area();
|
||||
_geometry = Rect(_unmaximized_geometry.p1(), _geometry.area());
|
||||
}
|
||||
|
||||
_is_maximized = is_maximized;
|
||||
_maximized = maximized;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -96,7 +96,7 @@ struct Launcher::Dialog_nitpicker_session : Wrapped_nitpicker_session
|
||||
Input::Event const * const events =
|
||||
_nitpicker_input_ds.local_addr<Input::Event>();
|
||||
|
||||
while (_nitpicker_input.is_pending()) {
|
||||
while (_nitpicker_input.pending()) {
|
||||
|
||||
size_t const num_events = _nitpicker_input.flush();
|
||||
for (size_t i = 0; i < num_events; i++) {
|
||||
|
@ -103,8 +103,8 @@ class Launcher::Fading_dialog : private Input_event_handler
|
||||
void _handle_hover_update(unsigned)
|
||||
{
|
||||
try {
|
||||
if (!_hover_ds.is_constructed() || _hover_rom.update() == false) {
|
||||
if (_hover_ds.is_constructed())
|
||||
if (!_hover_ds.constructed() || _hover_rom.update() == false) {
|
||||
if (_hover_ds.constructed())
|
||||
_hover_ds->invalidate();
|
||||
_hover_ds.construct(_hover_rom.dataspace());
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ class Launcher::Panel_dialog : Input_event_handler, Dialog_generator,
|
||||
|
||||
Element _menu_button { _menu_button_label(), "Menu" };
|
||||
|
||||
bool _is_focused(Element const &e)
|
||||
bool _focused(Element const &e)
|
||||
{
|
||||
size_t const label_len = strlen(e.label.string());
|
||||
|
||||
@ -93,7 +93,7 @@ class Launcher::Panel_dialog : Input_event_handler, Dialog_generator,
|
||||
|| (e.hovered && e.touched))
|
||||
xml.attribute("hovered", "yes");
|
||||
|
||||
if (e.selected || e.touched || _is_focused(e))
|
||||
if (e.selected || e.touched || _focused(e))
|
||||
xml.attribute("selected", "yes");
|
||||
|
||||
xml.node("label", [&] () {
|
||||
@ -536,7 +536,7 @@ class Launcher::Panel_dialog : Input_event_handler, Dialog_generator,
|
||||
/* find focused element */
|
||||
Element *e = _elements.first();
|
||||
|
||||
for (; e && !_is_focused(*e); e = e->next());
|
||||
for (; e && !_focused(*e); e = e->next());
|
||||
|
||||
/* none of our subsystems is focused, start with the first one */
|
||||
if (!e)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user