Follow practices suggested by "Effective C++"

The patch adjust the code of the base, base-<kernel>, and os repository.
To adapt existing components to fix violations of the best practices
suggested by "Effective C++" as reported by the -Weffc++ compiler
argument. The changes follow the patterns outlined below:

* A class with virtual functions can no longer publicly inherit base
  classed without a vtable. The inherited object may either be moved
  to a member variable, or inherited privately. The latter would be
  used for classes that inherit 'List::Element' or 'Avl_node'. In order
  to enable the 'List' and 'Avl_tree' to access the meta data, the
  'List' must become a friend.

* Instead of adding a virtual destructor to abstract base classes,
  we inherit the new 'Interface' class, which contains a virtual
  destructor. This way, single-line abstract base classes can stay
  as compact as they are now. The 'Interface' utility resides in
  base/include/util/interface.h.

* With the new warnings enabled, all member variables must be explicitly
  initialized. Basic types may be initialized with '='. All other types
  are initialized with braces '{ ... }' or as class initializers. If
  basic types and non-basic types appear in a row, it is nice to only
  use the brace syntax (also for basic types) and align the braces.

* If a class contains pointers as members, it must now also provide a
  copy constructor and assignment operator. In the most cases, one
  would make them private, effectively disallowing the objects to be
  copied. Unfortunately, this warning cannot be fixed be inheriting
  our existing 'Noncopyable' class (the compiler fails to detect that
  the inheriting class cannot be copied and still gives the error).
  For now, we have to manually add declarations for both the copy
  constructor and assignment operator as private class members. Those
  declarations should be prepended with a comment like this:

        /*
         * Noncopyable
         */
        Thread(Thread const &);
        Thread &operator = (Thread const &);

  In the future, we should revisit these places and try to replace
  the pointers with references. In the presence of at least one
  reference member, the compiler would no longer implicitly generate
  a copy constructor. So we could remove the manual declaration.

Issue #465
This commit is contained in:
Norman Feske 2017-12-21 15:42:15 +01:00 committed by Christian Helmuth
parent 2a33d9aa76
commit eba9c15746
763 changed files with 4936 additions and 3288 deletions

View File

@ -47,8 +47,8 @@ namespace Genode {
* Constructor
*/
Mapping(addr_t dst_addr, addr_t src_addr,
Cache_attribute cacheability, bool io_mem,
unsigned l2size, bool rw, bool executable)
Cache_attribute cacheability, bool,
unsigned l2size, bool rw, bool)
:
_dst_addr(dst_addr),
_fpage(Fiasco::l4_fpage(src_addr, l2size, rw, false))
@ -93,10 +93,10 @@ namespace Genode {
{
private:
Fiasco::l4_threadid_t _last; /* origin of last fault message */
addr_t _pf_addr; /* page-fault address */
addr_t _pf_ip; /* instruction pointer of faulter */
Mapping _reply_mapping; /* page-fault answer */
Fiasco::l4_threadid_t _last { }; /* origin of last fault message */
addr_t _pf_addr { 0 }; /* page-fault address */
addr_t _pf_ip { 0 }; /* instruction pointer of faulter */
Mapping _reply_mapping { }; /* page-fault answer */
public:

View File

@ -78,7 +78,7 @@ namespace Genode {
* \param virt core-local address
* \param num_pages number of pages to unmap
*/
inline void unmap_local(addr_t virt, size_t num_pages)
inline void unmap_local(addr_t, size_t)
{
error("unmap_local() called - not implemented yet");
}

View File

@ -31,23 +31,29 @@ namespace Genode {
{
private:
/*
* Noncopyable
*/
Platform(Platform const &);
Platform &operator = (Platform const &);
/*
* Shortcut for the type of allocator instances for physical resources
*/
typedef Synced_range_allocator<Allocator_avl> Phys_allocator;
char _core_label[1]; /* to satisfy _core_pd */
Platform_pd *_core_pd; /* core protection domain object */
Phys_allocator _ram_alloc; /* RAM allocator */
Phys_allocator _io_mem_alloc; /* MMIO allocator */
Phys_allocator _io_port_alloc; /* I/O port allocator */
Phys_allocator _irq_alloc; /* IRQ allocator */
Phys_allocator _region_alloc; /* virtual memory allocator for core */
Rom_fs _rom_fs; /* ROM file system */
Rom_module _kip_rom; /* ROM module for Fiasco KIP */
char _core_label[1]; /* to satisfy _core_pd */
Platform_pd *_core_pd = nullptr; /* core protection domain object */
Phys_allocator _ram_alloc; /* RAM allocator */
Phys_allocator _io_mem_alloc; /* MMIO allocator */
Phys_allocator _io_port_alloc; /* I/O port allocator */
Phys_allocator _irq_alloc; /* IRQ allocator */
Phys_allocator _region_alloc; /* virtual memory allocator for core */
Rom_fs _rom_fs { }; /* ROM file system */
Rom_module _kip_rom; /* ROM module for Fiasco KIP */
addr_t _vm_start; /* begin of virtual memory */
size_t _vm_size; /* size of virtual memory */
addr_t _vm_start = 0; /* begin of virtual memory */
size_t _vm_size = 0; /* size of virtual memory */
/*
* We do not export any boot module loaded before FIRST_ROM.
@ -101,7 +107,7 @@ namespace Genode {
*/
Sigma0();
int pager(Ipc_pager &ps) { /* never called */ return -1; }
int pager(Ipc_pager &) { /* never called */ return -1; }
};
/**
@ -119,7 +125,7 @@ namespace Genode {
*/
Core_pager(Platform_pd *core_pd);
int pager(Ipc_pager &ps) { /* never called */ return -1; }
int pager(Ipc_pager &) { /* never called */ return -1; }
};
/**

View File

@ -32,6 +32,12 @@ namespace Genode {
{
private:
/*
* Noncopyable
*/
Platform_pd(Platform_pd const &);
Platform_pd &operator = (Platform_pd const &);
enum {
VERSION_BITS = 10,
PD_FIRST = 0x10,
@ -41,10 +47,10 @@ namespace Genode {
THREAD_MAX = (1 << 7),
};
unsigned _pd_id; /* plain pd number */
unsigned _version; /* version number */
unsigned _pd_id = 0;
unsigned _version = 0;
Fiasco::l4_taskid_t _l4_task_id; /* L4 task ID */
Fiasco::l4_taskid_t _l4_task_id { }; /* L4 task ID */
/**********************************************
@ -154,7 +160,7 @@ namespace Genode {
/**
* Register quota donation at allocator guard
*/
void upgrade_ram_quota(size_t ram_quota) { }
void upgrade_ram_quota(size_t) { }
/**
* Initialize L4 task facility
@ -178,7 +184,7 @@ namespace Genode {
/**
* Assign parent interface to protection domain
*/
void assign_parent(Native_capability parent) { }
void assign_parent(Native_capability) { }
int pd_id() const { return _pd_id; }

View File

@ -30,18 +30,24 @@ namespace Fiasco {
namespace Genode {
class Platform_pd;
class Platform_thread
class Platform_thread : Interface
{
private:
/*
* Noncopyable
*/
Platform_thread(Platform_thread const &);
Platform_thread &operator = (Platform_thread const &);
int _thread_id; /* plain thread number */
Fiasco::l4_threadid_t _l4_thread_id; /* L4 thread ID */
char _name[32]; /* thread name that will be
registered at the kernel
debugger */
Platform_pd *_platform_pd; /* protection domain thread
Platform_pd *_platform_pd = nullptr; /* protection domain thread
is bound to */
Pager_object *_pager;
Pager_object *_pager;
public:
@ -152,7 +158,7 @@ namespace Genode {
/**
* Set CPU quota of the thread to 'quota'
*/
void quota(size_t const quota) { /* not supported*/ }
void quota(size_t) { /* not supported*/ }
/**
* Return execution time consumed by the thread

View File

@ -29,7 +29,7 @@ class Genode::Rpc_cap_factory
public:
Rpc_cap_factory(Allocator &md_alloc) { }
Rpc_cap_factory(Allocator &) { }
Native_capability alloc(Native_capability ep);

View File

@ -97,7 +97,7 @@ namespace Genode {
constexpr size_t get_super_page_size() { return L4_SUPERPAGESIZE; }
constexpr size_t get_super_page_size_log2() { return L4_LOG2_SUPERPAGESIZE; }
inline addr_t map_src_addr(addr_t core_local_addr, addr_t phys_addr) {
inline addr_t map_src_addr(addr_t core_local_addr, addr_t) {
return core_local_addr; }
inline size_t constrain_map_size_log2(size_t size_log2) { return size_log2; }

View File

@ -25,7 +25,7 @@ namespace Fiasco {
using namespace Genode;
void Io_mem_session_component::_unmap_local(addr_t base, size_t size)
void Io_mem_session_component::_unmap_local(addr_t base, size_t)
{
platform()->region_alloc()->free(reinterpret_cast<void *>(base));
}

View File

@ -162,5 +162,5 @@ void Irq_session_component::sigh(Genode::Signal_context_capability cap)
Genode::Irq_session::Info Irq_session_component::info()
{
/* no MSI support */
return { .type = Genode::Irq_session::Info::Type::INVALID };
return { .type = Info::Type::INVALID, .address = 0, .value = 0 };
}

View File

@ -33,10 +33,10 @@ void Pager_object::wake_up()
/* kernel-defined message header */
struct {
l4_fpage_t rcv_fpage; /* unused */
l4_fpage_t rcv_fpage { }; /* unused */
l4_msgdope_t size_dope = L4_IPC_DOPE(0, 0);
l4_msgdope_t send_dope = L4_IPC_DOPE(0, 0);
} rcv_header;
} rcv_header { };
l4_msgdope_t ipc_result;
l4_umword_t dummy = 0;

View File

@ -246,8 +246,7 @@ void Platform_pd::flush(addr_t, size_t size, Core_local_addr core_local_base)
L4_FP_FLUSH_PAGE);
}
Platform_pd::Platform_pd(Allocator * md_alloc, char const *,
signed pd_id, bool create)
Platform_pd::Platform_pd(Allocator *, char const *, signed pd_id, bool create)
{
/* check correct init */
if (!_init)

View File

@ -109,7 +109,7 @@ void Platform_thread::unbind()
}
void Platform_thread::state(Thread_state s)
void Platform_thread::state(Thread_state)
{
warning(__func__, " not implemented");
throw Cpu_thread::State_access_failed();

View File

@ -18,8 +18,8 @@
using namespace Genode;
void Ram_dataspace_factory::_export_ram_ds(Dataspace_component *ds) { }
void Ram_dataspace_factory::_revoke_ram_ds(Dataspace_component *ds) { }
void Ram_dataspace_factory::_export_ram_ds(Dataspace_component *) { }
void Ram_dataspace_factory::_revoke_ram_ds(Dataspace_component *) { }
void Ram_dataspace_factory::_clear_ds(Dataspace_component *ds)
{

View File

@ -20,49 +20,55 @@ namespace Fiasco {
#include <l4/sys/utcb.h>
#include <l4/sys/task.h>
enum Cap_selectors {
/*********************************************
** Capability selectors controlled by core **
*********************************************/
/*********************************************
** Capability selectors controlled by core **
*********************************************/
/* use the same task cap selector like L4Re for compatibility in L4Linux */
static constexpr l4_cap_idx_t TASK_CAP = L4_BASE_TASK_CAP;
TASK_CAP = L4_BASE_TASK_CAP, /* use the same task cap selector
like L4Re for compatibility in
L4Linux */
DEBUG_CAP = L4_BASE_DEBUGGER_CAP,
static constexpr l4_cap_idx_t DEBUG_CAP = L4_BASE_DEBUGGER_CAP;
/*
* To not clash with other L4Re cap selector constants (e.g.: L4Linux)
* leave the following selectors (2-8) empty
*/
/*
* To not clash with other L4Re cap selector constants (e.g.: L4Linux)
* leave the following selectors (2-8) empty
*/
PARENT_CAP = 0xbUL << L4_CAP_SHIFT, /* cap to parent session */
/* cap to parent session */
static constexpr l4_cap_idx_t PARENT_CAP = 0xbUL << L4_CAP_SHIFT;
/*
* Each thread has a designated slot in the core controlled cap
* selector area, where its ipc gate capability (for server threads),
* its irq capability (for locks), and the capability to its pager
* gate are stored
*/
THREAD_AREA_BASE = 0xcUL << L4_CAP_SHIFT, /* offset to thread area */
THREAD_AREA_SLOT = 0x3UL << L4_CAP_SHIFT, /* size of one thread slot */
THREAD_GATE_CAP = 0, /* offset to the ipc gate
cap selector in the slot */
THREAD_PAGER_CAP = 0x1UL << L4_CAP_SHIFT, /* offset to the pager
cap selector in the slot */
THREAD_IRQ_CAP = 0x2UL << L4_CAP_SHIFT, /* offset to the irq cap
selector in the slot */
MAIN_THREAD_CAP = THREAD_AREA_BASE + THREAD_GATE_CAP, /* shortcut to the
main thread's
gate cap */
/*
* Each thread has a designated slot in the core controlled cap
* selector area, where its ipc gate capability (for server threads),
* its irq capability (for locks), and the capability to its pager
* gate are stored
*/
/* offset to thread area */
static constexpr l4_cap_idx_t THREAD_AREA_BASE = 0xcUL << L4_CAP_SHIFT;
/* size of one thread slot */
static constexpr l4_cap_idx_t THREAD_AREA_SLOT = 0x3UL << L4_CAP_SHIFT;
/* offset to the ipc gate cap selector in the slot */
static constexpr l4_cap_idx_t THREAD_GATE_CAP = 0;
/* offset to the pager cap selector in the slot */
static constexpr l4_cap_idx_t THREAD_PAGER_CAP = 0x1UL << L4_CAP_SHIFT;
/* offset to the irq cap selector in the slot */
static constexpr l4_cap_idx_t THREAD_IRQ_CAP = 0x2UL << L4_CAP_SHIFT;
/* shortcut to the main thread's gate cap */
static constexpr l4_cap_idx_t MAIN_THREAD_CAP = THREAD_AREA_BASE
+ THREAD_GATE_CAP;
/*********************************************************
** Capability seclectors controlled by the task itself **
*********************************************************/
/*********************************************************
** Capability seclectors controlled by the task itself **
*********************************************************/
USER_BASE_CAP = 0x200UL << L4_CAP_SHIFT,
};
static constexpr l4_cap_idx_t USER_BASE_CAP = 0x200UL << L4_CAP_SHIFT;
struct Capability
{

View File

@ -34,7 +34,7 @@ struct Genode::Native_thread
Fiasco::l4_cap_idx_t kcap = 0;
/* receive window for capability selectors received at the server side */
Receive_window rcv_window;
Receive_window rcv_window { };
Native_thread() { }
explicit Native_thread(Fiasco::l4_cap_idx_t kcap) : kcap(kcap) { }

View File

@ -38,6 +38,21 @@ class Genode::Receive_window
~Receive_window();
/*
* Needed for 'Ipc_pager::set_reply_dst'
*/
Receive_window &operator = (Receive_window const &other)
{
_rcv_idx_base = other._rcv_idx_base;
return *this;
}
/**
* Copy constructor
*/
Receive_window(Receive_window const &other)
: _rcv_idx_base(other._rcv_idx_base) { }
void init();
/**

View File

@ -36,7 +36,7 @@ struct Genode::Foc_thread_state : Thread_state
unsigned exceptions; /* counts exceptions raised by the thread */
bool paused; /* indicates whether thread is stopped */
bool in_exception; /* true if thread is in exception */
Lock lock;
Lock lock { };
/**
* Constructor

View File

@ -34,7 +34,8 @@ namespace Genode {
};
Synced_range_allocator<Allocator_avl> _id_alloc;
Lock _lock;
Lock _lock { };
public:

View File

@ -34,6 +34,12 @@ class Genode::Core_cap_index : public Native_capability::Data
Platform_thread const *_pt;
Native_thread _gate;
/*
* Noncopyable
*/
Core_cap_index(Core_cap_index const &);
Core_cap_index &operator = (Core_cap_index const &);
public:
Core_cap_index(Pd_session_component *session = 0,

View File

@ -29,6 +29,12 @@ class Genode::Cpu_session_irqs : public Avl_node<Cpu_session_irqs>
{
private:
/*
* Noncopyable
*/
Cpu_session_irqs(Cpu_session_irqs const &);
Cpu_session_irqs &operator = (Cpu_session_irqs const &);
enum { IRQ_MAX = 20 };
Cpu_session_component* _owner;

View File

@ -43,7 +43,7 @@ class Genode::Mapping
private:
addr_t _dst_addr;
Fiasco::l4_fpage_t _fpage;
Fiasco::l4_fpage_t _fpage { };
Cache_attribute _cacheability;
bool _iomem;
@ -96,14 +96,14 @@ class Genode::Ipc_pager : public Native_capability
private:
Native_thread _last; /* origin of last fault */
addr_t _pf_addr; /* page-fault address */
addr_t _pf_ip; /* ip of faulter */
Mapping _reply_mapping; /* page-fault answer */
unsigned long _badge; /* badge of faulting thread */
Fiasco::l4_msgtag_t _tag; /* receive message tag */
Fiasco::l4_exc_regs_t _regs; /* exception registers */
Msg_type _type;
Native_thread _last { }; /* origin of last fault */
addr_t _pf_addr { 0 }; /* page-fault address */
addr_t _pf_ip { 0 }; /* ip of faulter */
Mapping _reply_mapping { }; /* page-fault answer */
unsigned long _badge; /* badge of faulting thread */
Fiasco::l4_msgtag_t _tag { }; /* receive message tag */
Fiasco::l4_exc_regs_t _regs { }; /* exception registers */
Msg_type _type { PAGEFAULT };
void _parse_msg_type(void);
void _parse_exception(void);

View File

@ -27,6 +27,12 @@ class Genode::Irq_object
{
private:
/*
* Noncopyable
*/
Irq_object(Irq_object const &);
Irq_object &operator = (Irq_object const &);
Cap_index *_cap;
Irq_session::Trigger _trigger; /* interrupt trigger */
Irq_session::Polarity _polarity; /* interrupt polarity */
@ -35,7 +41,7 @@ class Genode::Irq_object
Genode::addr_t _msi_addr;
Genode::addr_t _msi_data;
Signal_context_capability _sig_cap;
Signal_context_capability _sig_cap { };
Fiasco::l4_cap_idx_t _capability() const { return _cap->kcap(); }

View File

@ -34,6 +34,12 @@ namespace Genode {
{
private:
/*
* Noncopyable
*/
Platform(Platform const &);
Platform &operator = (Platform const &);
/**
* Pager object representing the pager of core namely sigma0
*/
@ -44,7 +50,7 @@ namespace Genode {
*/
Sigma0(Cap_index*);
int pager(Ipc_pager &ps) { /* never called */ return -1; }
int pager(Ipc_pager &) { /* never called */ return -1; }
};
/*
@ -52,19 +58,19 @@ namespace Genode {
*/
typedef Synced_range_allocator<Allocator_avl> Phys_allocator;
Platform_pd *_core_pd; /* core protection domain object */
Phys_allocator _ram_alloc; /* RAM allocator */
Phys_allocator _io_mem_alloc; /* MMIO allocator */
Phys_allocator _io_port_alloc; /* I/O port allocator */
Phys_allocator _irq_alloc; /* IRQ allocator */
Phys_allocator _region_alloc; /* virtual memory allocator for core */
Cap_id_allocator _cap_id_alloc; /* capability id allocator */
Rom_fs _rom_fs; /* ROM file system */
Rom_module _kip_rom; /* ROM module for Fiasco KIP */
Platform_pd *_core_pd = nullptr; /* core protection domain object */
Phys_allocator _ram_alloc; /* RAM allocator */
Phys_allocator _io_mem_alloc; /* MMIO allocator */
Phys_allocator _io_port_alloc; /* I/O port allocator */
Phys_allocator _irq_alloc; /* IRQ allocator */
Phys_allocator _region_alloc; /* virtual memory allocator for core */
Cap_id_allocator _cap_id_alloc; /* capability id allocator */
Rom_fs _rom_fs { }; /* ROM file system */
Rom_module _kip_rom; /* ROM module for Fiasco KIP */
Sigma0 _sigma0;
addr_t _vm_start; /* begin of virtual memory */
size_t _vm_size; /* size of virtual memory */
addr_t _vm_start = 0; /* begin of virtual memory */
size_t _vm_size = 0; /* size of virtual memory */
/*
@ -119,7 +125,7 @@ namespace Genode {
*/
Core_pager(Platform_pd *core_pd, Sigma0*);
int pager(Ipc_pager &ps) { /* never called */ return -1; }
int pager(Ipc_pager &) { /* never called */ return -1; }
};
/**

View File

@ -44,6 +44,12 @@ namespace Genode {
{
private:
/*
* Noncopyable
*/
Platform_pd(Platform_pd const &);
Platform_pd &operator = (Platform_pd const &);
enum {
THREAD_MAX = (1 << 7),
UTCB_AREA_SIZE = (THREAD_MAX * Fiasco::L4_UTCB_OFFSET),
@ -56,8 +62,8 @@ namespace Genode {
}
Cap_mapping _task;
Cap_mapping _parent;
Cap_mapping _debug;
Cap_mapping _parent { };
Cap_mapping _debug { };
Platform_thread *_threads[THREAD_MAX];
public:

View File

@ -27,10 +27,16 @@
namespace Genode {
class Platform_pd;
class Platform_thread
class Platform_thread : Interface
{
private:
/*
* Noncopyable
*/
Platform_thread(Platform_thread const &);
Platform_thread &operator = (Platform_thread const &);
enum State { DEAD, RUNNING };
friend class Platform_pd;
@ -38,8 +44,8 @@ namespace Genode {
State _state;
bool _core_thread;
Cap_mapping _thread;
Cap_mapping _gate;
Cap_mapping _pager;
Cap_mapping _gate { };
Cap_mapping _pager { };
Cap_mapping _irq;
addr_t _utcb;
char _name[32]; /* thread name that will be
@ -50,7 +56,7 @@ namespace Genode {
Pager_object *_pager_obj;
unsigned _prio;
Affinity::Location _location;
Affinity::Location _location { };
void _create_thread(void);
void _finalize_construction(const char *name);
@ -168,7 +174,7 @@ namespace Genode {
/**
* Set CPU quota of the thread to 'quota'
*/
void quota(size_t const quota) { /* not supported*/ }
void quota(size_t const) { /* not supported*/ }
/**
* Return execution time consumed by the thread

View File

@ -35,7 +35,7 @@ class Genode::Rpc_cap_factory
Entry(Native_capability cap) : Object_pool<Entry>::Entry(cap) {}
};
Object_pool<Entry> _pool;
Object_pool<Entry> _pool { };
/*
* Dimension '_entry_slab' such that slab blocks (including the

View File

@ -71,7 +71,7 @@ namespace Genode {
constexpr size_t get_super_page_size() { return L4_SUPERPAGESIZE; }
constexpr size_t get_super_page_size_log2() { return L4_LOG2_SUPERPAGESIZE; }
inline addr_t map_src_addr(addr_t core_local_addr, addr_t phys_addr) {
inline addr_t map_src_addr(addr_t core_local_addr, addr_t) {
return core_local_addr; }
inline size_t constrain_map_size_log2(size_t size_log2) { return size_log2; }

View File

@ -21,7 +21,7 @@
using namespace Genode;
void Io_mem_session_component::_unmap_local(addr_t base, size_t size)
void Io_mem_session_component::_unmap_local(addr_t base, size_t)
{
platform()->region_alloc()->free(reinterpret_cast<void *>(base));
}

View File

@ -124,7 +124,8 @@ void Ipc_pager::reply_and_wait_for_fault()
void Ipc_pager::acknowledge_wakeup()
{
l4_cap_idx_t dst = Fiasco::Capability::valid(_last.kcap) ? _last.kcap : L4_SYSF_REPLY;
l4_cap_idx_t dst = Fiasco::Capability::valid(_last.kcap)
? _last.kcap : (l4_cap_idx_t)L4_SYSF_REPLY;
/* answer wakeup call from one of core's region-manager sessions */
l4_ipc_send(dst, l4_utcb(), l4_msgtag(0, 0, 0, 0), L4_IPC_SEND_TIMEOUT_0);
@ -134,7 +135,8 @@ void Ipc_pager::acknowledge_wakeup()
void Ipc_pager::acknowledge_exception()
{
memcpy(l4_utcb_exc(), &_regs, sizeof(l4_exc_regs_t));
l4_cap_idx_t dst = Fiasco::Capability::valid(_last.kcap) ? _last.kcap : L4_SYSF_REPLY;
l4_cap_idx_t dst = Fiasco::Capability::valid(_last.kcap)
? _last.kcap : (l4_cap_idx_t)L4_SYSF_REPLY;
Fiasco::l4_msgtag_t const msg_tag =
l4_ipc_send(dst, l4_utcb(),
l4_msgtag(0, L4_UTCB_EXCEPTION_REGS_SIZE, 0, 0),

View File

@ -71,7 +71,7 @@ static class Msi_allocator : public Genode::Bit_array<MAX_MSIS>
Msi_allocator() {
using namespace Fiasco;
l4_icu_info_t info { .features = 0 };
l4_icu_info_t info { .features = 0, .nr_irqs = 0, .nr_msis = 0 };
l4_msgtag_t res = l4_icu_info(Fiasco::L4_BASE_ICU_CAP, &info);
if (l4_error(res) || !(info.features & L4_ICU_FLAG_MSI))
@ -182,7 +182,7 @@ Genode::Irq_object::~Irq_object()
Irq_session_component::Irq_session_component(Range_allocator *irq_alloc,
const char *args)
: _irq_number(Arg_string::find_arg(args, "irq_number").long_value(-1)),
_irq_alloc(irq_alloc)
_irq_alloc(irq_alloc), _irq_object()
{
long msi = Arg_string::find_arg(args, "device_config_phys").long_value(0);
if (msi) {
@ -230,7 +230,7 @@ void Irq_session_component::sigh(Genode::Signal_context_capability cap)
Genode::Irq_session::Info Irq_session_component::info()
{
if (!_irq_object.msi_address())
return { .type = Genode::Irq_session::Info::Type::INVALID };
return { .type = Info::Type::INVALID, .address = 0, .value = 0 };
return {
.type = Genode::Irq_session::Info::Type::MSI,

View File

@ -334,7 +334,7 @@ void Platform::_setup_irq_alloc()
{
using namespace Fiasco;
l4_icu_info_t info { .features = 0 };
l4_icu_info_t info { .features = 0, .nr_irqs = 0, .nr_msis = 0 };
l4_msgtag_t res = l4_icu_info(Fiasco::L4_BASE_ICU_CAP, &info);
if (l4_error(res))
panic("could not determine number of IRQs");

View File

@ -21,8 +21,8 @@ namespace Fiasco {
using namespace Genode;
void Ram_dataspace_factory::_export_ram_ds(Dataspace_component *ds) { }
void Ram_dataspace_factory::_revoke_ram_ds(Dataspace_component *ds) { }
void Ram_dataspace_factory::_export_ram_ds(Dataspace_component *) { }
void Ram_dataspace_factory::_revoke_ram_ds(Dataspace_component *) { }
void Ram_dataspace_factory::_clear_ds(Dataspace_component *ds)

View File

@ -41,8 +41,14 @@ namespace Genode {
{
private:
Spin_lock _lock; /* used very early in initialization,
where normal lock isn't feasible */
/*
* Noncopyable
*/
Cap_index_allocator_tpl(Cap_index_allocator_tpl const &);
Cap_index_allocator_tpl &operator = (Cap_index_allocator_tpl const &);
Spin_lock _lock { }; /* used very early in initialization,
where normal lock isn't feasible */
enum {
/* everything below START_IDX is managed by core */

View File

@ -174,8 +174,8 @@ namespace Genode {
{
private:
Avl_tree<Cap_index> _tree;
Spin_lock _lock;
Avl_tree<Cap_index> _tree { };
Spin_lock _lock { };
public:

View File

@ -30,7 +30,8 @@ class Genode::Native_capability::Data : public Avl_node<Data>, Noncopyable
{
private:
enum { INVALID_ID = -1, UNUSED = 0 };
constexpr static uint16_t INVALID_ID = ~0;
constexpr static uint16_t UNUSED = 0;
uint8_t _ref_cnt; /* reference counter */
uint16_t _id; /* global capability id */
@ -47,7 +48,7 @@ class Genode::Native_capability::Data : public Avl_node<Data>, Noncopyable
uint8_t dec();
addr_t kcap() const;
void* operator new (__SIZE_TYPE__ size, Data* idx) { return idx; }
void* operator new (__SIZE_TYPE__, Data* idx) { return idx; }
void operator delete (void* idx) { memset(idx, 0, sizeof(Data)); }

View File

@ -61,7 +61,7 @@ static inline bool ipc_error(l4_msgtag_t tag, bool print)
}
enum { INVALID_BADGE = ~0UL };
static constexpr unsigned long INVALID_BADGE = ~0UL;
/**
@ -86,7 +86,7 @@ static unsigned long extract_msg_from_utcb(l4_msgtag_t tag,
{
unsigned num_msg_words = l4_msgtag_words(tag);
l4_mword_t const *msg_words = (l4_mword_t const *)l4_utcb_mr();
l4_umword_t const *msg_words = (l4_umword_t const *)l4_utcb_mr();
/* each message has at least the protocol word and the capability count */
if (num_msg_words < 2)
@ -96,7 +96,7 @@ static unsigned long extract_msg_from_utcb(l4_msgtag_t tag,
unsigned long const protocol_word = *msg_words++;
/* read number of capability arguments from second message word */
unsigned long const num_caps = min(*msg_words, Msgbuf_base::MAX_CAPS_PER_MSG);
size_t const num_caps = min(*msg_words, Msgbuf_base::MAX_CAPS_PER_MSG);
msg_words++;
num_msg_words -= 2;
@ -259,7 +259,7 @@ static l4_msgtag_t copy_msgbuf_to_utcb(Msgbuf_base &snd_msg,
Rpc_exception_code Genode::ipc_call(Native_capability dst,
Msgbuf_base &snd_msg, Msgbuf_base &rcv_msg,
size_t rcv_caps)
size_t)
{
Receive_window rcv_window;
rcv_window.init();
@ -269,7 +269,7 @@ Rpc_exception_code Genode::ipc_call(Native_capability dst,
l4_msgtag_t const call_tag = copy_msgbuf_to_utcb(snd_msg, dst.local_name());
addr_t rcv_cap_sel = rcv_window.rcv_cap_sel_base();
for (int i = 0; i < Msgbuf_base::MAX_CAPS_PER_MSG; i++) {
for (size_t i = 0; i < Msgbuf_base::MAX_CAPS_PER_MSG; i++) {
l4_utcb_br()->br[i] = rcv_cap_sel | L4_RCV_ITEM_SINGLE_CAP;
rcv_cap_sel += L4_CAP_SIZE;
}
@ -300,7 +300,7 @@ static bool badge_matches_label(unsigned long badge, unsigned long label)
}
void Genode::ipc_reply(Native_capability caller, Rpc_exception_code exc,
void Genode::ipc_reply(Native_capability, Rpc_exception_code exc,
Msgbuf_base &snd_msg)
{
l4_msgtag_t tag = copy_msgbuf_to_utcb(snd_msg, exc.value);
@ -311,7 +311,7 @@ void Genode::ipc_reply(Native_capability caller, Rpc_exception_code exc,
}
Genode::Rpc_request Genode::ipc_reply_wait(Reply_capability const &last_caller,
Genode::Rpc_request Genode::ipc_reply_wait(Reply_capability const &,
Rpc_exception_code exc,
Msgbuf_base &reply_msg,
Msgbuf_base &request_msg)
@ -324,7 +324,7 @@ Genode::Rpc_request Genode::ipc_reply_wait(Reply_capability const &last_caller,
/* prepare receive window in UTCB */
addr_t rcv_cap_sel = rcv_window.rcv_cap_sel_base();
for (int i = 0; i < Msgbuf_base::MAX_CAPS_PER_MSG; i++) {
for (size_t i = 0; i < Msgbuf_base::MAX_CAPS_PER_MSG; i++) {
l4_utcb_br()->br[i] = rcv_cap_sel | L4_RCV_ITEM_SINGLE_CAP;
rcv_cap_sel += L4_CAP_SIZE;
}

View File

@ -34,12 +34,12 @@ using namespace Genode;
Signal_source_client::Signal_source_client(Capability<Signal_source> cap)
:
Rpc_client<Foc_signal_source>(static_cap_cast<Foc_signal_source>(cap))
{
using namespace Fiasco;
Rpc_client<Foc_signal_source>(static_cap_cast<Foc_signal_source>(cap)),
/* request mapping of semaphore capability selector */
_sem = call<Rpc_request_semaphore>();
_sem(call<Rpc_request_semaphore>())
{
using namespace Fiasco;
Foc_native_cpu_client cpu_client(env_deprecated()->cpu_session()->native_cpu());
Native_capability thread_cap = cpu_client.native_cap(Thread::myself()->cap());

View File

@ -38,9 +38,39 @@ struct Genode::Cpu_state
IRQ_FLAG = 1UL << 63,
};
addr_t ip, cpu_exception, ra, sp, gp, tp, t0, t1, t2, s0, s1, a0, a1, a2,
a3, a4, a5, a6, a7, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, t3,
t4, t5, t6;
addr_t ip = 0;
addr_t cpu_exception = 0;
addr_t ra = 0;
addr_t sp = 0;
addr_t gp = 0;
addr_t tp = 0;
addr_t t0 = 0;
addr_t t1 = 0;
addr_t t2 = 0;
addr_t s0 = 0;
addr_t s1 = 0;
addr_t a0 = 0;
addr_t a1 = 0;
addr_t a2 = 0;
addr_t a3 = 0;
addr_t a4 = 0;
addr_t a5 = 0;
addr_t a6 = 0;
addr_t a7 = 0;
addr_t s2 = 0;
addr_t s3 = 0;
addr_t s4 = 0;
addr_t s5 = 0;
addr_t s6 = 0;
addr_t s7 = 0;
addr_t s8 = 0;
addr_t s9 = 0;
addr_t s10 = 0;
addr_t s11 = 0;
addr_t t3 = 0;
addr_t t4 = 0;
addr_t t5 = 0;
addr_t t6 = 0;
bool is_irq() { return cpu_exception & IRQ_FLAG; }
unsigned irq() { return cpu_exception ^ IRQ_FLAG; }

View File

@ -92,7 +92,7 @@ class Genode::Sinfo
*
* The function returns NULL if the subject name cannot be retrieved.
*/
const char * const get_subject_name(void);
const char * get_subject_name(void);
/*
* Return information for a channel given by name.
@ -180,8 +180,8 @@ class Genode::Sinfo
private:
subject_info_type * sinfo;
scheduling_info_type * sched_info;
subject_info_type * sinfo = nullptr;
scheduling_info_type * sched_info = nullptr;
char subject_name[MAX_NAME_LENGTH + 1];
bool subject_name_set = false;

View File

@ -42,11 +42,11 @@ class Bootstrap::Platform
struct Board
{
Memory_region_array early_ram_regions;
Memory_region_array late_ram_regions;
Memory_region_array early_ram_regions { };
Memory_region_array late_ram_regions { };
Mmio_space const core_mmio;
Hw::Acpi_rsdp acpi_rsdp;
Hw::Framebuffer framebuffer;
Hw::Acpi_rsdp acpi_rsdp { };
Hw::Framebuffer framebuffer { };
Board();
};
@ -97,7 +97,7 @@ class Bootstrap::Platform
void * const array_base;
Table & table;
Table_array & array;
Boot_info::Mapping_pool mappings;
Boot_info::Mapping_pool mappings { };
Pd(Ram_allocator & alloc);
@ -121,10 +121,10 @@ class Bootstrap::Platform
}
};
Board board;
Bootstrap::Cpu cpu;
Bootstrap::Pic pic;
Ram_allocator ram_alloc;
Board board { };
Bootstrap::Cpu cpu { };
Bootstrap::Pic pic { };
Ram_allocator ram_alloc { };
Memory_region const bootstrap_region;
Genode::Constructible<Pd> core_pd;
addr_t core_elf_addr;

View File

@ -29,7 +29,7 @@ class Cpu_counter
{
private:
Hw::Spin_lock _lock;
Hw::Spin_lock _lock { };
volatile int _value = 0;
public:

View File

@ -16,7 +16,7 @@
using namespace Board;
bool Board::secure_irq(unsigned i) { return true; }
bool Board::secure_irq(unsigned) { return true; }
Bootstrap::Platform::Board::Board()

View File

@ -25,8 +25,7 @@ Bootstrap::Platform::Board::Board()
PL310_MMIO_SIZE }) { }
bool Bootstrap::Cpu::errata(Bootstrap::Cpu::Errata err) {
return false; }
bool Bootstrap::Cpu::errata(Bootstrap::Cpu::Errata) { return false; }
void Bootstrap::Cpu::wake_up_all_cpus(void * const ip)

View File

@ -27,8 +27,7 @@ Bootstrap::Platform::Board::Board()
PL310_MMIO_SIZE }) { }
bool Bootstrap::Cpu::errata(Bootstrap::Cpu::Errata err) {
return false; }
bool Bootstrap::Cpu::errata(Bootstrap::Cpu::Errata) { return false; }
void Bootstrap::Cpu::wake_up_all_cpus(void * const ip)

View File

@ -33,8 +33,7 @@ namespace Board {
}
template <typename E, unsigned B, unsigned S>
void Sv39::Level_x_translation_table<E, B, S>::_translation_added(addr_t addr,
size_t size)
void Sv39::Level_x_translation_table<E, B, S>::_translation_added(addr_t, size_t)
{ }
#endif /* _SRC__BOOTSTRAP__SPEC__RISCV__BOARD_H_ */

View File

@ -17,7 +17,7 @@
using namespace Board;
Bootstrap::Platform::Board::Board()
: early_ram_regions(Memory_region { RAM_0_BASE, RAM_0_SIZE } ) {}
: early_ram_regions(Memory_region { RAM_0_BASE, RAM_0_SIZE } ), core_mmio() {}
unsigned Bootstrap::Platform::enable_mmu()

View File

@ -39,8 +39,7 @@ constexpr unsigned Hw::Page_table::Descriptor_base::_device_tex() {
constexpr bool Hw::Page_table::Descriptor_base::_smp() { return false; }
void Hw::Page_table::_translation_added(unsigned long addr,
unsigned long size) {
void Hw::Page_table::_translation_added(unsigned long, unsigned long) {
Bootstrap::Cpu::clean_invalidate_data_cache(); }
#endif /* _SRC__BOOTSTRAP__SPEC__RPI__BOARD_H_ */

View File

@ -29,5 +29,5 @@ Bootstrap::Platform::Board::Board()
PL310_MMIO_SIZE }) { }
bool Bootstrap::Cpu::errata(Bootstrap::Cpu::Errata err) {
bool Bootstrap::Cpu::errata(Bootstrap::Cpu::Errata) {
return false; }

View File

@ -26,7 +26,7 @@ using namespace Genode;
Region_map::Local_addr
Core_region_map::attach(Dataspace_capability ds_cap, size_t size,
off_t offset, bool use_local_addr,
Region_map::Local_addr, bool executable)
Region_map::Local_addr, bool)
{
auto lambda = [&] (Dataspace_component *ds) -> Local_addr {
if (!ds)

View File

@ -28,7 +28,15 @@ namespace Genode
*/
class Cpu_thread_allocator : public Allocator
{
Allocator * const _alloc;
private:
/*
* Noncopyable
*/
Cpu_thread_allocator(Cpu_thread_allocator const &);
Cpu_thread_allocator &operator = (Cpu_thread_allocator const &);
Allocator * const _alloc;
public:
@ -56,7 +64,7 @@ namespace Genode
return 0;
}
size_t overhead(size_t size) const override
size_t overhead(size_t) const override
{
warning(__func__, "unexpectedly called");
while (1) ;

View File

@ -18,9 +18,8 @@
using namespace Genode;
void Io_mem_session_component::_unmap_local(addr_t base, size_t size) { }
void Io_mem_session_component::_unmap_local(addr_t, size_t) { }
addr_t Io_mem_session_component::_map_local(addr_t base, size_t size)
{ return base; }
addr_t Io_mem_session_component::_map_local(addr_t base, size_t) { return base; }

View File

@ -21,22 +21,29 @@
#include <kernel/irq.h>
namespace Genode {
class Irq_session_component;
}
namespace Genode { class Irq_session_component; }
class Genode::Irq_session_component : public Rpc_object<Irq_session>,
public List<Irq_session_component>::Element
class Genode::Irq_session_component : public Rpc_object<Irq_session>,
private List<Irq_session_component>::Element
{
private:
friend class List<Irq_session_component>;
/*
* Noncopyable
*/
Irq_session_component(Irq_session_component const &);
Irq_session_component &operator = (Irq_session_component const &);
unsigned _irq_number;
Range_allocator *_irq_alloc;
Genode::uint8_t _kernel_object[sizeof(Kernel::User_irq)];
bool _is_msi;
addr_t _address, _value;
Signal_context_capability _sig_cap;
Signal_context_capability _sig_cap { };
unsigned _find_irq_number(const char * const args);
@ -65,9 +72,9 @@ class Genode::Irq_session_component : public Rpc_object<Irq_session>,
Info info() override
{
if (!_is_msi) {
return { .type = Info::Type::INVALID };
}
if (!_is_msi)
return { .type = Info::Type::INVALID, .address = 0, .value = 0 };
return { .type = Info::Type::MSI,
.address = _address,
.value = _value };

View File

@ -74,7 +74,7 @@ void Cpu_job::_yield()
}
void Cpu_job::_interrupt(unsigned const cpu_id)
void Cpu_job::_interrupt(unsigned const /* cpu_id */)
{
/* determine handling for specific interrupt */
unsigned irq_id;
@ -149,8 +149,8 @@ time_t Cpu::timeout_max_us() const { return _timer.timeout_max_us(); }
void Cpu::schedule(Job * const job)
{
if (_id == executing_id()) { _scheduler.ready(job); }
else if (_scheduler.ready_check(job)) { trigger_ip_interrupt(); }
if (_id == executing_id()) { _scheduler.ready(&job->share()); }
else if (_scheduler.ready_check(&job->share())) { trigger_ip_interrupt(); }
}

View File

@ -38,7 +38,37 @@ namespace Kernel
Cpu_pool * cpu_pool();
}
class Kernel::Cpu : public Genode::Cpu, public Irq::Pool, private Timeout
/*
* The 'Cpu' class violates the "Effective C++" practices because it publicly
* inherits the 'Genode::Cpu' base class, which does not have a virtual
* destructor. Since 'Cpu' implements the 'Timeout' interface, however, it has
* a vtable.
*
* Adding a virtual destructor in the base class would be unnatural as the base
* class hierarchy does not represent an abstract interface.
*
* Inheriting the 'Genode::Cpu' class privately is not an option because the
* user of 'Cpu' class expects architecture-specific register definitions to be
* provided by 'Cpu'. Hence, all those architecture- specific definitions would
* end up as 'using' clauses in the generic class.
*
* XXX Remove the disabled warning, e.g., by one of the following approaches:
*
* * Prevent 'Cpu' to have virtual methods by making 'Timeout' a member instead
* of a base class.
*
* * Change the class hierarchy behind 'Genode::Cpu' such that
* architecture-specific bits do no longer need to implicitly become part
* of the public interface of 'Cpu'. For example, register-definition types
* could all be embedded in an 'Arch_regs' type, which the 'Cpu' class could
* publicly provide via a 'typedef Genode::Cpu::Arch_regs Arch_regs'.
* Then, the 'Genode::Cpu' could be inherited privately.
*/
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
class Kernel::Cpu : public Genode::Cpu, private Irq::Pool, private Timeout
{
private:
@ -156,8 +186,17 @@ class Kernel::Cpu : public Genode::Cpu, public Irq::Pool, private Timeout
time_t us_to_ticks(time_t const us) const { return _timer.us_to_ticks(us); };
unsigned timer_interrupt_id() const { return _timer.interrupt_id(); }
Irq::Pool &irq_pool() { return *this; }
};
/*
* See the comment above the 'Cpu' class definition.
*/
#pragma GCC diagnostic pop
class Kernel::Cpu_pool
{
private:

View File

@ -34,14 +34,15 @@ namespace Kernel
class Cpu_domain_update;
}
class Kernel::Cpu_domain_update : public Double_list_item
class Kernel::Cpu_domain_update : private Double_list_item
{
friend class Cpu_domain_update_list;
friend class Kernel::Double_list_typed<Cpu_domain_update>;
private:
bool _pending[NR_OF_CPUS];
unsigned _domain_id;
unsigned _domain_id = 0;
/**
* Domain-update back-end
@ -57,6 +58,8 @@ class Kernel::Cpu_domain_update : public Double_list_item
Cpu_domain_update();
virtual ~Cpu_domain_update() { };
/**
* Do an update of domain 'id' on all CPUs and return if this blocks
*/
@ -68,8 +71,18 @@ class Kernel::Cpu_domain_update : public Double_list_item
virtual void _cpu_domain_update_unblocks() = 0;
};
class Kernel::Cpu_job : public Cpu_share
class Kernel::Cpu_job : private Cpu_share
{
private:
friend class Cpu; /* static_cast from 'Cpu_share' to 'Cpu_job' */
/*
* Noncopyable
*/
Cpu_job(Cpu_job const &);
Cpu_job &operator = (Cpu_job const &);
protected:
Cpu * _cpu;
@ -124,7 +137,7 @@ class Kernel::Cpu_job : public Cpu_share
/**
* Destructor
*/
~Cpu_job();
virtual ~Cpu_job();
/**
* Link job to CPU 'cpu'
@ -154,6 +167,8 @@ class Kernel::Cpu_job : public Cpu_share
***************/
void cpu(Cpu * const cpu) { _cpu = cpu; }
Cpu_share &share() { return *this; }
};
#endif /* _CORE__KERNEL__CPU_CONTEXT_H_ */

View File

@ -88,8 +88,8 @@ class Kernel::Cpu_share : public Cpu_claim, public Cpu_fill
signed const _prio;
unsigned _quota;
unsigned _claim;
unsigned _fill;
bool _ready;
unsigned _fill = 0;
bool _ready = false;
public:
@ -100,7 +100,7 @@ class Kernel::Cpu_share : public Cpu_claim, public Cpu_fill
* \param q claimed quota
*/
Cpu_share(signed const p, unsigned const q)
: _prio(p), _quota(q), _claim(q), _ready(0) { }
: _prio(p), _quota(q), _claim(q) { }
/*
* Accessors
@ -123,11 +123,11 @@ class Kernel::Cpu_scheduler
Claim_list _rcl[Prio::MAX + 1]; /* ready claims */
Claim_list _ucl[Prio::MAX + 1]; /* unready claims */
Fill_list _fills; /* ready fills */
Fill_list _fills { }; /* ready fills */
Share * const _idle;
Share * _head;
unsigned _head_quota;
bool _head_claims;
Share * _head = nullptr;
unsigned _head_quota = 0;
bool _head_claims = false;
bool _head_yields;
unsigned const _quota;
unsigned _residual;

View File

@ -38,8 +38,8 @@ class Kernel::Double_list_item
private:
Double_list_item * _next;
Double_list_item * _prev;
Double_list_item * _next = nullptr;
Double_list_item * _prev = nullptr;
};
class Kernel::Double_list

View File

@ -39,7 +39,7 @@ namespace Kernel
using Ipc_node_queue = Kernel::Fifo<Ipc_node>;
}
class Kernel::Ipc_node : public Ipc_node_queue::Element
class Kernel::Ipc_node : private Ipc_node_queue::Element
{
protected:
@ -55,6 +55,8 @@ class Kernel::Ipc_node : public Ipc_node_queue::Element
private:
friend class Core_thread;
friend class Kernel::Fifo<Ipc_node>;
friend class Genode::Fifo<Ipc_node>;
State _state = INACTIVE;
capid_t _capid = cap_id_invalid();
@ -63,7 +65,7 @@ class Kernel::Ipc_node : public Ipc_node_queue::Element
bool _help = false;
size_t _rcv_caps = 0; /* max capability num to receive */
Genode::Native_utcb * _utcb = nullptr;
Ipc_node_queue _request_queue;
Ipc_node_queue _request_queue { };
/* pre-allocation array for obkject identity references */
void * _obj_id_ref_ptr[Genode::Msgbuf_base::MAX_CAPS_PER_MSG];
@ -137,7 +139,7 @@ class Kernel::Ipc_node : public Ipc_node_queue::Element
protected:
Pd * _pd; /* pointer to PD this IPC node is part of */
Pd * _pd = nullptr; /* pointer to PD this IPC node is part of */
/***************
@ -149,7 +151,7 @@ class Kernel::Ipc_node : public Ipc_node_queue::Element
public:
~Ipc_node();
virtual ~Ipc_node();
/**
* Send a request and wait for the according reply
@ -200,8 +202,8 @@ class Kernel::Ipc_node : public Ipc_node_queue::Element
** Accessors **
***************/
Pd * const pd() const { return _pd; }
Genode::Native_utcb * utcb() { return _utcb; }
Pd *pd() const { return _pd; }
Genode::Native_utcb *utcb() { return _utcb; }
};
#endif /* _CORE__KERNEL__IPC_NODE_H_ */

View File

@ -47,8 +47,11 @@ namespace Genode
}
class Kernel::Irq : public Genode::Avl_node<Irq>
class Kernel::Irq : Genode::Avl_node<Irq>
{
friend class Genode::Avl_tree<Irq>;
friend class Genode::Avl_node<Irq>;
public:
struct Pool : Genode::Avl_tree<Irq>

View File

@ -28,7 +28,7 @@ extern "C" void kernel()
void Kernel::Cpu::Ipi::occurred() { }
void Kernel::Cpu::Ipi::trigger(unsigned const cpu_id) { }
void Kernel::Cpu::Ipi::trigger(unsigned) { }
Kernel::Cpu::Ipi::Ipi(Kernel::Irq::Pool &p) : Kernel::Irq(Kernel::Pic::IPI, p) { }

View File

@ -71,8 +71,11 @@ namespace Kernel
}
struct Kernel::Object : public Kernel::Object_identity_list
struct Kernel::Object : private Object_identity_list
{
using Object_identity_list::remove;
using Object_identity_list::insert;
virtual ~Object();
};
@ -83,6 +86,12 @@ class Kernel::Object_identity
{
private:
/*
* Noncopyable
*/
Object_identity(Object_identity const &);
Object_identity &operator = (Object_identity const &);
Object * _object = nullptr;
public:
@ -103,6 +112,12 @@ class Kernel::Object_identity_reference
{
private:
/*
* Noncopyable
*/
Object_identity_reference(Object_identity_reference const &);
Object_identity_reference &operator = (Object_identity_reference const &);
capid_t _capid;
Object_identity *_identity;
Pd &_pd;
@ -181,13 +196,16 @@ class Kernel::Core_object_identity : public Object_identity,
template <typename T>
class Kernel::Core_object : public T, public Kernel::Core_object_identity<T>
class Kernel::Core_object : public T, Kernel::Core_object_identity<T>
{
public:
template <typename... ARGS>
Core_object(ARGS &&... args)
: T(args...), Core_object_identity<T>(*static_cast<T*>(this)) { }
using Kernel::Core_object_identity<T>::core_capid;
using Kernel::Core_object_identity<T>::capid;
};
#endif /* _CORE__KERNEL__OBJECT_H_ */

View File

@ -45,14 +45,20 @@ class Kernel::Pd : public Kernel::Object
private:
/*
* Noncopyable
*/
Pd(Pd const &);
Pd &operator = (Pd const &);
Hw::Page_table * const _table;
Genode::Platform_pd * const _platform_pd;
Capid_allocator _capid_alloc;
Object_identity_reference_tree _cap_tree;
Capid_allocator _capid_alloc { };
Object_identity_reference_tree _cap_tree { };
public:
Genode::Cpu::Mmu_context mmu_regs;
Genode::Cpu::Mmu_context mmu_regs;
/**
* Constructor

View File

@ -50,6 +50,12 @@ class Kernel::Signal_handler
private:
/*
* Noncopyable
*/
Signal_handler(Signal_handler const &);
Signal_handler &operator = (Signal_handler const &);
typedef Genode::Fifo_element<Signal_handler> Fifo_element;
Fifo_element _handlers_fe;
@ -95,6 +101,12 @@ class Kernel::Signal_context_killer
private:
/*
* Noncopyable
*/
Signal_context_killer(Signal_context_killer const &);
Signal_context_killer &operator = (Signal_context_killer const &);
Signal_context * _context;
/**
@ -138,6 +150,12 @@ class Kernel::Signal_context : public Kernel::Object
private:
/*
* Noncopyable
*/
Signal_context(Signal_context const &);
Signal_context &operator = (Signal_context const &);
typedef Genode::Fifo_element<Signal_context> Fifo_element;
Fifo_element _deliver_fe;
@ -243,9 +261,9 @@ class Kernel::Signal_receiver : public Kernel::Object
template <typename T> class Fifo : public Genode::Fifo<T> { };
Fifo<Signal_handler::Fifo_element> _handlers;
Fifo<Signal_context::Fifo_element> _deliver;
Fifo<Signal_context::Fifo_element> _contexts;
Fifo<Signal_handler::Fifo_element> _handlers { };
Fifo<Signal_context::Fifo_element> _deliver { };
Fifo<Signal_context::Fifo_element> _contexts { };
/**
* Recognize that context 'c' has submits to deliver

View File

@ -51,6 +51,14 @@ class Kernel::Thread
public Ipc_node, public Signal_context_killer, public Signal_handler,
private Timeout
{
private:
/*
* Noncopyable
*/
Thread(Thread const &);
Thread &operator = (Thread const &);
protected:
enum { START_VERBOSE = 0 };
@ -67,7 +75,7 @@ class Kernel::Thread
};
Signal_context * _pager = nullptr;
Thread_fault _fault;
Thread_fault _fault { };
State _state;
Signal_receiver * _signal_receiver;
char const * const _label;

View File

@ -32,16 +32,17 @@ namespace Kernel
/**
* A timeout causes a kernel pass and the call of a timeout specific handle
*/
class Kernel::Timeout : public Genode::List<Timeout>::Element
class Kernel::Timeout : Genode::List<Timeout>::Element
{
friend class Timer;
friend class Genode::List<Timeout>;
private:
bool _listed = false;
time_t _start;
time_t _end;
bool _end_period;
bool _listed = false;
time_t _start = 0;
time_t _end = 0;
bool _end_period = false;
public:

View File

@ -36,9 +36,15 @@ class Kernel::Vm : public Cpu_job,
{
private:
/*
* Noncopyable
*/
Vm(Vm const &);
Vm &operator = (Vm const &);
enum State { ACTIVE, INACTIVE };
unsigned _id;
unsigned _id = 0;
Genode::Vm_state * const _state;
Signal_context * const _context;
void * const _table;

View File

@ -22,11 +22,8 @@ void Native_pd_component::upgrade_cap_slab() {
}
Native_pd_component::Native_pd_component(Pd_session_component &pd_session,
char const *args)
: _pd_session(pd_session) {
_pd_session._ep.manage(this); }
Native_pd_component::Native_pd_component(Pd_session_component &pd, char const *)
: _pd_session(pd) { _pd_session._ep.manage(this); }
Native_pd_component::~Native_pd_component() {
_pd_session._ep.dissolve(this); }
Native_pd_component::~Native_pd_component() { _pd_session._ep.dissolve(this); }

View File

@ -44,7 +44,7 @@ class Genode::Kernel_object
protected:
Untyped_capability _cap;
Untyped_capability _cap { };
public:

View File

@ -80,8 +80,9 @@ class Genode::Ipc_pager
{
protected:
Kernel::Thread_fault _fault;
Mapping _mapping;
Kernel::Thread_fault _fault { };
Mapping _mapping { };
public:
@ -112,10 +113,11 @@ class Genode::Ipc_pager
};
class Genode::Pager_object : public Object_pool<Pager_object>::Entry,
public Genode::Kernel_object<Kernel::Signal_context>
class Genode::Pager_object : private Object_pool<Pager_object>::Entry,
private Genode::Kernel_object<Kernel::Signal_context>
{
friend class Pager_entrypoint;
friend class Object_pool<Pager_object>;
private:
@ -186,13 +188,15 @@ class Genode::Pager_object : public Object_pool<Pager_object>::Entry,
Cpu_session_capability cpu_session_cap() const { return _cpu_session_cap; }
Thread_capability thread_cap() const { return _thread_cap; }
using Object_pool<Pager_object>::Entry::cap;
};
class Genode::Pager_entrypoint : public Object_pool<Pager_object>,
public Thread_deprecated<PAGER_EP_STACK_SIZE>,
public Kernel_object<Kernel::Signal_receiver>,
public Ipc_pager
class Genode::Pager_entrypoint : public Object_pool<Pager_object>,
public Thread_deprecated<PAGER_EP_STACK_SIZE>,
private Kernel_object<Kernel::Signal_receiver>,
private Ipc_pager
{
public:

View File

@ -188,6 +188,6 @@ bool Mapped_mem_allocator::_map_local(addr_t virt_addr, addr_t phys_addr,
return ::map_local(phys_addr, virt_addr, size / get_page_size()); }
bool Mapped_mem_allocator::_unmap_local(addr_t virt_addr, addr_t phys_addr,
bool Mapped_mem_allocator::_unmap_local(addr_t virt_addr, addr_t,
unsigned size) {
return ::unmap_local(virt_addr, size / get_page_size()); }

View File

@ -39,11 +39,11 @@ class Genode::Platform : public Genode::Platform_generic
{
private:
Core_mem_allocator _core_mem_alloc; /* core-accessible memory */
Phys_allocator _io_mem_alloc; /* MMIO allocator */
Phys_allocator _io_port_alloc; /* I/O port allocator */
Phys_allocator _irq_alloc; /* IRQ allocator */
Rom_fs _rom_fs; /* ROM file system */
Core_mem_allocator _core_mem_alloc { }; /* core-accessible memory */
Phys_allocator _io_mem_alloc; /* MMIO allocator */
Phys_allocator _io_port_alloc; /* I/O port allocator */
Phys_allocator _irq_alloc; /* IRQ allocator */
Rom_fs _rom_fs { }; /* ROM file system */
static Hw::Boot_info const & _boot_info();
static Hw::Memory_region_array const & _core_virt_regions();

View File

@ -149,7 +149,7 @@ Platform_pd::Platform_pd(Page_table & tt,
_label("core") { }
Platform_pd::Platform_pd(Allocator * md_alloc, char const *label)
Platform_pd::Platform_pd(Allocator *, char const *label)
: Hw::Address_space(*kernel_object()),
Kernel_object<Kernel::Pd>(true, (Page_table*)translation_table_phys(), this),
_label(label)

View File

@ -60,16 +60,23 @@ class Hw::Address_space : public Genode::Address_space
{
private:
/*
* Noncopyable
*/
Address_space(Address_space const &);
Address_space &operator = (Address_space const &);
friend class Genode::Platform;
friend class Genode::Mapped_mem_allocator;
using Table = Hw::Page_table;
using Array = Table::Allocator::Array<DEFAULT_TRANSLATION_TABLE_MAX>;
Genode::Lock _lock; /* table lock */
Table & _tt; /* table virt addr */
Genode::addr_t _tt_phys; /* table phys addr */
Genode::Lock _lock { }; /* table lock */
Table & _tt; /* table virt addr */
Genode::addr_t _tt_phys; /* table phys addr */
Array * _tt_array = nullptr;
Table::Allocator & _tt_alloc; /* table allocator */
Table::Allocator & _tt_alloc; /* table allocator */
Kernel::Pd & _kernel_pd;
static inline Genode::Core_mem_allocator * _cma();
@ -77,7 +84,6 @@ class Hw::Address_space : public Genode::Address_space
protected:
/**
* Core-specific constructor
*
@ -153,13 +159,19 @@ class Genode::Cap_space
};
class Genode::Platform_pd : public Hw::Address_space,
public Genode::Cap_space,
public Kernel_object<Kernel::Pd>
class Genode::Platform_pd : public Hw::Address_space,
private Cap_space,
private Kernel_object<Kernel::Pd>
{
private:
Native_capability _parent;
/*
* Noncopyable
*/
Platform_pd(Platform_pd const &);
Platform_pd &operator = (Platform_pd const &);
Native_capability _parent { };
bool _thread_associated = false;
char const * const _label;
@ -188,6 +200,9 @@ class Genode::Platform_pd : public Hw::Address_space,
*/
~Platform_pd();
using Cap_space::capability_slab;
using Cap_space::upgrade_slab;
/**
* Bind thread 't' to protection domain
*/
@ -198,7 +213,6 @@ class Genode::Platform_pd : public Hw::Address_space,
*/
void unbind_thread(Platform_thread *t);
/**
* Assign parent interface to protection domain
*/
@ -209,8 +223,8 @@ class Genode::Platform_pd : public Hw::Address_space,
** Accessors **
***************/
char const * const label() { return _label; }
Native_capability parent() { return _parent; }
char const * label() { return _label; }
Native_capability parent() { return _parent; }
};

View File

@ -43,15 +43,21 @@ namespace Genode {
*/
class Platform_thread : public Kernel_object<Kernel::Thread>
{
/*
* Noncopyable
*/
Platform_thread(Platform_thread const &);
Platform_thread &operator = (Platform_thread const &);
enum { LABEL_MAX_LEN = 32 };
Platform_pd * _pd;
Weak_ptr<Address_space> _address_space;
Pager_object * _pager;
Native_utcb * _utcb_core_addr; /* UTCB addr in core */
Native_utcb * _utcb_pd_addr; /* UTCB addr in pd */
Ram_dataspace_capability _utcb; /* UTCB dataspace */
char _label[LABEL_MAX_LEN];
Platform_pd * _pd;
Weak_ptr<Address_space> _address_space { };
Pager_object * _pager;
Native_utcb * _utcb_core_addr { }; /* UTCB addr in core */
Native_utcb * _utcb_pd_addr; /* UTCB addr in pd */
Ram_dataspace_capability _utcb { }; /* UTCB dataspace */
char _label[LABEL_MAX_LEN];
/*
* Wether this thread is the main thread of a program.
@ -63,7 +69,7 @@ namespace Genode {
*/
bool _main_thread;
Affinity::Location _location;
Affinity::Location _location { };
/**
* Common construction part

View File

@ -25,8 +25,8 @@
using namespace Genode;
void Ram_dataspace_factory::_export_ram_ds(Dataspace_component *ds) { }
void Ram_dataspace_factory::_revoke_ram_ds(Dataspace_component *ds) { }
void Ram_dataspace_factory::_export_ram_ds(Dataspace_component *) { }
void Ram_dataspace_factory::_revoke_ram_ds(Dataspace_component *) { }
void Ram_dataspace_factory::_clear_ds (Dataspace_component * ds)
{

View File

@ -43,7 +43,7 @@ class Genode::Rpc_cap_factory
{
using Identity = Kernel::Core_object_identity<Kernel::Thread>;
Native_capability cap;
Native_capability cap { };
uint8_t data[sizeof(Identity)]
__attribute__((aligned(sizeof(addr_t))));
@ -53,8 +53,8 @@ class Genode::Rpc_cap_factory
uint8_t _initial_slab_block[get_page_size()];
Slab _slab;
List<Kobject> _list;
Lock _lock;
List<Kobject> _list { };
Lock _lock { };
public:

View File

@ -42,9 +42,9 @@ class Genode::Signal_broker
Allocator &_md_alloc;
Slab<Signal_source_component> _sources_slab { &_md_alloc };
Signal_source_pool _sources;
Signal_source_pool _sources { };
Slab<Signal_context_component> _contexts_slab { &_md_alloc };
Signal_context_pool _contexts;
Signal_context_pool _contexts { };
public:
@ -138,7 +138,7 @@ class Genode::Signal_broker
destroy(&_contexts_slab, context);
}
void submit(Signal_context_capability cap, unsigned cnt)
void submit(Signal_context_capability, unsigned)
{
/*
* This function is never called as base-hw delivers signals

View File

@ -32,9 +32,13 @@ namespace Genode {
}
struct Genode::Signal_context_component : Kernel_object<Kernel::Signal_context>,
Signal_context_pool::Entry
struct Genode::Signal_context_component : private Kernel_object<Kernel::Signal_context>,
public Signal_context_pool::Entry
{
friend class Object_pool<Signal_context_component>;
using Signal_context_pool::Entry::cap;
inline Signal_context_component(Signal_source_component &s,
addr_t const imprint);
@ -42,9 +46,14 @@ struct Genode::Signal_context_component : Kernel_object<Kernel::Signal_context>,
};
struct Genode::Signal_source_component : Kernel_object<Kernel::Signal_receiver>,
Signal_source_pool::Entry
struct Genode::Signal_source_component : private Kernel_object<Kernel::Signal_receiver>,
public Signal_source_pool::Entry
{
friend class Object_pool<Signal_source_component>;
friend class Signal_context_component;
using Signal_source_pool::Entry::cap;
Signal_source_component()
:
Kernel_object<Kernel::Signal_receiver>(true),

View File

@ -90,15 +90,24 @@ class Genode::Fpu
{
private:
/*
* Noncopyable
*/
Context(Context const &);
Context &operator = (Context const &);
friend class Fpu;
/* advanced FP/SIMD - system registers */
uint32_t fpscr;
uint32_t fpexc;
struct
{
/* advanced FP/SIMD - system registers */
uint32_t fpscr;
uint32_t fpexc;
/* advanced FP/SIMD - general purpose registers d0-d15 */
uint64_t d0, d1, d2, d3, d4, d5, d6, d7;
uint64_t d8, d9, d10, d11, d12, d13, d14, d15;
/* advanced FP/SIMD - general purpose registers d0-d15 */
uint64_t d0, d1, d2, d3, d4, d5, d6, d7;
uint64_t d8, d9, d10, d11, d12, d13, d14, d15;
};
Fpu * _fpu = nullptr;

View File

@ -24,9 +24,8 @@ void Platform::setup_irq_mode(unsigned, unsigned, unsigned) { }
long Platform::irq(long const user_irq) { return user_irq; }
bool Platform::get_msi_params(const addr_t mmconf, addr_t &address,
addr_t &data, unsigned &irq_number)
bool Platform::get_msi_params(const addr_t /* mmconf */, addr_t & /* address */,
addr_t & /* data */, unsigned & /* irq_number */)
{
return false;
}

View File

@ -21,7 +21,7 @@ using namespace Kernel;
Kernel::Vm::Vm(void * const state,
Kernel::Signal_context * const context,
void * const table)
void * const /* table */)
: Cpu_job(Cpu_priority::MIN, 0),
_state((Genode::Vm_state * const)state),
_context(context), _table(0) {

View File

@ -29,17 +29,22 @@ namespace Genode {
class Vm_session_component;
}
class Genode::Vm_session_component
: public Genode::Rpc_object<Genode::Vm_session>,
public Kernel_object<Kernel::Vm>
class Genode::Vm_session_component : public Genode::Rpc_object<Genode::Vm_session>,
private Kernel_object<Kernel::Vm>
{
private:
/*
* Noncopyable
*/
Vm_session_component(Vm_session_component const &);
Vm_session_component &operator = (Vm_session_component const &);
Rpc_entrypoint *_ds_ep;
Range_allocator *_ram_alloc;
Range_allocator *_ram_alloc = nullptr;
Dataspace_component _ds;
Dataspace_capability _ds_cap;
addr_t _ds_addr;
addr_t _ds_addr = 0;
static size_t _ds_size() {
return align_addr(sizeof(Cpu_state_modes),
@ -63,13 +68,13 @@ class Genode::Vm_session_component
void run(void);
void pause(void);
void attach(Dataspace_capability ds_cap, addr_t vm_addr) {
void attach(Dataspace_capability, addr_t /* vm_addr */) {
warning("Not implemented for TrustZone case"); }
void attach_pic(addr_t vm_addr) {
void attach_pic(addr_t /* vm_addr */) {
warning("Not implemented for TrustZone case"); }
void detach(addr_t vm_addr, size_t size) {
void detach(addr_t /* vm_addr */, size_t /* size */) {
warning("Not implemented for TrustZone case"); }
};

View File

@ -56,7 +56,10 @@ struct Host_context {
struct Kernel::Vm_irq : Kernel::Irq
{
Vm_irq(unsigned const irq) : Kernel::Irq(irq, *cpu_pool()->executing_cpu()) {}
Vm_irq(unsigned const irq)
:
Kernel::Irq(irq, cpu_pool()->executing_cpu()->irq_pool())
{ }
/**
* A VM interrupt gets injected into the VM scheduled on the current CPU

View File

@ -31,20 +31,25 @@ namespace Genode {
class Vm_session_component;
}
class Genode::Vm_session_component
: public Genode::Rpc_object<Genode::Vm_session>,
public Kernel_object<Kernel::Vm>
class Genode::Vm_session_component : public Genode::Rpc_object<Genode::Vm_session>,
private Kernel_object<Kernel::Vm>
{
private:
/*
* Noncopyable
*/
Vm_session_component(Vm_session_component const &);
Vm_session_component &operator = (Vm_session_component const &);
using Table = Hw::Level_1_stage_2_translation_table;
using Array = Table::Allocator::Array<Kernel::DEFAULT_TRANSLATION_TABLE_MAX>;
Rpc_entrypoint *_ds_ep;
Range_allocator *_ram_alloc;
Range_allocator *_ram_alloc = nullptr;
Dataspace_component _ds;
Dataspace_capability _ds_cap;
addr_t _ds_addr;
addr_t _ds_addr = 0;
Table &_table;
Array &_table_array;

View File

@ -26,7 +26,7 @@ class Genode::Cpu : public Arm_v7_cpu
{
protected:
Fpu _fpu;
Fpu _fpu { };
public:

View File

@ -69,7 +69,7 @@ void Genode::Cpu::switch_to(Mmu_context & context)
}
void Genode::Cpu::mmu_fault(Context & c, Kernel::Thread_fault & f)
void Genode::Cpu::mmu_fault(Context &, Kernel::Thread_fault & f)
{
f.addr = Genode::Cpu::Sbadaddr::read();
f.type = Kernel::Thread_fault::PAGE_MISSING;

View File

@ -49,7 +49,7 @@ class Genode::Cpu : public Hw::Riscv_cpu
struct Mmu_context
{
Sptbr::access_t sptbr;
Sptbr::access_t sptbr = 0;
Mmu_context(addr_t page_table_base);
~Mmu_context();
@ -75,7 +75,7 @@ class Genode::Cpu : public Hw::Riscv_cpu
asm volatile ("sfence.vm\n");
}
static void invalidate_tlb_by_pid(unsigned const pid) { sfence(); }
static void invalidate_tlb_by_pid(unsigned const /* pid */) { sfence(); }
void switch_to(Mmu_context & context);
static void mmu_fault(Context & c, Kernel::Thread_fault & f);

View File

@ -15,5 +15,5 @@
#include <kernel/cpu.h>
#include <hw/memory_map.h>
void Kernel::Cpu::init(Kernel::Pic &pic) {
void Kernel::Cpu::init(Kernel::Pic &) {
Stvec::write(Hw::Mm::supervisor_exception_vector().base); }

View File

@ -36,8 +36,8 @@ class Genode::Pic
Pic() { }
bool take_request(unsigned & i) { i = 0; return true; }
void unmask(unsigned const i, unsigned) { }
void mask(unsigned const i) { }
void unmask(unsigned, unsigned) { }
void mask(unsigned) { }
void finish_request() { }
};

View File

@ -27,8 +27,8 @@ void Platform::_init_additional() { }
void Platform::setup_irq_mode(unsigned, unsigned, unsigned) { }
long Platform::irq(long const user_irq) { return 0; }
long Platform::irq(long const /* user_irq */) { return 0; }
bool Platform::get_msi_params(const addr_t mmconf, addr_t &address,
addr_t &data, unsigned &irq_number) {
bool Platform::get_msi_params(addr_t /* mmconf */, addr_t & /* address */,
addr_t & /* data */, unsigned & /* irq_number */) {
return false; }

View File

@ -18,8 +18,9 @@
#include <cpu.h>
template <typename E, unsigned B, unsigned S>
void Sv39::Level_x_translation_table<E, B, S>::_translation_added(addr_t addr,
size_t size) {
Genode::Cpu::sfence(); }
void Sv39::Level_x_translation_table<E, B, S>::_translation_added(addr_t, size_t)
{
Genode::Cpu::sfence();
}
#endif /* _CORE__SPEC__RISCV__TRANSLATION_TABLE_H_ */

View File

@ -107,7 +107,7 @@ class Genode::Pic : Mmio
struct Irq_disable_gpu_2 : Register<0x20, 32> { };
struct Irq_disable_basic : Register<0x24, 32> { };
Usb_dwc_otg _usb;
Usb_dwc_otg _usb { };
/**
* Return true if specified interrupt is pending

View File

@ -43,7 +43,7 @@ class Genode::Cpu : public Hw::X86_64_cpu
{
protected:
Fpu _fpu;
Fpu _fpu { };
public:
@ -61,7 +61,7 @@ class Genode::Cpu : public Hw::X86_64_cpu
uint64_t reserved2;
static void init();
} __attribute__((packed)) tss;
} __attribute__((packed)) tss { };
/**
@ -86,7 +86,7 @@ class Genode::Cpu : public Hw::X86_64_cpu
uint64_t tss_desc[2];
void init(addr_t tss_addr);
} __attribute__((packed)) gdt;
} __attribute__((packed)) gdt { };
/**
@ -138,5 +138,4 @@ class Genode::Cpu : public Hw::X86_64_cpu
static void mmu_fault(Context & regs, Kernel::Thread_fault & fault);
};
#endif /* _CORE__SPEC__X86_64__CPU_H_ */

View File

@ -66,4 +66,4 @@ void Kernel::Vm::proceed(Cpu & cpu)
}
void Kernel::Vm::inject_irq(unsigned irq) { }
void Kernel::Vm::inject_irq(unsigned) { }

View File

@ -58,8 +58,8 @@ class Genode::Pic
*/
Pic() { }
void finish_request() { }
void unmask(unsigned const i, unsigned) { }
void mask(unsigned const i) { }
void unmask(unsigned const, unsigned) { }
void mask(unsigned const) { }
bool is_ip_interrupt(unsigned, unsigned) { return false; }
void trigger_ip_interrupt(unsigned) { }

View File

@ -31,14 +31,15 @@ namespace Genode {
class Genode::Vm_session_component
: public Genode::Rpc_object<Genode::Vm_session>,
public Kernel_object<Kernel::Vm>
private Kernel_object<Kernel::Vm>
{
private:
Vm_state _state;
public:
Vm_session_component(Rpc_entrypoint*, size_t) { }
Vm_session_component(Rpc_entrypoint*, size_t) : _state() { }
~Vm_session_component() { }
@ -67,9 +68,9 @@ class Genode::Vm_session_component
Kernel::pause_vm(kernel_object());
}
void attach(Dataspace_capability ds_cap, addr_t vm_addr) {}
void attach_pic(addr_t vm_addr) {}
void detach(addr_t vm_addr, size_t size) {}
void attach(Dataspace_capability, addr_t) {}
void attach_pic(addr_t) {}
void detach(addr_t, size_t) {}
};
#endif /* _CORE__SPEC__X86_64__MUEN__VM_SESSION_COMPONENT_H_ */

View File

@ -54,7 +54,7 @@ class Genode::Ioapic : public Mmio
enum { REMAP_BASE = Board::VECTOR_REMAP_BASE };
/* Number of Redirection Table entries */
unsigned _irte_count;
unsigned _irte_count = 0;
enum {
/* Register selectors */
@ -180,7 +180,7 @@ class Genode::Pic : public Mmio
*/
Pic();
Ioapic ioapic;
Ioapic ioapic { };
bool take_request(unsigned &irq);

View File

@ -99,8 +99,7 @@ void Platform::setup_irq_mode(unsigned irq_number, unsigned trigger,
Kernel::pic()->ioapic.setup_irq_mode(irq_number, trigger, polarity); }
bool Platform::get_msi_params(const addr_t mmconf, addr_t &address,
addr_t &data, unsigned &irq_number) {
bool Platform::get_msi_params(addr_t, addr_t &, addr_t &, unsigned &) {
return false; }

View File

@ -29,7 +29,7 @@ namespace Genode
/**
* Select source used for map operations
*/
constexpr addr_t map_src_addr(addr_t core_local, addr_t phys) { return phys; }
constexpr addr_t map_src_addr(addr_t, addr_t phys) { return phys; }
/**
* Return highest supported flexpage size for the given mapping size

View File

@ -43,7 +43,7 @@ native_thread_id(Genode::Thread * const t)
/**
* Yield execution time-slice of current thread to thread t
*/
static inline void thread_switch_to(Genode::Thread * const t)
static inline void thread_switch_to(Genode::Thread *)
{
Kernel::yield_thread();
}

Some files were not shown because too many files have changed in this diff Show More