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:
parent
2a33d9aa76
commit
eba9c15746
|
@ -47,8 +47,8 @@ namespace Genode {
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
Mapping(addr_t dst_addr, addr_t src_addr,
|
Mapping(addr_t dst_addr, addr_t src_addr,
|
||||||
Cache_attribute cacheability, bool io_mem,
|
Cache_attribute cacheability, bool,
|
||||||
unsigned l2size, bool rw, bool executable)
|
unsigned l2size, bool rw, bool)
|
||||||
:
|
:
|
||||||
_dst_addr(dst_addr),
|
_dst_addr(dst_addr),
|
||||||
_fpage(Fiasco::l4_fpage(src_addr, l2size, rw, false))
|
_fpage(Fiasco::l4_fpage(src_addr, l2size, rw, false))
|
||||||
|
@ -93,10 +93,10 @@ namespace Genode {
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Fiasco::l4_threadid_t _last; /* origin of last fault message */
|
Fiasco::l4_threadid_t _last { }; /* origin of last fault message */
|
||||||
addr_t _pf_addr; /* page-fault address */
|
addr_t _pf_addr { 0 }; /* page-fault address */
|
||||||
addr_t _pf_ip; /* instruction pointer of faulter */
|
addr_t _pf_ip { 0 }; /* instruction pointer of faulter */
|
||||||
Mapping _reply_mapping; /* page-fault answer */
|
Mapping _reply_mapping { }; /* page-fault answer */
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ namespace Genode {
|
||||||
* \param virt core-local address
|
* \param virt core-local address
|
||||||
* \param num_pages number of pages to unmap
|
* \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");
|
error("unmap_local() called - not implemented yet");
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,23 +31,29 @@ namespace Genode {
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Platform(Platform const &);
|
||||||
|
Platform &operator = (Platform const &);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Shortcut for the type of allocator instances for physical resources
|
* Shortcut for the type of allocator instances for physical resources
|
||||||
*/
|
*/
|
||||||
typedef Synced_range_allocator<Allocator_avl> Phys_allocator;
|
typedef Synced_range_allocator<Allocator_avl> Phys_allocator;
|
||||||
|
|
||||||
char _core_label[1]; /* to satisfy _core_pd */
|
char _core_label[1]; /* to satisfy _core_pd */
|
||||||
Platform_pd *_core_pd; /* core protection domain object */
|
Platform_pd *_core_pd = nullptr; /* core protection domain object */
|
||||||
Phys_allocator _ram_alloc; /* RAM allocator */
|
Phys_allocator _ram_alloc; /* RAM allocator */
|
||||||
Phys_allocator _io_mem_alloc; /* MMIO allocator */
|
Phys_allocator _io_mem_alloc; /* MMIO allocator */
|
||||||
Phys_allocator _io_port_alloc; /* I/O port allocator */
|
Phys_allocator _io_port_alloc; /* I/O port allocator */
|
||||||
Phys_allocator _irq_alloc; /* IRQ allocator */
|
Phys_allocator _irq_alloc; /* IRQ allocator */
|
||||||
Phys_allocator _region_alloc; /* virtual memory allocator for core */
|
Phys_allocator _region_alloc; /* virtual memory allocator for core */
|
||||||
Rom_fs _rom_fs; /* ROM file system */
|
Rom_fs _rom_fs { }; /* ROM file system */
|
||||||
Rom_module _kip_rom; /* ROM module for Fiasco KIP */
|
Rom_module _kip_rom; /* ROM module for Fiasco KIP */
|
||||||
|
|
||||||
addr_t _vm_start; /* begin of virtual memory */
|
addr_t _vm_start = 0; /* begin of virtual memory */
|
||||||
size_t _vm_size; /* size of virtual memory */
|
size_t _vm_size = 0; /* size of virtual memory */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We do not export any boot module loaded before FIRST_ROM.
|
* We do not export any boot module loaded before FIRST_ROM.
|
||||||
|
@ -101,7 +107,7 @@ namespace Genode {
|
||||||
*/
|
*/
|
||||||
Sigma0();
|
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);
|
Core_pager(Platform_pd *core_pd);
|
||||||
|
|
||||||
int pager(Ipc_pager &ps) { /* never called */ return -1; }
|
int pager(Ipc_pager &) { /* never called */ return -1; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -32,6 +32,12 @@ namespace Genode {
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Platform_pd(Platform_pd const &);
|
||||||
|
Platform_pd &operator = (Platform_pd const &);
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
VERSION_BITS = 10,
|
VERSION_BITS = 10,
|
||||||
PD_FIRST = 0x10,
|
PD_FIRST = 0x10,
|
||||||
|
@ -41,10 +47,10 @@ namespace Genode {
|
||||||
THREAD_MAX = (1 << 7),
|
THREAD_MAX = (1 << 7),
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned _pd_id; /* plain pd number */
|
unsigned _pd_id = 0;
|
||||||
unsigned _version; /* version number */
|
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
|
* Register quota donation at allocator guard
|
||||||
*/
|
*/
|
||||||
void upgrade_ram_quota(size_t ram_quota) { }
|
void upgrade_ram_quota(size_t) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize L4 task facility
|
* Initialize L4 task facility
|
||||||
|
@ -178,7 +184,7 @@ namespace Genode {
|
||||||
/**
|
/**
|
||||||
* Assign parent interface to protection domain
|
* Assign parent interface to protection domain
|
||||||
*/
|
*/
|
||||||
void assign_parent(Native_capability parent) { }
|
void assign_parent(Native_capability) { }
|
||||||
|
|
||||||
int pd_id() const { return _pd_id; }
|
int pd_id() const { return _pd_id; }
|
||||||
|
|
||||||
|
|
|
@ -30,18 +30,24 @@ namespace Fiasco {
|
||||||
namespace Genode {
|
namespace Genode {
|
||||||
|
|
||||||
class Platform_pd;
|
class Platform_pd;
|
||||||
class Platform_thread
|
class Platform_thread : Interface
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Platform_thread(Platform_thread const &);
|
||||||
|
Platform_thread &operator = (Platform_thread const &);
|
||||||
|
|
||||||
int _thread_id; /* plain thread number */
|
int _thread_id; /* plain thread number */
|
||||||
Fiasco::l4_threadid_t _l4_thread_id; /* L4 thread ID */
|
Fiasco::l4_threadid_t _l4_thread_id; /* L4 thread ID */
|
||||||
char _name[32]; /* thread name that will be
|
char _name[32]; /* thread name that will be
|
||||||
registered at the kernel
|
registered at the kernel
|
||||||
debugger */
|
debugger */
|
||||||
Platform_pd *_platform_pd; /* protection domain thread
|
Platform_pd *_platform_pd = nullptr; /* protection domain thread
|
||||||
is bound to */
|
is bound to */
|
||||||
Pager_object *_pager;
|
Pager_object *_pager;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -152,7 +158,7 @@ namespace Genode {
|
||||||
/**
|
/**
|
||||||
* Set CPU quota of the thread to 'quota'
|
* 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
|
* Return execution time consumed by the thread
|
||||||
|
|
|
@ -29,7 +29,7 @@ class Genode::Rpc_cap_factory
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Rpc_cap_factory(Allocator &md_alloc) { }
|
Rpc_cap_factory(Allocator &) { }
|
||||||
|
|
||||||
Native_capability alloc(Native_capability ep);
|
Native_capability alloc(Native_capability ep);
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ namespace Genode {
|
||||||
constexpr size_t get_super_page_size() { return L4_SUPERPAGESIZE; }
|
constexpr size_t get_super_page_size() { return L4_SUPERPAGESIZE; }
|
||||||
constexpr size_t get_super_page_size_log2() { return L4_LOG2_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; }
|
return core_local_addr; }
|
||||||
|
|
||||||
inline size_t constrain_map_size_log2(size_t size_log2) { return size_log2; }
|
inline size_t constrain_map_size_log2(size_t size_log2) { return size_log2; }
|
||||||
|
|
|
@ -25,7 +25,7 @@ namespace Fiasco {
|
||||||
using namespace Genode;
|
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));
|
platform()->region_alloc()->free(reinterpret_cast<void *>(base));
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,5 +162,5 @@ void Irq_session_component::sigh(Genode::Signal_context_capability cap)
|
||||||
Genode::Irq_session::Info Irq_session_component::info()
|
Genode::Irq_session::Info Irq_session_component::info()
|
||||||
{
|
{
|
||||||
/* no MSI support */
|
/* no MSI support */
|
||||||
return { .type = Genode::Irq_session::Info::Type::INVALID };
|
return { .type = Info::Type::INVALID, .address = 0, .value = 0 };
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,10 +33,10 @@ void Pager_object::wake_up()
|
||||||
|
|
||||||
/* kernel-defined message header */
|
/* kernel-defined message header */
|
||||||
struct {
|
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 size_dope = L4_IPC_DOPE(0, 0);
|
||||||
l4_msgdope_t send_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_msgdope_t ipc_result;
|
||||||
l4_umword_t dummy = 0;
|
l4_umword_t dummy = 0;
|
||||||
|
|
|
@ -246,8 +246,7 @@ void Platform_pd::flush(addr_t, size_t size, Core_local_addr core_local_base)
|
||||||
L4_FP_FLUSH_PAGE);
|
L4_FP_FLUSH_PAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
Platform_pd::Platform_pd(Allocator * md_alloc, char const *,
|
Platform_pd::Platform_pd(Allocator *, char const *, signed pd_id, bool create)
|
||||||
signed pd_id, bool create)
|
|
||||||
{
|
{
|
||||||
/* check correct init */
|
/* check correct init */
|
||||||
if (!_init)
|
if (!_init)
|
||||||
|
|
|
@ -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");
|
warning(__func__, " not implemented");
|
||||||
throw Cpu_thread::State_access_failed();
|
throw Cpu_thread::State_access_failed();
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
|
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
|
|
||||||
void Ram_dataspace_factory::_export_ram_ds(Dataspace_component *ds) { }
|
void Ram_dataspace_factory::_export_ram_ds(Dataspace_component *) { }
|
||||||
void Ram_dataspace_factory::_revoke_ram_ds(Dataspace_component *ds) { }
|
void Ram_dataspace_factory::_revoke_ram_ds(Dataspace_component *) { }
|
||||||
|
|
||||||
void Ram_dataspace_factory::_clear_ds(Dataspace_component *ds)
|
void Ram_dataspace_factory::_clear_ds(Dataspace_component *ds)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,49 +20,55 @@ namespace Fiasco {
|
||||||
#include <l4/sys/utcb.h>
|
#include <l4/sys/utcb.h>
|
||||||
#include <l4/sys/task.h>
|
#include <l4/sys/task.h>
|
||||||
|
|
||||||
enum Cap_selectors {
|
/*********************************************
|
||||||
|
** Capability selectors controlled by core **
|
||||||
|
*********************************************/
|
||||||
|
|
||||||
/*********************************************
|
/* use the same task cap selector like L4Re for compatibility in L4Linux */
|
||||||
** Capability selectors controlled by core **
|
static constexpr l4_cap_idx_t TASK_CAP = L4_BASE_TASK_CAP;
|
||||||
*********************************************/
|
|
||||||
|
|
||||||
TASK_CAP = L4_BASE_TASK_CAP, /* use the same task cap selector
|
static constexpr l4_cap_idx_t DEBUG_CAP = L4_BASE_DEBUGGER_CAP;
|
||||||
like L4Re for compatibility in
|
|
||||||
L4Linux */
|
|
||||||
DEBUG_CAP = L4_BASE_DEBUGGER_CAP,
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* To not clash with other L4Re cap selector constants (e.g.: L4Linux)
|
* To not clash with other L4Re cap selector constants (e.g.: L4Linux)
|
||||||
* leave the following selectors (2-8) empty
|
* 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
|
* Each thread has a designated slot in the core controlled cap
|
||||||
* selector area, where its ipc gate capability (for server threads),
|
* selector area, where its ipc gate capability (for server threads),
|
||||||
* its irq capability (for locks), and the capability to its pager
|
* its irq capability (for locks), and the capability to its pager
|
||||||
* gate are stored
|
* 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 */
|
/* offset to thread area */
|
||||||
THREAD_GATE_CAP = 0, /* offset to the ipc gate
|
static constexpr l4_cap_idx_t THREAD_AREA_BASE = 0xcUL << L4_CAP_SHIFT;
|
||||||
cap selector in the slot */
|
|
||||||
THREAD_PAGER_CAP = 0x1UL << L4_CAP_SHIFT, /* offset to the pager
|
/* size of one thread slot */
|
||||||
cap selector in the slot */
|
static constexpr l4_cap_idx_t THREAD_AREA_SLOT = 0x3UL << L4_CAP_SHIFT;
|
||||||
THREAD_IRQ_CAP = 0x2UL << L4_CAP_SHIFT, /* offset to the irq cap
|
|
||||||
selector in the slot */
|
/* offset to the ipc gate cap selector in the slot */
|
||||||
MAIN_THREAD_CAP = THREAD_AREA_BASE + THREAD_GATE_CAP, /* shortcut to the
|
static constexpr l4_cap_idx_t THREAD_GATE_CAP = 0;
|
||||||
main thread's
|
|
||||||
gate cap */
|
/* 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
|
struct Capability
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,7 +34,7 @@ struct Genode::Native_thread
|
||||||
Fiasco::l4_cap_idx_t kcap = 0;
|
Fiasco::l4_cap_idx_t kcap = 0;
|
||||||
|
|
||||||
/* receive window for capability selectors received at the server side */
|
/* receive window for capability selectors received at the server side */
|
||||||
Receive_window rcv_window;
|
Receive_window rcv_window { };
|
||||||
|
|
||||||
Native_thread() { }
|
Native_thread() { }
|
||||||
explicit Native_thread(Fiasco::l4_cap_idx_t kcap) : kcap(kcap) { }
|
explicit Native_thread(Fiasco::l4_cap_idx_t kcap) : kcap(kcap) { }
|
||||||
|
|
|
@ -38,6 +38,21 @@ class Genode::Receive_window
|
||||||
|
|
||||||
~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();
|
void init();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -36,7 +36,7 @@ struct Genode::Foc_thread_state : Thread_state
|
||||||
unsigned exceptions; /* counts exceptions raised by the thread */
|
unsigned exceptions; /* counts exceptions raised by the thread */
|
||||||
bool paused; /* indicates whether thread is stopped */
|
bool paused; /* indicates whether thread is stopped */
|
||||||
bool in_exception; /* true if thread is in exception */
|
bool in_exception; /* true if thread is in exception */
|
||||||
Lock lock;
|
Lock lock { };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
|
|
@ -34,7 +34,8 @@ namespace Genode {
|
||||||
};
|
};
|
||||||
|
|
||||||
Synced_range_allocator<Allocator_avl> _id_alloc;
|
Synced_range_allocator<Allocator_avl> _id_alloc;
|
||||||
Lock _lock;
|
|
||||||
|
Lock _lock { };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,12 @@ class Genode::Core_cap_index : public Native_capability::Data
|
||||||
Platform_thread const *_pt;
|
Platform_thread const *_pt;
|
||||||
Native_thread _gate;
|
Native_thread _gate;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Core_cap_index(Core_cap_index const &);
|
||||||
|
Core_cap_index &operator = (Core_cap_index const &);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Core_cap_index(Pd_session_component *session = 0,
|
Core_cap_index(Pd_session_component *session = 0,
|
||||||
|
|
|
@ -29,6 +29,12 @@ class Genode::Cpu_session_irqs : public Avl_node<Cpu_session_irqs>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Cpu_session_irqs(Cpu_session_irqs const &);
|
||||||
|
Cpu_session_irqs &operator = (Cpu_session_irqs const &);
|
||||||
|
|
||||||
enum { IRQ_MAX = 20 };
|
enum { IRQ_MAX = 20 };
|
||||||
|
|
||||||
Cpu_session_component* _owner;
|
Cpu_session_component* _owner;
|
||||||
|
|
|
@ -43,7 +43,7 @@ class Genode::Mapping
|
||||||
private:
|
private:
|
||||||
|
|
||||||
addr_t _dst_addr;
|
addr_t _dst_addr;
|
||||||
Fiasco::l4_fpage_t _fpage;
|
Fiasco::l4_fpage_t _fpage { };
|
||||||
Cache_attribute _cacheability;
|
Cache_attribute _cacheability;
|
||||||
bool _iomem;
|
bool _iomem;
|
||||||
|
|
||||||
|
@ -96,14 +96,14 @@ class Genode::Ipc_pager : public Native_capability
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Native_thread _last; /* origin of last fault */
|
Native_thread _last { }; /* origin of last fault */
|
||||||
addr_t _pf_addr; /* page-fault address */
|
addr_t _pf_addr { 0 }; /* page-fault address */
|
||||||
addr_t _pf_ip; /* ip of faulter */
|
addr_t _pf_ip { 0 }; /* ip of faulter */
|
||||||
Mapping _reply_mapping; /* page-fault answer */
|
Mapping _reply_mapping { }; /* page-fault answer */
|
||||||
unsigned long _badge; /* badge of faulting thread */
|
unsigned long _badge; /* badge of faulting thread */
|
||||||
Fiasco::l4_msgtag_t _tag; /* receive message tag */
|
Fiasco::l4_msgtag_t _tag { }; /* receive message tag */
|
||||||
Fiasco::l4_exc_regs_t _regs; /* exception registers */
|
Fiasco::l4_exc_regs_t _regs { }; /* exception registers */
|
||||||
Msg_type _type;
|
Msg_type _type { PAGEFAULT };
|
||||||
|
|
||||||
void _parse_msg_type(void);
|
void _parse_msg_type(void);
|
||||||
void _parse_exception(void);
|
void _parse_exception(void);
|
||||||
|
|
|
@ -27,6 +27,12 @@ class Genode::Irq_object
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Irq_object(Irq_object const &);
|
||||||
|
Irq_object &operator = (Irq_object const &);
|
||||||
|
|
||||||
Cap_index *_cap;
|
Cap_index *_cap;
|
||||||
Irq_session::Trigger _trigger; /* interrupt trigger */
|
Irq_session::Trigger _trigger; /* interrupt trigger */
|
||||||
Irq_session::Polarity _polarity; /* interrupt polarity */
|
Irq_session::Polarity _polarity; /* interrupt polarity */
|
||||||
|
@ -35,7 +41,7 @@ class Genode::Irq_object
|
||||||
Genode::addr_t _msi_addr;
|
Genode::addr_t _msi_addr;
|
||||||
Genode::addr_t _msi_data;
|
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(); }
|
Fiasco::l4_cap_idx_t _capability() const { return _cap->kcap(); }
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,12 @@ namespace Genode {
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Platform(Platform const &);
|
||||||
|
Platform &operator = (Platform const &);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pager object representing the pager of core namely sigma0
|
* Pager object representing the pager of core namely sigma0
|
||||||
*/
|
*/
|
||||||
|
@ -44,7 +50,7 @@ namespace Genode {
|
||||||
*/
|
*/
|
||||||
Sigma0(Cap_index*);
|
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;
|
typedef Synced_range_allocator<Allocator_avl> Phys_allocator;
|
||||||
|
|
||||||
Platform_pd *_core_pd; /* core protection domain object */
|
Platform_pd *_core_pd = nullptr; /* core protection domain object */
|
||||||
Phys_allocator _ram_alloc; /* RAM allocator */
|
Phys_allocator _ram_alloc; /* RAM allocator */
|
||||||
Phys_allocator _io_mem_alloc; /* MMIO allocator */
|
Phys_allocator _io_mem_alloc; /* MMIO allocator */
|
||||||
Phys_allocator _io_port_alloc; /* I/O port allocator */
|
Phys_allocator _io_port_alloc; /* I/O port allocator */
|
||||||
Phys_allocator _irq_alloc; /* IRQ allocator */
|
Phys_allocator _irq_alloc; /* IRQ allocator */
|
||||||
Phys_allocator _region_alloc; /* virtual memory allocator for core */
|
Phys_allocator _region_alloc; /* virtual memory allocator for core */
|
||||||
Cap_id_allocator _cap_id_alloc; /* capability id allocator */
|
Cap_id_allocator _cap_id_alloc; /* capability id allocator */
|
||||||
Rom_fs _rom_fs; /* ROM file system */
|
Rom_fs _rom_fs { }; /* ROM file system */
|
||||||
Rom_module _kip_rom; /* ROM module for Fiasco KIP */
|
Rom_module _kip_rom; /* ROM module for Fiasco KIP */
|
||||||
Sigma0 _sigma0;
|
Sigma0 _sigma0;
|
||||||
|
|
||||||
addr_t _vm_start; /* begin of virtual memory */
|
addr_t _vm_start = 0; /* begin of virtual memory */
|
||||||
size_t _vm_size; /* size 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*);
|
Core_pager(Platform_pd *core_pd, Sigma0*);
|
||||||
|
|
||||||
int pager(Ipc_pager &ps) { /* never called */ return -1; }
|
int pager(Ipc_pager &) { /* never called */ return -1; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -44,6 +44,12 @@ namespace Genode {
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Platform_pd(Platform_pd const &);
|
||||||
|
Platform_pd &operator = (Platform_pd const &);
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
THREAD_MAX = (1 << 7),
|
THREAD_MAX = (1 << 7),
|
||||||
UTCB_AREA_SIZE = (THREAD_MAX * Fiasco::L4_UTCB_OFFSET),
|
UTCB_AREA_SIZE = (THREAD_MAX * Fiasco::L4_UTCB_OFFSET),
|
||||||
|
@ -56,8 +62,8 @@ namespace Genode {
|
||||||
}
|
}
|
||||||
|
|
||||||
Cap_mapping _task;
|
Cap_mapping _task;
|
||||||
Cap_mapping _parent;
|
Cap_mapping _parent { };
|
||||||
Cap_mapping _debug;
|
Cap_mapping _debug { };
|
||||||
Platform_thread *_threads[THREAD_MAX];
|
Platform_thread *_threads[THREAD_MAX];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -27,10 +27,16 @@
|
||||||
namespace Genode {
|
namespace Genode {
|
||||||
|
|
||||||
class Platform_pd;
|
class Platform_pd;
|
||||||
class Platform_thread
|
class Platform_thread : Interface
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Platform_thread(Platform_thread const &);
|
||||||
|
Platform_thread &operator = (Platform_thread const &);
|
||||||
|
|
||||||
enum State { DEAD, RUNNING };
|
enum State { DEAD, RUNNING };
|
||||||
|
|
||||||
friend class Platform_pd;
|
friend class Platform_pd;
|
||||||
|
@ -38,8 +44,8 @@ namespace Genode {
|
||||||
State _state;
|
State _state;
|
||||||
bool _core_thread;
|
bool _core_thread;
|
||||||
Cap_mapping _thread;
|
Cap_mapping _thread;
|
||||||
Cap_mapping _gate;
|
Cap_mapping _gate { };
|
||||||
Cap_mapping _pager;
|
Cap_mapping _pager { };
|
||||||
Cap_mapping _irq;
|
Cap_mapping _irq;
|
||||||
addr_t _utcb;
|
addr_t _utcb;
|
||||||
char _name[32]; /* thread name that will be
|
char _name[32]; /* thread name that will be
|
||||||
|
@ -50,7 +56,7 @@ namespace Genode {
|
||||||
Pager_object *_pager_obj;
|
Pager_object *_pager_obj;
|
||||||
unsigned _prio;
|
unsigned _prio;
|
||||||
|
|
||||||
Affinity::Location _location;
|
Affinity::Location _location { };
|
||||||
|
|
||||||
void _create_thread(void);
|
void _create_thread(void);
|
||||||
void _finalize_construction(const char *name);
|
void _finalize_construction(const char *name);
|
||||||
|
@ -168,7 +174,7 @@ namespace Genode {
|
||||||
/**
|
/**
|
||||||
* Set CPU quota of the thread to 'quota'
|
* 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
|
* Return execution time consumed by the thread
|
||||||
|
|
|
@ -35,7 +35,7 @@ class Genode::Rpc_cap_factory
|
||||||
Entry(Native_capability cap) : Object_pool<Entry>::Entry(cap) {}
|
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
|
* Dimension '_entry_slab' such that slab blocks (including the
|
||||||
|
|
|
@ -71,7 +71,7 @@ namespace Genode {
|
||||||
constexpr size_t get_super_page_size() { return L4_SUPERPAGESIZE; }
|
constexpr size_t get_super_page_size() { return L4_SUPERPAGESIZE; }
|
||||||
constexpr size_t get_super_page_size_log2() { return L4_LOG2_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; }
|
return core_local_addr; }
|
||||||
|
|
||||||
inline size_t constrain_map_size_log2(size_t size_log2) { return size_log2; }
|
inline size_t constrain_map_size_log2(size_t size_log2) { return size_log2; }
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
using namespace Genode;
|
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));
|
platform()->region_alloc()->free(reinterpret_cast<void *>(base));
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,8 @@ void Ipc_pager::reply_and_wait_for_fault()
|
||||||
|
|
||||||
void Ipc_pager::acknowledge_wakeup()
|
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 */
|
/* 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);
|
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()
|
void Ipc_pager::acknowledge_exception()
|
||||||
{
|
{
|
||||||
memcpy(l4_utcb_exc(), &_regs, sizeof(l4_exc_regs_t));
|
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 =
|
Fiasco::l4_msgtag_t const msg_tag =
|
||||||
l4_ipc_send(dst, l4_utcb(),
|
l4_ipc_send(dst, l4_utcb(),
|
||||||
l4_msgtag(0, L4_UTCB_EXCEPTION_REGS_SIZE, 0, 0),
|
l4_msgtag(0, L4_UTCB_EXCEPTION_REGS_SIZE, 0, 0),
|
||||||
|
|
|
@ -71,7 +71,7 @@ static class Msi_allocator : public Genode::Bit_array<MAX_MSIS>
|
||||||
Msi_allocator() {
|
Msi_allocator() {
|
||||||
using namespace Fiasco;
|
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);
|
l4_msgtag_t res = l4_icu_info(Fiasco::L4_BASE_ICU_CAP, &info);
|
||||||
|
|
||||||
if (l4_error(res) || !(info.features & L4_ICU_FLAG_MSI))
|
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,
|
Irq_session_component::Irq_session_component(Range_allocator *irq_alloc,
|
||||||
const char *args)
|
const char *args)
|
||||||
: _irq_number(Arg_string::find_arg(args, "irq_number").long_value(-1)),
|
: _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);
|
long msi = Arg_string::find_arg(args, "device_config_phys").long_value(0);
|
||||||
if (msi) {
|
if (msi) {
|
||||||
|
@ -230,7 +230,7 @@ void Irq_session_component::sigh(Genode::Signal_context_capability cap)
|
||||||
Genode::Irq_session::Info Irq_session_component::info()
|
Genode::Irq_session::Info Irq_session_component::info()
|
||||||
{
|
{
|
||||||
if (!_irq_object.msi_address())
|
if (!_irq_object.msi_address())
|
||||||
return { .type = Genode::Irq_session::Info::Type::INVALID };
|
return { .type = Info::Type::INVALID, .address = 0, .value = 0 };
|
||||||
|
|
||||||
return {
|
return {
|
||||||
.type = Genode::Irq_session::Info::Type::MSI,
|
.type = Genode::Irq_session::Info::Type::MSI,
|
||||||
|
|
|
@ -334,7 +334,7 @@ void Platform::_setup_irq_alloc()
|
||||||
{
|
{
|
||||||
using namespace Fiasco;
|
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);
|
l4_msgtag_t res = l4_icu_info(Fiasco::L4_BASE_ICU_CAP, &info);
|
||||||
if (l4_error(res))
|
if (l4_error(res))
|
||||||
panic("could not determine number of IRQs");
|
panic("could not determine number of IRQs");
|
||||||
|
|
|
@ -21,8 +21,8 @@ namespace Fiasco {
|
||||||
|
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
|
|
||||||
void Ram_dataspace_factory::_export_ram_ds(Dataspace_component *ds) { }
|
void Ram_dataspace_factory::_export_ram_ds(Dataspace_component *) { }
|
||||||
void Ram_dataspace_factory::_revoke_ram_ds(Dataspace_component *ds) { }
|
void Ram_dataspace_factory::_revoke_ram_ds(Dataspace_component *) { }
|
||||||
|
|
||||||
|
|
||||||
void Ram_dataspace_factory::_clear_ds(Dataspace_component *ds)
|
void Ram_dataspace_factory::_clear_ds(Dataspace_component *ds)
|
||||||
|
|
|
@ -41,8 +41,14 @@ namespace Genode {
|
||||||
{
|
{
|
||||||
private:
|
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 {
|
enum {
|
||||||
/* everything below START_IDX is managed by core */
|
/* everything below START_IDX is managed by core */
|
||||||
|
|
|
@ -174,8 +174,8 @@ namespace Genode {
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Avl_tree<Cap_index> _tree;
|
Avl_tree<Cap_index> _tree { };
|
||||||
Spin_lock _lock;
|
Spin_lock _lock { };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,8 @@ class Genode::Native_capability::Data : public Avl_node<Data>, Noncopyable
|
||||||
{
|
{
|
||||||
private:
|
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 */
|
uint8_t _ref_cnt; /* reference counter */
|
||||||
uint16_t _id; /* global capability id */
|
uint16_t _id; /* global capability id */
|
||||||
|
@ -47,7 +48,7 @@ class Genode::Native_capability::Data : public Avl_node<Data>, Noncopyable
|
||||||
uint8_t dec();
|
uint8_t dec();
|
||||||
addr_t kcap() const;
|
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)); }
|
void operator delete (void* idx) { memset(idx, 0, sizeof(Data)); }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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);
|
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 */
|
/* each message has at least the protocol word and the capability count */
|
||||||
if (num_msg_words < 2)
|
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++;
|
unsigned long const protocol_word = *msg_words++;
|
||||||
|
|
||||||
/* read number of capability arguments from second message word */
|
/* 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++;
|
msg_words++;
|
||||||
|
|
||||||
num_msg_words -= 2;
|
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,
|
Rpc_exception_code Genode::ipc_call(Native_capability dst,
|
||||||
Msgbuf_base &snd_msg, Msgbuf_base &rcv_msg,
|
Msgbuf_base &snd_msg, Msgbuf_base &rcv_msg,
|
||||||
size_t rcv_caps)
|
size_t)
|
||||||
{
|
{
|
||||||
Receive_window rcv_window;
|
Receive_window rcv_window;
|
||||||
rcv_window.init();
|
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());
|
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();
|
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;
|
l4_utcb_br()->br[i] = rcv_cap_sel | L4_RCV_ITEM_SINGLE_CAP;
|
||||||
rcv_cap_sel += L4_CAP_SIZE;
|
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)
|
Msgbuf_base &snd_msg)
|
||||||
{
|
{
|
||||||
l4_msgtag_t tag = copy_msgbuf_to_utcb(snd_msg, exc.value);
|
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,
|
Rpc_exception_code exc,
|
||||||
Msgbuf_base &reply_msg,
|
Msgbuf_base &reply_msg,
|
||||||
Msgbuf_base &request_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 */
|
/* prepare receive window in UTCB */
|
||||||
addr_t rcv_cap_sel = rcv_window.rcv_cap_sel_base();
|
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;
|
l4_utcb_br()->br[i] = rcv_cap_sel | L4_RCV_ITEM_SINGLE_CAP;
|
||||||
rcv_cap_sel += L4_CAP_SIZE;
|
rcv_cap_sel += L4_CAP_SIZE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,12 +34,12 @@ using namespace Genode;
|
||||||
|
|
||||||
Signal_source_client::Signal_source_client(Capability<Signal_source> cap)
|
Signal_source_client::Signal_source_client(Capability<Signal_source> cap)
|
||||||
:
|
:
|
||||||
Rpc_client<Foc_signal_source>(static_cap_cast<Foc_signal_source>(cap))
|
Rpc_client<Foc_signal_source>(static_cap_cast<Foc_signal_source>(cap)),
|
||||||
{
|
|
||||||
using namespace Fiasco;
|
|
||||||
|
|
||||||
/* request mapping of semaphore capability selector */
|
/* 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());
|
Foc_native_cpu_client cpu_client(env_deprecated()->cpu_session()->native_cpu());
|
||||||
Native_capability thread_cap = cpu_client.native_cap(Thread::myself()->cap());
|
Native_capability thread_cap = cpu_client.native_cap(Thread::myself()->cap());
|
||||||
|
|
|
@ -38,9 +38,39 @@ struct Genode::Cpu_state
|
||||||
IRQ_FLAG = 1UL << 63,
|
IRQ_FLAG = 1UL << 63,
|
||||||
};
|
};
|
||||||
|
|
||||||
addr_t ip, cpu_exception, ra, sp, gp, tp, t0, t1, t2, s0, s1, a0, a1, a2,
|
addr_t ip = 0;
|
||||||
a3, a4, a5, a6, a7, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, t3,
|
addr_t cpu_exception = 0;
|
||||||
t4, t5, t6;
|
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; }
|
bool is_irq() { return cpu_exception & IRQ_FLAG; }
|
||||||
unsigned irq() { return cpu_exception ^ IRQ_FLAG; }
|
unsigned irq() { return cpu_exception ^ IRQ_FLAG; }
|
||||||
|
|
|
@ -92,7 +92,7 @@ class Genode::Sinfo
|
||||||
*
|
*
|
||||||
* The function returns NULL if the subject name cannot be retrieved.
|
* 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.
|
* Return information for a channel given by name.
|
||||||
|
@ -180,8 +180,8 @@ class Genode::Sinfo
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
subject_info_type * sinfo;
|
subject_info_type * sinfo = nullptr;
|
||||||
scheduling_info_type * sched_info;
|
scheduling_info_type * sched_info = nullptr;
|
||||||
char subject_name[MAX_NAME_LENGTH + 1];
|
char subject_name[MAX_NAME_LENGTH + 1];
|
||||||
bool subject_name_set = false;
|
bool subject_name_set = false;
|
||||||
|
|
||||||
|
|
|
@ -42,11 +42,11 @@ class Bootstrap::Platform
|
||||||
|
|
||||||
struct Board
|
struct Board
|
||||||
{
|
{
|
||||||
Memory_region_array early_ram_regions;
|
Memory_region_array early_ram_regions { };
|
||||||
Memory_region_array late_ram_regions;
|
Memory_region_array late_ram_regions { };
|
||||||
Mmio_space const core_mmio;
|
Mmio_space const core_mmio;
|
||||||
Hw::Acpi_rsdp acpi_rsdp;
|
Hw::Acpi_rsdp acpi_rsdp { };
|
||||||
Hw::Framebuffer framebuffer;
|
Hw::Framebuffer framebuffer { };
|
||||||
|
|
||||||
Board();
|
Board();
|
||||||
};
|
};
|
||||||
|
@ -97,7 +97,7 @@ class Bootstrap::Platform
|
||||||
void * const array_base;
|
void * const array_base;
|
||||||
Table & table;
|
Table & table;
|
||||||
Table_array & array;
|
Table_array & array;
|
||||||
Boot_info::Mapping_pool mappings;
|
Boot_info::Mapping_pool mappings { };
|
||||||
|
|
||||||
Pd(Ram_allocator & alloc);
|
Pd(Ram_allocator & alloc);
|
||||||
|
|
||||||
|
@ -121,10 +121,10 @@ class Bootstrap::Platform
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Board board;
|
Board board { };
|
||||||
Bootstrap::Cpu cpu;
|
Bootstrap::Cpu cpu { };
|
||||||
Bootstrap::Pic pic;
|
Bootstrap::Pic pic { };
|
||||||
Ram_allocator ram_alloc;
|
Ram_allocator ram_alloc { };
|
||||||
Memory_region const bootstrap_region;
|
Memory_region const bootstrap_region;
|
||||||
Genode::Constructible<Pd> core_pd;
|
Genode::Constructible<Pd> core_pd;
|
||||||
addr_t core_elf_addr;
|
addr_t core_elf_addr;
|
||||||
|
|
|
@ -29,7 +29,7 @@ class Cpu_counter
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Hw::Spin_lock _lock;
|
Hw::Spin_lock _lock { };
|
||||||
volatile int _value = 0;
|
volatile int _value = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
using namespace Board;
|
using namespace Board;
|
||||||
|
|
||||||
bool Board::secure_irq(unsigned i) { return true; }
|
bool Board::secure_irq(unsigned) { return true; }
|
||||||
|
|
||||||
|
|
||||||
Bootstrap::Platform::Board::Board()
|
Bootstrap::Platform::Board::Board()
|
||||||
|
|
|
@ -25,8 +25,7 @@ Bootstrap::Platform::Board::Board()
|
||||||
PL310_MMIO_SIZE }) { }
|
PL310_MMIO_SIZE }) { }
|
||||||
|
|
||||||
|
|
||||||
bool Bootstrap::Cpu::errata(Bootstrap::Cpu::Errata err) {
|
bool Bootstrap::Cpu::errata(Bootstrap::Cpu::Errata) { return false; }
|
||||||
return false; }
|
|
||||||
|
|
||||||
|
|
||||||
void Bootstrap::Cpu::wake_up_all_cpus(void * const ip)
|
void Bootstrap::Cpu::wake_up_all_cpus(void * const ip)
|
||||||
|
|
|
@ -27,8 +27,7 @@ Bootstrap::Platform::Board::Board()
|
||||||
PL310_MMIO_SIZE }) { }
|
PL310_MMIO_SIZE }) { }
|
||||||
|
|
||||||
|
|
||||||
bool Bootstrap::Cpu::errata(Bootstrap::Cpu::Errata err) {
|
bool Bootstrap::Cpu::errata(Bootstrap::Cpu::Errata) { return false; }
|
||||||
return false; }
|
|
||||||
|
|
||||||
|
|
||||||
void Bootstrap::Cpu::wake_up_all_cpus(void * const ip)
|
void Bootstrap::Cpu::wake_up_all_cpus(void * const ip)
|
||||||
|
|
|
@ -33,8 +33,7 @@ namespace Board {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename E, unsigned B, unsigned S>
|
template <typename E, unsigned B, unsigned S>
|
||||||
void Sv39::Level_x_translation_table<E, B, S>::_translation_added(addr_t addr,
|
void Sv39::Level_x_translation_table<E, B, S>::_translation_added(addr_t, size_t)
|
||||||
size_t size)
|
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
#endif /* _SRC__BOOTSTRAP__SPEC__RISCV__BOARD_H_ */
|
#endif /* _SRC__BOOTSTRAP__SPEC__RISCV__BOARD_H_ */
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
using namespace Board;
|
using namespace Board;
|
||||||
|
|
||||||
Bootstrap::Platform::Board::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()
|
unsigned Bootstrap::Platform::enable_mmu()
|
||||||
|
|
|
@ -39,8 +39,7 @@ constexpr unsigned Hw::Page_table::Descriptor_base::_device_tex() {
|
||||||
constexpr bool Hw::Page_table::Descriptor_base::_smp() { return false; }
|
constexpr bool Hw::Page_table::Descriptor_base::_smp() { return false; }
|
||||||
|
|
||||||
|
|
||||||
void Hw::Page_table::_translation_added(unsigned long addr,
|
void Hw::Page_table::_translation_added(unsigned long, unsigned long) {
|
||||||
unsigned long size) {
|
|
||||||
Bootstrap::Cpu::clean_invalidate_data_cache(); }
|
Bootstrap::Cpu::clean_invalidate_data_cache(); }
|
||||||
|
|
||||||
#endif /* _SRC__BOOTSTRAP__SPEC__RPI__BOARD_H_ */
|
#endif /* _SRC__BOOTSTRAP__SPEC__RPI__BOARD_H_ */
|
||||||
|
|
|
@ -29,5 +29,5 @@ Bootstrap::Platform::Board::Board()
|
||||||
PL310_MMIO_SIZE }) { }
|
PL310_MMIO_SIZE }) { }
|
||||||
|
|
||||||
|
|
||||||
bool Bootstrap::Cpu::errata(Bootstrap::Cpu::Errata err) {
|
bool Bootstrap::Cpu::errata(Bootstrap::Cpu::Errata) {
|
||||||
return false; }
|
return false; }
|
||||||
|
|
|
@ -26,7 +26,7 @@ using namespace Genode;
|
||||||
Region_map::Local_addr
|
Region_map::Local_addr
|
||||||
Core_region_map::attach(Dataspace_capability ds_cap, size_t size,
|
Core_region_map::attach(Dataspace_capability ds_cap, size_t size,
|
||||||
off_t offset, bool use_local_addr,
|
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 {
|
auto lambda = [&] (Dataspace_component *ds) -> Local_addr {
|
||||||
if (!ds)
|
if (!ds)
|
||||||
|
|
|
@ -28,7 +28,15 @@ namespace Genode
|
||||||
*/
|
*/
|
||||||
class Cpu_thread_allocator : public Allocator
|
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:
|
public:
|
||||||
|
|
||||||
|
@ -56,7 +64,7 @@ namespace Genode
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t overhead(size_t size) const override
|
size_t overhead(size_t) const override
|
||||||
{
|
{
|
||||||
warning(__func__, "unexpectedly called");
|
warning(__func__, "unexpectedly called");
|
||||||
while (1) ;
|
while (1) ;
|
||||||
|
|
|
@ -18,9 +18,8 @@
|
||||||
using namespace Genode;
|
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)
|
addr_t Io_mem_session_component::_map_local(addr_t base, size_t) { return base; }
|
||||||
{ return base; }
|
|
||||||
|
|
||||||
|
|
|
@ -21,22 +21,29 @@
|
||||||
|
|
||||||
#include <kernel/irq.h>
|
#include <kernel/irq.h>
|
||||||
|
|
||||||
namespace Genode {
|
namespace Genode { class Irq_session_component; }
|
||||||
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:
|
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;
|
unsigned _irq_number;
|
||||||
Range_allocator *_irq_alloc;
|
Range_allocator *_irq_alloc;
|
||||||
Genode::uint8_t _kernel_object[sizeof(Kernel::User_irq)];
|
Genode::uint8_t _kernel_object[sizeof(Kernel::User_irq)];
|
||||||
bool _is_msi;
|
bool _is_msi;
|
||||||
addr_t _address, _value;
|
addr_t _address, _value;
|
||||||
|
|
||||||
Signal_context_capability _sig_cap;
|
Signal_context_capability _sig_cap { };
|
||||||
|
|
||||||
unsigned _find_irq_number(const char * const args);
|
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
|
Info info() override
|
||||||
{
|
{
|
||||||
if (!_is_msi) {
|
if (!_is_msi)
|
||||||
return { .type = Info::Type::INVALID };
|
return { .type = Info::Type::INVALID, .address = 0, .value = 0 };
|
||||||
}
|
|
||||||
return { .type = Info::Type::MSI,
|
return { .type = Info::Type::MSI,
|
||||||
.address = _address,
|
.address = _address,
|
||||||
.value = _value };
|
.value = _value };
|
||||||
|
|
|
@ -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 */
|
/* determine handling for specific interrupt */
|
||||||
unsigned irq_id;
|
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)
|
void Cpu::schedule(Job * const job)
|
||||||
{
|
{
|
||||||
if (_id == executing_id()) { _scheduler.ready(job); }
|
if (_id == executing_id()) { _scheduler.ready(&job->share()); }
|
||||||
else if (_scheduler.ready_check(job)) { trigger_ip_interrupt(); }
|
else if (_scheduler.ready_check(&job->share())) { trigger_ip_interrupt(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,37 @@ namespace Kernel
|
||||||
Cpu_pool * cpu_pool();
|
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:
|
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); };
|
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(); }
|
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
|
class Kernel::Cpu_pool
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -34,14 +34,15 @@ namespace Kernel
|
||||||
class Cpu_domain_update;
|
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 Cpu_domain_update_list;
|
||||||
|
friend class Kernel::Double_list_typed<Cpu_domain_update>;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool _pending[NR_OF_CPUS];
|
bool _pending[NR_OF_CPUS];
|
||||||
unsigned _domain_id;
|
unsigned _domain_id = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Domain-update back-end
|
* Domain-update back-end
|
||||||
|
@ -57,6 +58,8 @@ class Kernel::Cpu_domain_update : public Double_list_item
|
||||||
|
|
||||||
Cpu_domain_update();
|
Cpu_domain_update();
|
||||||
|
|
||||||
|
virtual ~Cpu_domain_update() { };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Do an update of domain 'id' on all CPUs and return if this blocks
|
* 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;
|
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:
|
protected:
|
||||||
|
|
||||||
Cpu * _cpu;
|
Cpu * _cpu;
|
||||||
|
@ -124,7 +137,7 @@ class Kernel::Cpu_job : public Cpu_share
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
*/
|
*/
|
||||||
~Cpu_job();
|
virtual ~Cpu_job();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Link job to CPU 'cpu'
|
* Link job to CPU 'cpu'
|
||||||
|
@ -154,6 +167,8 @@ class Kernel::Cpu_job : public Cpu_share
|
||||||
***************/
|
***************/
|
||||||
|
|
||||||
void cpu(Cpu * const cpu) { _cpu = cpu; }
|
void cpu(Cpu * const cpu) { _cpu = cpu; }
|
||||||
|
|
||||||
|
Cpu_share &share() { return *this; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _CORE__KERNEL__CPU_CONTEXT_H_ */
|
#endif /* _CORE__KERNEL__CPU_CONTEXT_H_ */
|
||||||
|
|
|
@ -88,8 +88,8 @@ class Kernel::Cpu_share : public Cpu_claim, public Cpu_fill
|
||||||
signed const _prio;
|
signed const _prio;
|
||||||
unsigned _quota;
|
unsigned _quota;
|
||||||
unsigned _claim;
|
unsigned _claim;
|
||||||
unsigned _fill;
|
unsigned _fill = 0;
|
||||||
bool _ready;
|
bool _ready = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ class Kernel::Cpu_share : public Cpu_claim, public Cpu_fill
|
||||||
* \param q claimed quota
|
* \param q claimed quota
|
||||||
*/
|
*/
|
||||||
Cpu_share(signed const p, unsigned const q)
|
Cpu_share(signed const p, unsigned const q)
|
||||||
: _prio(p), _quota(q), _claim(q), _ready(0) { }
|
: _prio(p), _quota(q), _claim(q) { }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Accessors
|
* Accessors
|
||||||
|
@ -123,11 +123,11 @@ class Kernel::Cpu_scheduler
|
||||||
|
|
||||||
Claim_list _rcl[Prio::MAX + 1]; /* ready claims */
|
Claim_list _rcl[Prio::MAX + 1]; /* ready claims */
|
||||||
Claim_list _ucl[Prio::MAX + 1]; /* unready claims */
|
Claim_list _ucl[Prio::MAX + 1]; /* unready claims */
|
||||||
Fill_list _fills; /* ready fills */
|
Fill_list _fills { }; /* ready fills */
|
||||||
Share * const _idle;
|
Share * const _idle;
|
||||||
Share * _head;
|
Share * _head = nullptr;
|
||||||
unsigned _head_quota;
|
unsigned _head_quota = 0;
|
||||||
bool _head_claims;
|
bool _head_claims = false;
|
||||||
bool _head_yields;
|
bool _head_yields;
|
||||||
unsigned const _quota;
|
unsigned const _quota;
|
||||||
unsigned _residual;
|
unsigned _residual;
|
||||||
|
|
|
@ -38,8 +38,8 @@ class Kernel::Double_list_item
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Double_list_item * _next;
|
Double_list_item * _next = nullptr;
|
||||||
Double_list_item * _prev;
|
Double_list_item * _prev = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Kernel::Double_list
|
class Kernel::Double_list
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace Kernel
|
||||||
using Ipc_node_queue = Kernel::Fifo<Ipc_node>;
|
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:
|
protected:
|
||||||
|
|
||||||
|
@ -55,6 +55,8 @@ class Kernel::Ipc_node : public Ipc_node_queue::Element
|
||||||
private:
|
private:
|
||||||
|
|
||||||
friend class Core_thread;
|
friend class Core_thread;
|
||||||
|
friend class Kernel::Fifo<Ipc_node>;
|
||||||
|
friend class Genode::Fifo<Ipc_node>;
|
||||||
|
|
||||||
State _state = INACTIVE;
|
State _state = INACTIVE;
|
||||||
capid_t _capid = cap_id_invalid();
|
capid_t _capid = cap_id_invalid();
|
||||||
|
@ -63,7 +65,7 @@ class Kernel::Ipc_node : public Ipc_node_queue::Element
|
||||||
bool _help = false;
|
bool _help = false;
|
||||||
size_t _rcv_caps = 0; /* max capability num to receive */
|
size_t _rcv_caps = 0; /* max capability num to receive */
|
||||||
Genode::Native_utcb * _utcb = nullptr;
|
Genode::Native_utcb * _utcb = nullptr;
|
||||||
Ipc_node_queue _request_queue;
|
Ipc_node_queue _request_queue { };
|
||||||
|
|
||||||
/* pre-allocation array for obkject identity references */
|
/* pre-allocation array for obkject identity references */
|
||||||
void * _obj_id_ref_ptr[Genode::Msgbuf_base::MAX_CAPS_PER_MSG];
|
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:
|
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:
|
public:
|
||||||
|
|
||||||
~Ipc_node();
|
virtual ~Ipc_node();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a request and wait for the according reply
|
* Send a request and wait for the according reply
|
||||||
|
@ -200,8 +202,8 @@ class Kernel::Ipc_node : public Ipc_node_queue::Element
|
||||||
** Accessors **
|
** Accessors **
|
||||||
***************/
|
***************/
|
||||||
|
|
||||||
Pd * const pd() const { return _pd; }
|
Pd *pd() const { return _pd; }
|
||||||
Genode::Native_utcb * utcb() { return _utcb; }
|
Genode::Native_utcb *utcb() { return _utcb; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _CORE__KERNEL__IPC_NODE_H_ */
|
#endif /* _CORE__KERNEL__IPC_NODE_H_ */
|
||||||
|
|
|
@ -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:
|
public:
|
||||||
|
|
||||||
struct Pool : Genode::Avl_tree<Irq>
|
struct Pool : Genode::Avl_tree<Irq>
|
||||||
|
|
|
@ -28,7 +28,7 @@ extern "C" void kernel()
|
||||||
void Kernel::Cpu::Ipi::occurred() { }
|
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) { }
|
Kernel::Cpu::Ipi::Ipi(Kernel::Irq::Pool &p) : Kernel::Irq(Kernel::Pic::IPI, p) { }
|
||||||
|
|
|
@ -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();
|
virtual ~Object();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -83,6 +86,12 @@ class Kernel::Object_identity
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Object_identity(Object_identity const &);
|
||||||
|
Object_identity &operator = (Object_identity const &);
|
||||||
|
|
||||||
Object * _object = nullptr;
|
Object * _object = nullptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -103,6 +112,12 @@ class Kernel::Object_identity_reference
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Object_identity_reference(Object_identity_reference const &);
|
||||||
|
Object_identity_reference &operator = (Object_identity_reference const &);
|
||||||
|
|
||||||
capid_t _capid;
|
capid_t _capid;
|
||||||
Object_identity *_identity;
|
Object_identity *_identity;
|
||||||
Pd &_pd;
|
Pd &_pd;
|
||||||
|
@ -181,13 +196,16 @@ class Kernel::Core_object_identity : public Object_identity,
|
||||||
|
|
||||||
|
|
||||||
template <typename T>
|
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:
|
public:
|
||||||
|
|
||||||
template <typename... ARGS>
|
template <typename... ARGS>
|
||||||
Core_object(ARGS &&... args)
|
Core_object(ARGS &&... args)
|
||||||
: T(args...), Core_object_identity<T>(*static_cast<T*>(this)) { }
|
: 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_ */
|
#endif /* _CORE__KERNEL__OBJECT_H_ */
|
||||||
|
|
|
@ -45,14 +45,20 @@ class Kernel::Pd : public Kernel::Object
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Pd(Pd const &);
|
||||||
|
Pd &operator = (Pd const &);
|
||||||
|
|
||||||
Hw::Page_table * const _table;
|
Hw::Page_table * const _table;
|
||||||
Genode::Platform_pd * const _platform_pd;
|
Genode::Platform_pd * const _platform_pd;
|
||||||
Capid_allocator _capid_alloc;
|
Capid_allocator _capid_alloc { };
|
||||||
Object_identity_reference_tree _cap_tree;
|
Object_identity_reference_tree _cap_tree { };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Genode::Cpu::Mmu_context mmu_regs;
|
Genode::Cpu::Mmu_context mmu_regs;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
|
|
@ -50,6 +50,12 @@ class Kernel::Signal_handler
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Signal_handler(Signal_handler const &);
|
||||||
|
Signal_handler &operator = (Signal_handler const &);
|
||||||
|
|
||||||
typedef Genode::Fifo_element<Signal_handler> Fifo_element;
|
typedef Genode::Fifo_element<Signal_handler> Fifo_element;
|
||||||
|
|
||||||
Fifo_element _handlers_fe;
|
Fifo_element _handlers_fe;
|
||||||
|
@ -95,6 +101,12 @@ class Kernel::Signal_context_killer
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Signal_context_killer(Signal_context_killer const &);
|
||||||
|
Signal_context_killer &operator = (Signal_context_killer const &);
|
||||||
|
|
||||||
Signal_context * _context;
|
Signal_context * _context;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -138,6 +150,12 @@ class Kernel::Signal_context : public Kernel::Object
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Signal_context(Signal_context const &);
|
||||||
|
Signal_context &operator = (Signal_context const &);
|
||||||
|
|
||||||
typedef Genode::Fifo_element<Signal_context> Fifo_element;
|
typedef Genode::Fifo_element<Signal_context> Fifo_element;
|
||||||
|
|
||||||
Fifo_element _deliver_fe;
|
Fifo_element _deliver_fe;
|
||||||
|
@ -243,9 +261,9 @@ class Kernel::Signal_receiver : public Kernel::Object
|
||||||
|
|
||||||
template <typename T> class Fifo : public Genode::Fifo<T> { };
|
template <typename T> class Fifo : public Genode::Fifo<T> { };
|
||||||
|
|
||||||
Fifo<Signal_handler::Fifo_element> _handlers;
|
Fifo<Signal_handler::Fifo_element> _handlers { };
|
||||||
Fifo<Signal_context::Fifo_element> _deliver;
|
Fifo<Signal_context::Fifo_element> _deliver { };
|
||||||
Fifo<Signal_context::Fifo_element> _contexts;
|
Fifo<Signal_context::Fifo_element> _contexts { };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recognize that context 'c' has submits to deliver
|
* Recognize that context 'c' has submits to deliver
|
||||||
|
|
|
@ -51,6 +51,14 @@ class Kernel::Thread
|
||||||
public Ipc_node, public Signal_context_killer, public Signal_handler,
|
public Ipc_node, public Signal_context_killer, public Signal_handler,
|
||||||
private Timeout
|
private Timeout
|
||||||
{
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Thread(Thread const &);
|
||||||
|
Thread &operator = (Thread const &);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
enum { START_VERBOSE = 0 };
|
enum { START_VERBOSE = 0 };
|
||||||
|
@ -67,7 +75,7 @@ class Kernel::Thread
|
||||||
};
|
};
|
||||||
|
|
||||||
Signal_context * _pager = nullptr;
|
Signal_context * _pager = nullptr;
|
||||||
Thread_fault _fault;
|
Thread_fault _fault { };
|
||||||
State _state;
|
State _state;
|
||||||
Signal_receiver * _signal_receiver;
|
Signal_receiver * _signal_receiver;
|
||||||
char const * const _label;
|
char const * const _label;
|
||||||
|
|
|
@ -32,16 +32,17 @@ namespace Kernel
|
||||||
/**
|
/**
|
||||||
* A timeout causes a kernel pass and the call of a timeout specific handle
|
* 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 Timer;
|
||||||
|
friend class Genode::List<Timeout>;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool _listed = false;
|
bool _listed = false;
|
||||||
time_t _start;
|
time_t _start = 0;
|
||||||
time_t _end;
|
time_t _end = 0;
|
||||||
bool _end_period;
|
bool _end_period = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -36,9 +36,15 @@ class Kernel::Vm : public Cpu_job,
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Vm(Vm const &);
|
||||||
|
Vm &operator = (Vm const &);
|
||||||
|
|
||||||
enum State { ACTIVE, INACTIVE };
|
enum State { ACTIVE, INACTIVE };
|
||||||
|
|
||||||
unsigned _id;
|
unsigned _id = 0;
|
||||||
Genode::Vm_state * const _state;
|
Genode::Vm_state * const _state;
|
||||||
Signal_context * const _context;
|
Signal_context * const _context;
|
||||||
void * const _table;
|
void * const _table;
|
||||||
|
|
|
@ -22,11 +22,8 @@ void Native_pd_component::upgrade_cap_slab() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Native_pd_component::Native_pd_component(Pd_session_component &pd_session,
|
Native_pd_component::Native_pd_component(Pd_session_component &pd, char const *)
|
||||||
char const *args)
|
: _pd_session(pd) { _pd_session._ep.manage(this); }
|
||||||
: _pd_session(pd_session) {
|
|
||||||
_pd_session._ep.manage(this); }
|
|
||||||
|
|
||||||
|
|
||||||
Native_pd_component::~Native_pd_component() {
|
Native_pd_component::~Native_pd_component() { _pd_session._ep.dissolve(this); }
|
||||||
_pd_session._ep.dissolve(this); }
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ class Genode::Kernel_object
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
Untyped_capability _cap;
|
Untyped_capability _cap { };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -80,8 +80,9 @@ class Genode::Ipc_pager
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
Kernel::Thread_fault _fault;
|
Kernel::Thread_fault _fault { };
|
||||||
Mapping _mapping;
|
|
||||||
|
Mapping _mapping { };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -112,10 +113,11 @@ class Genode::Ipc_pager
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Genode::Pager_object : public Object_pool<Pager_object>::Entry,
|
class Genode::Pager_object : private Object_pool<Pager_object>::Entry,
|
||||||
public Genode::Kernel_object<Kernel::Signal_context>
|
private Genode::Kernel_object<Kernel::Signal_context>
|
||||||
{
|
{
|
||||||
friend class Pager_entrypoint;
|
friend class Pager_entrypoint;
|
||||||
|
friend class Object_pool<Pager_object>;
|
||||||
|
|
||||||
private:
|
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; }
|
Cpu_session_capability cpu_session_cap() const { return _cpu_session_cap; }
|
||||||
Thread_capability thread_cap() const { return _thread_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>,
|
class Genode::Pager_entrypoint : public Object_pool<Pager_object>,
|
||||||
public Thread_deprecated<PAGER_EP_STACK_SIZE>,
|
public Thread_deprecated<PAGER_EP_STACK_SIZE>,
|
||||||
public Kernel_object<Kernel::Signal_receiver>,
|
private Kernel_object<Kernel::Signal_receiver>,
|
||||||
public Ipc_pager
|
private Ipc_pager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -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()); }
|
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) {
|
unsigned size) {
|
||||||
return ::unmap_local(virt_addr, size / get_page_size()); }
|
return ::unmap_local(virt_addr, size / get_page_size()); }
|
||||||
|
|
|
@ -39,11 +39,11 @@ class Genode::Platform : public Genode::Platform_generic
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Core_mem_allocator _core_mem_alloc; /* core-accessible memory */
|
Core_mem_allocator _core_mem_alloc { }; /* core-accessible memory */
|
||||||
Phys_allocator _io_mem_alloc; /* MMIO allocator */
|
Phys_allocator _io_mem_alloc; /* MMIO allocator */
|
||||||
Phys_allocator _io_port_alloc; /* I/O port allocator */
|
Phys_allocator _io_port_alloc; /* I/O port allocator */
|
||||||
Phys_allocator _irq_alloc; /* IRQ allocator */
|
Phys_allocator _irq_alloc; /* IRQ allocator */
|
||||||
Rom_fs _rom_fs; /* ROM file system */
|
Rom_fs _rom_fs { }; /* ROM file system */
|
||||||
|
|
||||||
static Hw::Boot_info const & _boot_info();
|
static Hw::Boot_info const & _boot_info();
|
||||||
static Hw::Memory_region_array const & _core_virt_regions();
|
static Hw::Memory_region_array const & _core_virt_regions();
|
||||||
|
|
|
@ -149,7 +149,7 @@ Platform_pd::Platform_pd(Page_table & tt,
|
||||||
_label("core") { }
|
_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()),
|
: Hw::Address_space(*kernel_object()),
|
||||||
Kernel_object<Kernel::Pd>(true, (Page_table*)translation_table_phys(), this),
|
Kernel_object<Kernel::Pd>(true, (Page_table*)translation_table_phys(), this),
|
||||||
_label(label)
|
_label(label)
|
||||||
|
|
|
@ -60,16 +60,23 @@ class Hw::Address_space : public Genode::Address_space
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Address_space(Address_space const &);
|
||||||
|
Address_space &operator = (Address_space const &);
|
||||||
|
|
||||||
friend class Genode::Platform;
|
friend class Genode::Platform;
|
||||||
friend class Genode::Mapped_mem_allocator;
|
friend class Genode::Mapped_mem_allocator;
|
||||||
|
|
||||||
using Table = Hw::Page_table;
|
using Table = Hw::Page_table;
|
||||||
using Array = Table::Allocator::Array<DEFAULT_TRANSLATION_TABLE_MAX>;
|
using Array = Table::Allocator::Array<DEFAULT_TRANSLATION_TABLE_MAX>;
|
||||||
Genode::Lock _lock; /* table lock */
|
|
||||||
Table & _tt; /* table virt addr */
|
Genode::Lock _lock { }; /* table lock */
|
||||||
Genode::addr_t _tt_phys; /* table phys addr */
|
Table & _tt; /* table virt addr */
|
||||||
|
Genode::addr_t _tt_phys; /* table phys addr */
|
||||||
Array * _tt_array = nullptr;
|
Array * _tt_array = nullptr;
|
||||||
Table::Allocator & _tt_alloc; /* table allocator */
|
Table::Allocator & _tt_alloc; /* table allocator */
|
||||||
Kernel::Pd & _kernel_pd;
|
Kernel::Pd & _kernel_pd;
|
||||||
|
|
||||||
static inline Genode::Core_mem_allocator * _cma();
|
static inline Genode::Core_mem_allocator * _cma();
|
||||||
|
@ -77,7 +84,6 @@ class Hw::Address_space : public Genode::Address_space
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Core-specific constructor
|
* Core-specific constructor
|
||||||
*
|
*
|
||||||
|
@ -153,13 +159,19 @@ class Genode::Cap_space
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Genode::Platform_pd : public Hw::Address_space,
|
class Genode::Platform_pd : public Hw::Address_space,
|
||||||
public Genode::Cap_space,
|
private Cap_space,
|
||||||
public Kernel_object<Kernel::Pd>
|
private Kernel_object<Kernel::Pd>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Native_capability _parent;
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Platform_pd(Platform_pd const &);
|
||||||
|
Platform_pd &operator = (Platform_pd const &);
|
||||||
|
|
||||||
|
Native_capability _parent { };
|
||||||
bool _thread_associated = false;
|
bool _thread_associated = false;
|
||||||
char const * const _label;
|
char const * const _label;
|
||||||
|
|
||||||
|
@ -188,6 +200,9 @@ class Genode::Platform_pd : public Hw::Address_space,
|
||||||
*/
|
*/
|
||||||
~Platform_pd();
|
~Platform_pd();
|
||||||
|
|
||||||
|
using Cap_space::capability_slab;
|
||||||
|
using Cap_space::upgrade_slab;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bind thread 't' to protection domain
|
* Bind thread 't' to protection domain
|
||||||
*/
|
*/
|
||||||
|
@ -198,7 +213,6 @@ class Genode::Platform_pd : public Hw::Address_space,
|
||||||
*/
|
*/
|
||||||
void unbind_thread(Platform_thread *t);
|
void unbind_thread(Platform_thread *t);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assign parent interface to protection domain
|
* Assign parent interface to protection domain
|
||||||
*/
|
*/
|
||||||
|
@ -209,8 +223,8 @@ class Genode::Platform_pd : public Hw::Address_space,
|
||||||
** Accessors **
|
** Accessors **
|
||||||
***************/
|
***************/
|
||||||
|
|
||||||
char const * const label() { return _label; }
|
char const * label() { return _label; }
|
||||||
Native_capability parent() { return _parent; }
|
Native_capability parent() { return _parent; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,15 +43,21 @@ namespace Genode {
|
||||||
*/
|
*/
|
||||||
class Platform_thread : public Kernel_object<Kernel::Thread>
|
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 };
|
enum { LABEL_MAX_LEN = 32 };
|
||||||
|
|
||||||
Platform_pd * _pd;
|
Platform_pd * _pd;
|
||||||
Weak_ptr<Address_space> _address_space;
|
Weak_ptr<Address_space> _address_space { };
|
||||||
Pager_object * _pager;
|
Pager_object * _pager;
|
||||||
Native_utcb * _utcb_core_addr; /* UTCB addr in core */
|
Native_utcb * _utcb_core_addr { }; /* UTCB addr in core */
|
||||||
Native_utcb * _utcb_pd_addr; /* UTCB addr in pd */
|
Native_utcb * _utcb_pd_addr; /* UTCB addr in pd */
|
||||||
Ram_dataspace_capability _utcb; /* UTCB dataspace */
|
Ram_dataspace_capability _utcb { }; /* UTCB dataspace */
|
||||||
char _label[LABEL_MAX_LEN];
|
char _label[LABEL_MAX_LEN];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Wether this thread is the main thread of a program.
|
* Wether this thread is the main thread of a program.
|
||||||
|
@ -63,7 +69,7 @@ namespace Genode {
|
||||||
*/
|
*/
|
||||||
bool _main_thread;
|
bool _main_thread;
|
||||||
|
|
||||||
Affinity::Location _location;
|
Affinity::Location _location { };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Common construction part
|
* Common construction part
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
|
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
|
|
||||||
void Ram_dataspace_factory::_export_ram_ds(Dataspace_component *ds) { }
|
void Ram_dataspace_factory::_export_ram_ds(Dataspace_component *) { }
|
||||||
void Ram_dataspace_factory::_revoke_ram_ds(Dataspace_component *ds) { }
|
void Ram_dataspace_factory::_revoke_ram_ds(Dataspace_component *) { }
|
||||||
|
|
||||||
void Ram_dataspace_factory::_clear_ds (Dataspace_component * ds)
|
void Ram_dataspace_factory::_clear_ds (Dataspace_component * ds)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,7 +43,7 @@ class Genode::Rpc_cap_factory
|
||||||
{
|
{
|
||||||
using Identity = Kernel::Core_object_identity<Kernel::Thread>;
|
using Identity = Kernel::Core_object_identity<Kernel::Thread>;
|
||||||
|
|
||||||
Native_capability cap;
|
Native_capability cap { };
|
||||||
|
|
||||||
uint8_t data[sizeof(Identity)]
|
uint8_t data[sizeof(Identity)]
|
||||||
__attribute__((aligned(sizeof(addr_t))));
|
__attribute__((aligned(sizeof(addr_t))));
|
||||||
|
@ -53,8 +53,8 @@ class Genode::Rpc_cap_factory
|
||||||
|
|
||||||
uint8_t _initial_slab_block[get_page_size()];
|
uint8_t _initial_slab_block[get_page_size()];
|
||||||
Slab _slab;
|
Slab _slab;
|
||||||
List<Kobject> _list;
|
List<Kobject> _list { };
|
||||||
Lock _lock;
|
Lock _lock { };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -42,9 +42,9 @@ class Genode::Signal_broker
|
||||||
|
|
||||||
Allocator &_md_alloc;
|
Allocator &_md_alloc;
|
||||||
Slab<Signal_source_component> _sources_slab { &_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 };
|
Slab<Signal_context_component> _contexts_slab { &_md_alloc };
|
||||||
Signal_context_pool _contexts;
|
Signal_context_pool _contexts { };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ class Genode::Signal_broker
|
||||||
destroy(&_contexts_slab, context);
|
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
|
* This function is never called as base-hw delivers signals
|
||||||
|
|
|
@ -32,9 +32,13 @@ namespace Genode {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct Genode::Signal_context_component : Kernel_object<Kernel::Signal_context>,
|
struct Genode::Signal_context_component : private Kernel_object<Kernel::Signal_context>,
|
||||||
Signal_context_pool::Entry
|
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,
|
inline Signal_context_component(Signal_source_component &s,
|
||||||
addr_t const imprint);
|
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>,
|
struct Genode::Signal_source_component : private Kernel_object<Kernel::Signal_receiver>,
|
||||||
Signal_source_pool::Entry
|
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()
|
Signal_source_component()
|
||||||
:
|
:
|
||||||
Kernel_object<Kernel::Signal_receiver>(true),
|
Kernel_object<Kernel::Signal_receiver>(true),
|
||||||
|
|
|
@ -90,15 +90,24 @@ class Genode::Fpu
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Context(Context const &);
|
||||||
|
Context &operator = (Context const &);
|
||||||
|
|
||||||
friend class Fpu;
|
friend class Fpu;
|
||||||
|
|
||||||
/* advanced FP/SIMD - system registers */
|
struct
|
||||||
uint32_t fpscr;
|
{
|
||||||
uint32_t fpexc;
|
/* advanced FP/SIMD - system registers */
|
||||||
|
uint32_t fpscr;
|
||||||
|
uint32_t fpexc;
|
||||||
|
|
||||||
/* advanced FP/SIMD - general purpose registers d0-d15 */
|
/* advanced FP/SIMD - general purpose registers d0-d15 */
|
||||||
uint64_t d0, d1, d2, d3, d4, d5, d6, d7;
|
uint64_t d0, d1, d2, d3, d4, d5, d6, d7;
|
||||||
uint64_t d8, d9, d10, d11, d12, d13, d14, d15;
|
uint64_t d8, d9, d10, d11, d12, d13, d14, d15;
|
||||||
|
};
|
||||||
|
|
||||||
Fpu * _fpu = nullptr;
|
Fpu * _fpu = nullptr;
|
||||||
|
|
||||||
|
|
|
@ -24,9 +24,8 @@ void Platform::setup_irq_mode(unsigned, unsigned, unsigned) { }
|
||||||
|
|
||||||
long Platform::irq(long const user_irq) { return user_irq; }
|
long Platform::irq(long const user_irq) { return user_irq; }
|
||||||
|
|
||||||
|
bool Platform::get_msi_params(const addr_t /* mmconf */, addr_t & /* address */,
|
||||||
bool Platform::get_msi_params(const addr_t mmconf, addr_t &address,
|
addr_t & /* data */, unsigned & /* irq_number */)
|
||||||
addr_t &data, unsigned &irq_number)
|
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ using namespace Kernel;
|
||||||
|
|
||||||
Kernel::Vm::Vm(void * const state,
|
Kernel::Vm::Vm(void * const state,
|
||||||
Kernel::Signal_context * const context,
|
Kernel::Signal_context * const context,
|
||||||
void * const table)
|
void * const /* table */)
|
||||||
: Cpu_job(Cpu_priority::MIN, 0),
|
: Cpu_job(Cpu_priority::MIN, 0),
|
||||||
_state((Genode::Vm_state * const)state),
|
_state((Genode::Vm_state * const)state),
|
||||||
_context(context), _table(0) {
|
_context(context), _table(0) {
|
||||||
|
|
|
@ -29,17 +29,22 @@ namespace Genode {
|
||||||
class Vm_session_component;
|
class Vm_session_component;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Genode::Vm_session_component
|
class Genode::Vm_session_component : public Genode::Rpc_object<Genode::Vm_session>,
|
||||||
: public Genode::Rpc_object<Genode::Vm_session>,
|
private Kernel_object<Kernel::Vm>
|
||||||
public Kernel_object<Kernel::Vm>
|
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Noncopyable
|
||||||
|
*/
|
||||||
|
Vm_session_component(Vm_session_component const &);
|
||||||
|
Vm_session_component &operator = (Vm_session_component const &);
|
||||||
|
|
||||||
Rpc_entrypoint *_ds_ep;
|
Rpc_entrypoint *_ds_ep;
|
||||||
Range_allocator *_ram_alloc;
|
Range_allocator *_ram_alloc = nullptr;
|
||||||
Dataspace_component _ds;
|
Dataspace_component _ds;
|
||||||
Dataspace_capability _ds_cap;
|
Dataspace_capability _ds_cap;
|
||||||
addr_t _ds_addr;
|
addr_t _ds_addr = 0;
|
||||||
|
|
||||||
static size_t _ds_size() {
|
static size_t _ds_size() {
|
||||||
return align_addr(sizeof(Cpu_state_modes),
|
return align_addr(sizeof(Cpu_state_modes),
|
||||||
|
@ -63,13 +68,13 @@ class Genode::Vm_session_component
|
||||||
void run(void);
|
void run(void);
|
||||||
void pause(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"); }
|
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"); }
|
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"); }
|
warning("Not implemented for TrustZone case"); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,10 @@ struct Host_context {
|
||||||
|
|
||||||
struct Kernel::Vm_irq : Kernel::Irq
|
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
|
* A VM interrupt gets injected into the VM scheduled on the current CPU
|
||||||
|
|
|
@ -31,20 +31,25 @@ namespace Genode {
|
||||||
class Vm_session_component;
|
class Vm_session_component;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Genode::Vm_session_component
|
class Genode::Vm_session_component : public Genode::Rpc_object<Genode::Vm_session>,
|
||||||
: public Genode::Rpc_object<Genode::Vm_session>,
|
private Kernel_object<Kernel::Vm>
|
||||||
public Kernel_object<Kernel::Vm>
|
|
||||||
{
|
{
|
||||||
private:
|
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 Table = Hw::Level_1_stage_2_translation_table;
|
||||||
using Array = Table::Allocator::Array<Kernel::DEFAULT_TRANSLATION_TABLE_MAX>;
|
using Array = Table::Allocator::Array<Kernel::DEFAULT_TRANSLATION_TABLE_MAX>;
|
||||||
|
|
||||||
Rpc_entrypoint *_ds_ep;
|
Rpc_entrypoint *_ds_ep;
|
||||||
Range_allocator *_ram_alloc;
|
Range_allocator *_ram_alloc = nullptr;
|
||||||
Dataspace_component _ds;
|
Dataspace_component _ds;
|
||||||
Dataspace_capability _ds_cap;
|
Dataspace_capability _ds_cap;
|
||||||
addr_t _ds_addr;
|
addr_t _ds_addr = 0;
|
||||||
Table &_table;
|
Table &_table;
|
||||||
Array &_table_array;
|
Array &_table_array;
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ class Genode::Cpu : public Arm_v7_cpu
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
Fpu _fpu;
|
Fpu _fpu { };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -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.addr = Genode::Cpu::Sbadaddr::read();
|
||||||
f.type = Kernel::Thread_fault::PAGE_MISSING;
|
f.type = Kernel::Thread_fault::PAGE_MISSING;
|
||||||
|
|
|
@ -49,7 +49,7 @@ class Genode::Cpu : public Hw::Riscv_cpu
|
||||||
|
|
||||||
struct Mmu_context
|
struct Mmu_context
|
||||||
{
|
{
|
||||||
Sptbr::access_t sptbr;
|
Sptbr::access_t sptbr = 0;
|
||||||
|
|
||||||
Mmu_context(addr_t page_table_base);
|
Mmu_context(addr_t page_table_base);
|
||||||
~Mmu_context();
|
~Mmu_context();
|
||||||
|
@ -75,7 +75,7 @@ class Genode::Cpu : public Hw::Riscv_cpu
|
||||||
asm volatile ("sfence.vm\n");
|
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);
|
void switch_to(Mmu_context & context);
|
||||||
static void mmu_fault(Context & c, Kernel::Thread_fault & f);
|
static void mmu_fault(Context & c, Kernel::Thread_fault & f);
|
||||||
|
|
|
@ -15,5 +15,5 @@
|
||||||
#include <kernel/cpu.h>
|
#include <kernel/cpu.h>
|
||||||
#include <hw/memory_map.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); }
|
Stvec::write(Hw::Mm::supervisor_exception_vector().base); }
|
||||||
|
|
|
@ -36,8 +36,8 @@ class Genode::Pic
|
||||||
|
|
||||||
Pic() { }
|
Pic() { }
|
||||||
bool take_request(unsigned & i) { i = 0; return true; }
|
bool take_request(unsigned & i) { i = 0; return true; }
|
||||||
void unmask(unsigned const i, unsigned) { }
|
void unmask(unsigned, unsigned) { }
|
||||||
void mask(unsigned const i) { }
|
void mask(unsigned) { }
|
||||||
void finish_request() { }
|
void finish_request() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@ void Platform::_init_additional() { }
|
||||||
|
|
||||||
void Platform::setup_irq_mode(unsigned, unsigned, unsigned) { }
|
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,
|
bool Platform::get_msi_params(addr_t /* mmconf */, addr_t & /* address */,
|
||||||
addr_t &data, unsigned &irq_number) {
|
addr_t & /* data */, unsigned & /* irq_number */) {
|
||||||
return false; }
|
return false; }
|
||||||
|
|
|
@ -18,8 +18,9 @@
|
||||||
#include <cpu.h>
|
#include <cpu.h>
|
||||||
|
|
||||||
template <typename E, unsigned B, unsigned S>
|
template <typename E, unsigned B, unsigned S>
|
||||||
void Sv39::Level_x_translation_table<E, B, S>::_translation_added(addr_t addr,
|
void Sv39::Level_x_translation_table<E, B, S>::_translation_added(addr_t, size_t)
|
||||||
size_t size) {
|
{
|
||||||
Genode::Cpu::sfence(); }
|
Genode::Cpu::sfence();
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* _CORE__SPEC__RISCV__TRANSLATION_TABLE_H_ */
|
#endif /* _CORE__SPEC__RISCV__TRANSLATION_TABLE_H_ */
|
||||||
|
|
|
@ -107,7 +107,7 @@ class Genode::Pic : Mmio
|
||||||
struct Irq_disable_gpu_2 : Register<0x20, 32> { };
|
struct Irq_disable_gpu_2 : Register<0x20, 32> { };
|
||||||
struct Irq_disable_basic : Register<0x24, 32> { };
|
struct Irq_disable_basic : Register<0x24, 32> { };
|
||||||
|
|
||||||
Usb_dwc_otg _usb;
|
Usb_dwc_otg _usb { };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if specified interrupt is pending
|
* Return true if specified interrupt is pending
|
||||||
|
|
|
@ -43,7 +43,7 @@ class Genode::Cpu : public Hw::X86_64_cpu
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
Fpu _fpu;
|
Fpu _fpu { };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ class Genode::Cpu : public Hw::X86_64_cpu
|
||||||
uint64_t reserved2;
|
uint64_t reserved2;
|
||||||
|
|
||||||
static void init();
|
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];
|
uint64_t tss_desc[2];
|
||||||
|
|
||||||
void init(addr_t tss_addr);
|
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);
|
static void mmu_fault(Context & regs, Kernel::Thread_fault & fault);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* _CORE__SPEC__X86_64__CPU_H_ */
|
#endif /* _CORE__SPEC__X86_64__CPU_H_ */
|
||||||
|
|
|
@ -66,4 +66,4 @@ void Kernel::Vm::proceed(Cpu & cpu)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Kernel::Vm::inject_irq(unsigned irq) { }
|
void Kernel::Vm::inject_irq(unsigned) { }
|
||||||
|
|
|
@ -58,8 +58,8 @@ class Genode::Pic
|
||||||
*/
|
*/
|
||||||
Pic() { }
|
Pic() { }
|
||||||
void finish_request() { }
|
void finish_request() { }
|
||||||
void unmask(unsigned const i, unsigned) { }
|
void unmask(unsigned const, unsigned) { }
|
||||||
void mask(unsigned const i) { }
|
void mask(unsigned const) { }
|
||||||
bool is_ip_interrupt(unsigned, unsigned) { return false; }
|
bool is_ip_interrupt(unsigned, unsigned) { return false; }
|
||||||
void trigger_ip_interrupt(unsigned) { }
|
void trigger_ip_interrupt(unsigned) { }
|
||||||
|
|
||||||
|
|
|
@ -31,14 +31,15 @@ namespace Genode {
|
||||||
|
|
||||||
class Genode::Vm_session_component
|
class Genode::Vm_session_component
|
||||||
: public Genode::Rpc_object<Genode::Vm_session>,
|
: public Genode::Rpc_object<Genode::Vm_session>,
|
||||||
public Kernel_object<Kernel::Vm>
|
private Kernel_object<Kernel::Vm>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Vm_state _state;
|
Vm_state _state;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Vm_session_component(Rpc_entrypoint*, size_t) { }
|
Vm_session_component(Rpc_entrypoint*, size_t) : _state() { }
|
||||||
~Vm_session_component() { }
|
~Vm_session_component() { }
|
||||||
|
|
||||||
|
|
||||||
|
@ -67,9 +68,9 @@ class Genode::Vm_session_component
|
||||||
Kernel::pause_vm(kernel_object());
|
Kernel::pause_vm(kernel_object());
|
||||||
}
|
}
|
||||||
|
|
||||||
void attach(Dataspace_capability ds_cap, addr_t vm_addr) {}
|
void attach(Dataspace_capability, addr_t) {}
|
||||||
void attach_pic(addr_t vm_addr) {}
|
void attach_pic(addr_t) {}
|
||||||
void detach(addr_t vm_addr, size_t size) {}
|
void detach(addr_t, size_t) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _CORE__SPEC__X86_64__MUEN__VM_SESSION_COMPONENT_H_ */
|
#endif /* _CORE__SPEC__X86_64__MUEN__VM_SESSION_COMPONENT_H_ */
|
||||||
|
|
|
@ -54,7 +54,7 @@ class Genode::Ioapic : public Mmio
|
||||||
enum { REMAP_BASE = Board::VECTOR_REMAP_BASE };
|
enum { REMAP_BASE = Board::VECTOR_REMAP_BASE };
|
||||||
|
|
||||||
/* Number of Redirection Table entries */
|
/* Number of Redirection Table entries */
|
||||||
unsigned _irte_count;
|
unsigned _irte_count = 0;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
/* Register selectors */
|
/* Register selectors */
|
||||||
|
@ -180,7 +180,7 @@ class Genode::Pic : public Mmio
|
||||||
*/
|
*/
|
||||||
Pic();
|
Pic();
|
||||||
|
|
||||||
Ioapic ioapic;
|
Ioapic ioapic { };
|
||||||
|
|
||||||
bool take_request(unsigned &irq);
|
bool take_request(unsigned &irq);
|
||||||
|
|
||||||
|
|
|
@ -99,8 +99,7 @@ void Platform::setup_irq_mode(unsigned irq_number, unsigned trigger,
|
||||||
Kernel::pic()->ioapic.setup_irq_mode(irq_number, trigger, polarity); }
|
Kernel::pic()->ioapic.setup_irq_mode(irq_number, trigger, polarity); }
|
||||||
|
|
||||||
|
|
||||||
bool Platform::get_msi_params(const addr_t mmconf, addr_t &address,
|
bool Platform::get_msi_params(addr_t, addr_t &, addr_t &, unsigned &) {
|
||||||
addr_t &data, unsigned &irq_number) {
|
|
||||||
return false; }
|
return false; }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace Genode
|
||||||
/**
|
/**
|
||||||
* Select source used for map operations
|
* 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
|
* Return highest supported flexpage size for the given mapping size
|
||||||
|
|
|
@ -43,7 +43,7 @@ native_thread_id(Genode::Thread * const t)
|
||||||
/**
|
/**
|
||||||
* Yield execution time-slice of current thread to thread 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();
|
Kernel::yield_thread();
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue