mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-09 04:15:52 +00:00
base: avoid implicit conversions
This patch is a prerequisite for compiling the code with the warnings -Wconversion enabled. Issue #23
This commit is contained in:
parent
c79a59655d
commit
03047009b1
@ -6,6 +6,9 @@ FIASCO_SRC = $(L4_SRC_DIR)/kernel/fiasco
|
||||
|
||||
KERNEL_BUILD_OUTPUT_FILTER = 2>&1 | sed "s/^/ [fiasco] /"
|
||||
|
||||
KERNEL_CXXFLAGS = -std=gnu++98 -fno-delete-null-pointer-checks $(CXXWARN) \
|
||||
-Wno-address-of-packed-member
|
||||
|
||||
$(FIASCO_BUILD_DIR):
|
||||
$(VERBOSE_MK) set -o pipefail; \
|
||||
MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
|
||||
@ -21,7 +24,7 @@ $(FIASCO_BUILD_DIR):
|
||||
$(FIASCO): $(FIASCO_BUILD_DIR)
|
||||
$(VERBOSE_MK) set -o pipefail; \
|
||||
MAKEFLAGS= CFLAGS="-std=gnu89 $(CWARN)" \
|
||||
CXXFLAGS="-std=gnu++98 -fno-delete-null-pointer-checks $(CXXWARN)" \
|
||||
CXXFLAGS="$(KERNEL_CXXFLAGS)" \
|
||||
$(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
|
||||
$(VERBOSE_DIR) -C $(FIASCO_BUILD_DIR) \
|
||||
$(KERNEL_BUILD_OUTPUT_FILTER)
|
||||
|
@ -46,6 +46,7 @@ class Genode::Platform_pd : public Address_space
|
||||
|
||||
enum {
|
||||
VERSION_BITS = 10,
|
||||
VERSION_MASK = (1 << VERSION_BITS) - 1,
|
||||
PD_FIRST = 0x10,
|
||||
PD_MAX = (1 << 11) - 1, /* leave 0x7ff free for L4_INVALID_ID */
|
||||
PD_VERSION_MAX = (1 << 10) - 1,
|
||||
@ -101,7 +102,7 @@ class Genode::Platform_pd : public Address_space
|
||||
unsigned version : VERSION_BITS;
|
||||
|
||||
Pd_alloc(bool r, bool f, unsigned v)
|
||||
: reserved(r), free(f), version(v) { }
|
||||
: reserved(r), free(f), version(v & VERSION_MASK) { }
|
||||
|
||||
Pd_alloc() : reserved(0), free(0), version(0) { }
|
||||
};
|
||||
|
@ -58,10 +58,13 @@ void Platform_pd::init()
|
||||
|
||||
void Platform_pd::_create_pd(bool syscall)
|
||||
{
|
||||
enum { TASK_ID_MASK = (1 << 11) - 1,
|
||||
VERSION_LOW_MASK = (1 << 10) - 1 };
|
||||
|
||||
l4_threadid_t l4t = l4_myself();
|
||||
l4t.id.task = _pd_id;
|
||||
l4t.id.task = _pd_id & TASK_ID_MASK;
|
||||
l4t.id.lthread = 0;
|
||||
l4t.id.version_low = _version;
|
||||
l4t.id.version_low = _version & VERSION_LOW_MASK;
|
||||
|
||||
l4_taskid_t nt;
|
||||
if (syscall)
|
||||
@ -203,8 +206,10 @@ bool Platform_pd::bind_thread(Platform_thread &thread)
|
||||
}
|
||||
thread_id = t;
|
||||
|
||||
enum { LTHREAD_MASK = (1 << 7) - 1 };
|
||||
|
||||
l4_thread_id = _l4_task_id;
|
||||
l4_thread_id.id.lthread = thread_id;
|
||||
l4_thread_id.id.lthread = thread_id & LTHREAD_MASK;
|
||||
|
||||
/* finally inform thread about binding */
|
||||
thread.bind(thread_id, l4_thread_id, *this);
|
||||
|
@ -15,6 +15,10 @@
|
||||
#define _INCLUDE__FIASCO__SYSCALL_H_
|
||||
|
||||
namespace Fiasco {
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wconversion"
|
||||
|
||||
#include <l4/sys/types.h>
|
||||
#include <l4/sys/kdebug.h>
|
||||
#include <l4/sys/ipc.h>
|
||||
@ -24,6 +28,8 @@ namespace Fiasco {
|
||||
#include <l4/sys/ktrace.h>
|
||||
#include <l4/sys/syscalls.h>
|
||||
#include <l4/sigma0/sigma0.h>
|
||||
|
||||
#pragma GCC diagnostic pop /* restore -Wconversion warnings */
|
||||
}
|
||||
|
||||
#endif /* _INCLUDE__FIASCO__SYSCALL_H_ */
|
||||
|
@ -32,9 +32,9 @@ class Msg_header
|
||||
private:
|
||||
|
||||
/* kernel-defined message header */
|
||||
l4_fpage_t rcv_fpage; /* unused */
|
||||
l4_msgdope_t size_dope;
|
||||
l4_msgdope_t send_dope;
|
||||
l4_fpage_t _rcv_fpage; /* unused */
|
||||
l4_msgdope_t _size_dope;
|
||||
l4_msgdope_t _send_dope;
|
||||
|
||||
public:
|
||||
|
||||
@ -52,6 +52,8 @@ class Msg_header
|
||||
|
||||
enum { MAX_CAPS_PER_MSG = Msgbuf_base::MAX_CAPS_PER_MSG };
|
||||
|
||||
enum { SIZE_DOPE_MASK = 0x3ffff };
|
||||
|
||||
l4_threadid_t _cap_tid [MAX_CAPS_PER_MSG];
|
||||
unsigned long _cap_local_name [MAX_CAPS_PER_MSG];
|
||||
|
||||
@ -68,7 +70,7 @@ class Msg_header
|
||||
|
||||
public:
|
||||
|
||||
void *msg_start() { return &rcv_fpage; }
|
||||
void *msg_start() { return &_rcv_fpage; }
|
||||
|
||||
/**
|
||||
* Load header fields according to send-message buffer
|
||||
@ -79,7 +81,8 @@ class Msg_header
|
||||
num_caps = min((unsigned)MAX_CAPS_PER_MSG, snd_msg.used_caps());
|
||||
|
||||
size_t const snd_words = snd_msg.data_size()/sizeof(l4_umword_t);
|
||||
send_dope = L4_IPC_DOPE(_num_msg_words(snd_words), 0);
|
||||
|
||||
_send_dope = L4_IPC_DOPE(_num_msg_words(snd_words) & SIZE_DOPE_MASK, 0);
|
||||
|
||||
/* reset _cap_tid and _cap_local_name */
|
||||
for (unsigned i = 0; i < MAX_CAPS_PER_MSG; i++) {
|
||||
@ -107,7 +110,7 @@ class Msg_header
|
||||
{
|
||||
size_t const rcv_max_words = rcv_msg.capacity()/sizeof(l4_umword_t);
|
||||
|
||||
size_dope = L4_IPC_DOPE(_num_msg_words(rcv_max_words), 0);
|
||||
_size_dope = L4_IPC_DOPE(_num_msg_words(rcv_max_words) & SIZE_DOPE_MASK, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -14,6 +14,9 @@
|
||||
#ifndef _INCLUDE__FOC__SYSCALL_H_
|
||||
#define _INCLUDE__FOC__SYSCALL_H_
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wconversion"
|
||||
|
||||
namespace Foc {
|
||||
#include <l4/sys/types.h>
|
||||
#include <l4/sys/kip>
|
||||
@ -33,4 +36,6 @@ namespace Foc {
|
||||
#include <l4/sigma0/sigma0.h>
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop /* restore -Wconversion warnings */
|
||||
|
||||
#endif /* _INCLUDE__FOC__SYSCALL_H_ */
|
||||
|
@ -26,7 +26,7 @@ namespace Genode { struct Foc_thread_state; }
|
||||
struct Genode::Foc_thread_state : Thread_state
|
||||
{
|
||||
Foc::l4_cap_idx_t kcap; /* thread's gate cap in its PD */
|
||||
int id; /* ID of gate capability */
|
||||
uint16_t id; /* ID of gate capability */
|
||||
addr_t utcb; /* thread's UTCB in its PD */
|
||||
|
||||
/**
|
||||
|
@ -25,6 +25,12 @@ namespace Genode { class Cap_id_allocator; }
|
||||
|
||||
class Genode::Cap_id_allocator
|
||||
{
|
||||
public:
|
||||
|
||||
using id_t = uint16_t;
|
||||
|
||||
enum { ID_MASK = 0xffff };
|
||||
|
||||
private:
|
||||
|
||||
enum {
|
||||
@ -44,8 +50,8 @@ class Genode::Cap_id_allocator
|
||||
|
||||
Cap_id_allocator(Allocator &);
|
||||
|
||||
unsigned long alloc();
|
||||
void free(unsigned long id);
|
||||
id_t alloc();
|
||||
void free(id_t id);
|
||||
};
|
||||
|
||||
#endif /* _CORE__INCLUDE__CAP_ID_ALLOC_H_ */
|
||||
|
@ -38,7 +38,7 @@ class Genode::Irq_object
|
||||
Irq_session::Polarity _polarity; /* interrupt polarity */
|
||||
|
||||
unsigned _irq;
|
||||
addr_t _msi_addr;
|
||||
uint64_t _msi_addr;
|
||||
addr_t _msi_data;
|
||||
|
||||
Signal_context_capability _sig_cap { };
|
||||
@ -53,8 +53,8 @@ class Genode::Irq_object
|
||||
Irq_session::Trigger trigger() const { return _trigger; }
|
||||
Irq_session::Polarity polarity() const { return _polarity; }
|
||||
|
||||
Genode::addr_t msi_address() const { return _msi_addr; }
|
||||
Genode::addr_t msi_value() const { return _msi_data; }
|
||||
uint64_t msi_address() const { return _msi_addr; }
|
||||
addr_t msi_value() const { return _msi_data; }
|
||||
|
||||
void sigh(Genode::Signal_context_capability cap) { _sig_cap = cap; }
|
||||
void notify() { Genode::Signal_transmitter(_sig_cap).submit(1); }
|
||||
|
@ -45,7 +45,7 @@ namespace Genode {
|
||||
using namespace Foc;
|
||||
|
||||
l4_fpage_t snd_fpage = l4_fpage(from_addr + offset,
|
||||
page_size_log2, L4_FPAGE_RW);
|
||||
(unsigned)page_size_log2, L4_FPAGE_RW);
|
||||
|
||||
if (l4_msgtag_has_error(l4_task_map(L4_BASE_TASK_CAP,
|
||||
L4_BASE_TASK_CAP,
|
||||
@ -95,13 +95,13 @@ namespace Genode {
|
||||
if (can_use_super_page(from_addr + offset, size))
|
||||
page_size_log2 = get_super_page_size_log2();
|
||||
l4_utcb_mr()->mr[1] = l4_fpage(from_addr + offset,
|
||||
page_size_log2, L4_FPAGE_RWX).raw;
|
||||
(unsigned)page_size_log2, L4_FPAGE_RWX).raw;
|
||||
|
||||
/* open receive window for mapping */
|
||||
l4_utcb_br()->bdr = 0;
|
||||
l4_utcb_br()->br[0] = L4_ITEM_MAP;
|
||||
l4_utcb_br()->br[1] = l4_fpage((addr_t)to_addr + offset,
|
||||
page_size_log2, L4_FPAGE_RWX).raw;
|
||||
(unsigned)page_size_log2, L4_FPAGE_RWX).raw;
|
||||
|
||||
l4_msgtag_t tag = l4_msgtag(L4_PROTO_SIGMA0, 2, 0, 0);
|
||||
tag = l4_ipc_call(L4_BASE_PAGER_CAP, l4_utcb(), tag, L4_IPC_NEVER);
|
||||
|
@ -34,7 +34,7 @@ addr_t Io_mem_session_component::_map_local(addr_t base, size_t size)
|
||||
: get_page_size_log2();
|
||||
|
||||
/* find appropriate region for mapping */
|
||||
return platform().region_alloc().alloc_aligned(size, alignment).convert<addr_t>(
|
||||
return platform().region_alloc().alloc_aligned(size, (unsigned)alignment).convert<addr_t>(
|
||||
|
||||
[&] (void *local_base) {
|
||||
if (!map_local_io(base, (addr_t)local_base, size >> get_page_size_log2())) {
|
||||
|
@ -86,7 +86,7 @@ void Ipc_pager::wait_for_fault()
|
||||
|
||||
do {
|
||||
_tag = l4_ipc_wait(l4_utcb(), &label, L4_IPC_NEVER);
|
||||
int err = l4_ipc_error(_tag, l4_utcb());
|
||||
l4_umword_t err = l4_ipc_error(_tag, l4_utcb());
|
||||
if (!err) {
|
||||
_parse(label);
|
||||
return;
|
||||
@ -121,7 +121,7 @@ void Ipc_pager::reply_and_wait_for_fault()
|
||||
};
|
||||
|
||||
l4_fpage_t const fpage = l4_fpage(_reply_mapping.src_addr,
|
||||
_reply_mapping.size_log2,
|
||||
(unsigned)_reply_mapping.size_log2,
|
||||
rights(_reply_mapping.writeable,
|
||||
_reply_mapping.executable));
|
||||
|
||||
@ -129,7 +129,7 @@ void Ipc_pager::reply_and_wait_for_fault()
|
||||
|
||||
_tag = l4_ipc_send_and_wait(_last.kcap, l4_utcb(), snd_tag,
|
||||
&label, L4_IPC_SEND_TIMEOUT_0);
|
||||
int const err = l4_ipc_error(_tag, l4_utcb());
|
||||
l4_umword_t const err = l4_ipc_error(_tag, l4_utcb());
|
||||
if (err) {
|
||||
error("Ipc error ", err, " in pagefault from ", Hex(label & ~0x3));
|
||||
wait_for_fault();
|
||||
|
@ -139,7 +139,7 @@ void Irq_object::ack_irq()
|
||||
{
|
||||
using namespace Foc;
|
||||
|
||||
int err;
|
||||
l4_umword_t err;
|
||||
l4_msgtag_t tag = l4_irq_unmask(_capability());
|
||||
if ((err = l4_ipc_error(tag, l4_utcb())))
|
||||
error("IRQ unmask: ", err);
|
||||
@ -148,7 +148,7 @@ void Irq_object::ack_irq()
|
||||
|
||||
Irq_object::Irq_object()
|
||||
:
|
||||
_cap(cap_map().insert(platform_specific().cap_id_alloc().alloc())),
|
||||
_cap(cap_map().insert((Cap_index::id_t)platform_specific().cap_id_alloc().alloc())),
|
||||
_trigger(Irq_session::TRIGGER_UNCHANGED),
|
||||
_polarity(Irq_session::POLARITY_UNCHANGED),
|
||||
_irq(~0U), _msi_addr(0), _msi_data(0)
|
||||
@ -170,7 +170,7 @@ Irq_object::~Irq_object()
|
||||
if (l4_error(l4_irq_detach(_capability())))
|
||||
error("cannot detach IRQ");
|
||||
|
||||
if (l4_error(l4_icu_unbind(L4_BASE_ICU_CAP, irq, _capability())))
|
||||
if (l4_error(l4_icu_unbind(L4_BASE_ICU_CAP, (unsigned)irq, _capability())))
|
||||
error("cannot unbind IRQ");
|
||||
|
||||
cap_map().remove(_cap);
|
||||
@ -184,7 +184,7 @@ Irq_object::~Irq_object()
|
||||
Irq_session_component::Irq_session_component(Range_allocator &irq_alloc,
|
||||
const char *args)
|
||||
:
|
||||
_irq_number(Arg_string::find_arg(args, "irq_number").long_value(-1)),
|
||||
_irq_number((unsigned)Arg_string::find_arg(args, "irq_number").long_value(-1)),
|
||||
_irq_alloc(irq_alloc), _irq_object()
|
||||
{
|
||||
long const msi = Arg_string::find_arg(args, "device_config_phys").long_value(0);
|
||||
@ -252,7 +252,7 @@ Irq_session::Info Irq_session_component::info()
|
||||
|
||||
return {
|
||||
.type = Genode::Irq_session::Info::Type::MSI,
|
||||
.address = _irq_object.msi_address(),
|
||||
.address = (addr_t)_irq_object.msi_address(),
|
||||
.value = _irq_object.msi_value()
|
||||
};
|
||||
}
|
||||
@ -269,7 +269,7 @@ void Interrupt_handler::entry()
|
||||
{
|
||||
using namespace Foc;
|
||||
|
||||
int err;
|
||||
l4_umword_t err;
|
||||
l4_msgtag_t tag;
|
||||
l4_umword_t label;
|
||||
|
||||
|
@ -293,14 +293,14 @@ void Platform::_setup_mem_alloc()
|
||||
for ( ; beg < end; beg += L4_PAGESIZE) (void)(*beg);
|
||||
|
||||
/* request pages of known page size starting with largest */
|
||||
size_t const log2_sizes[] = { L4_LOG2_SUPERPAGESIZE, L4_LOG2_PAGESIZE };
|
||||
unsigned const log2_sizes[] = { L4_LOG2_SUPERPAGESIZE, L4_LOG2_PAGESIZE };
|
||||
|
||||
for (unsigned i = 0; i < sizeof(log2_sizes)/sizeof(*log2_sizes); ++i) {
|
||||
size_t const log2_size = log2_sizes[i];
|
||||
size_t const size = 1UL << log2_size;
|
||||
unsigned const log2_size = log2_sizes[i];
|
||||
size_t const size = 1UL << log2_size;
|
||||
|
||||
int err = 0;
|
||||
addr_t addr = 0;
|
||||
Foc::l4_umword_t err = 0;
|
||||
addr_t addr = 0;
|
||||
Region region;
|
||||
|
||||
/* request any page of current size from sigma0 */
|
||||
|
@ -122,12 +122,13 @@ void Platform_pd::flush(addr_t, size_t size, Core_local_addr core_local)
|
||||
|
||||
static Native_capability debug_cap()
|
||||
{
|
||||
unsigned long const id = platform_specific().cap_id_alloc().alloc();
|
||||
Cap_index::id_t const id = platform_specific().cap_id_alloc().alloc();
|
||||
static Cap_index * idx = cap_map().insert(id, DEBUG_CAP);
|
||||
static Native_capability debug_cap(reinterpret_cast<Core_cap_index*>(idx));
|
||||
return debug_cap;
|
||||
}
|
||||
|
||||
|
||||
Platform_pd::Platform_pd(Core_cap_index &ci)
|
||||
:
|
||||
_task(Native_capability(&ci), TASK_CAP)
|
||||
|
@ -211,7 +211,7 @@ Foc_thread_state Platform_thread::state()
|
||||
s = _pager_obj->state.state;
|
||||
|
||||
s.kcap = _gate.remote;
|
||||
s.id = _gate.local.local_name();
|
||||
s.id = (uint16_t)_gate.local.local_name();
|
||||
s.utcb = _utcb;
|
||||
|
||||
return s;
|
||||
|
@ -49,7 +49,7 @@ Cap_index_allocator &Genode::cap_idx_alloc()
|
||||
|
||||
Core_cap_index *Cap_mapping::_get_cap()
|
||||
{
|
||||
int const id = platform_specific().cap_id_alloc().alloc();
|
||||
Cap_index::id_t const id = platform_specific().cap_id_alloc().alloc();
|
||||
return static_cast<Core_cap_index*>(cap_map().insert(id));
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ Native_capability Rpc_cap_factory::alloc(Native_capability ep)
|
||||
/*
|
||||
* Allocate new id, and ipc-gate and set id as gate-label
|
||||
*/
|
||||
unsigned long const id = platform_specific().cap_id_alloc().alloc();
|
||||
Cap_index::id_t const id = platform_specific().cap_id_alloc().alloc();
|
||||
Core_cap_index *idx = static_cast<Core_cap_index*>(cap_map().insert(id));
|
||||
|
||||
if (!idx) {
|
||||
@ -194,17 +194,21 @@ Cap_id_allocator::Cap_id_allocator(Allocator &alloc)
|
||||
}
|
||||
|
||||
|
||||
unsigned long Cap_id_allocator::alloc()
|
||||
Cap_id_allocator::id_t Cap_id_allocator::alloc()
|
||||
{
|
||||
Mutex::Guard lock_guard(_mutex);
|
||||
|
||||
return _id_alloc.try_alloc(CAP_ID_OFFSET).convert<unsigned long>(
|
||||
[&] (void *id) { return (unsigned long)id; },
|
||||
[&] (Range_allocator::Alloc_error) -> unsigned long { throw Out_of_ids(); });
|
||||
return _id_alloc.try_alloc(CAP_ID_OFFSET).convert<id_t>(
|
||||
|
||||
[&] (void *id) -> id_t {
|
||||
return (addr_t)id & ID_MASK; },
|
||||
|
||||
[&] (Range_allocator::Alloc_error) -> id_t {
|
||||
throw Out_of_ids(); });
|
||||
}
|
||||
|
||||
|
||||
void Cap_id_allocator::free(unsigned long id)
|
||||
void Cap_id_allocator::free(id_t id)
|
||||
{
|
||||
Mutex::Guard lock_guard(_mutex);
|
||||
|
||||
|
@ -41,7 +41,7 @@ void Signal_source_component::submit(Signal_context_component &context,
|
||||
unsigned long cnt)
|
||||
{
|
||||
/* enqueue signal to context */
|
||||
context.increment_signal_cnt(cnt);
|
||||
context.increment_signal_cnt((int)cnt);
|
||||
|
||||
if (!context.enqueued()) {
|
||||
_signal_queue.enqueue(context);
|
||||
|
@ -49,7 +49,7 @@ Vcpu::Vcpu(Rpc_entrypoint &ep,
|
||||
}
|
||||
|
||||
try {
|
||||
unsigned const vcpu_id = _vcpu_ids.alloc();
|
||||
unsigned const vcpu_id = (unsigned)_vcpu_ids.alloc();
|
||||
_task_index_client = thread.setup_vcpu(vcpu_id, task_cap, recall_cap(),
|
||||
_foc_vcpu_state);
|
||||
if (_task_index_client == Foc::L4_INVALID_CAP) {
|
||||
@ -76,7 +76,7 @@ Vcpu::~Vcpu()
|
||||
}
|
||||
|
||||
if (_foc_vcpu_state) {
|
||||
unsigned const vcpu_id = ((addr_t)_foc_vcpu_state -
|
||||
addr_t const vcpu_id = ((addr_t)_foc_vcpu_state -
|
||||
Platform::VCPU_VIRT_EXT_START) / L4_PAGESIZE;
|
||||
_vcpu_ids.free(vcpu_id);
|
||||
}
|
||||
@ -187,7 +187,7 @@ void Vm_session_component::_attach_vm_memory(Dataspace_component &dsc,
|
||||
|
||||
Flexpage page = flex.page();
|
||||
while (page.valid()) {
|
||||
l4_fpage_t fp = l4_fpage(page.addr, page.log2_order, flags);
|
||||
l4_fpage_t fp = l4_fpage(page.addr, (unsigned)page.log2_order, flags);
|
||||
l4_msgtag_t msg = l4_task_map(_task_vcpu.local.data()->kcap(),
|
||||
L4_BASE_TASK_CAP, fp,
|
||||
l4_map_obj_control(page.hotspot,
|
||||
@ -210,7 +210,7 @@ void Vm_session_component::_detach_vm_memory(addr_t guest_phys, size_t size)
|
||||
using namespace Foc;
|
||||
|
||||
l4_task_unmap(_task_vcpu.local.data()->kcap(),
|
||||
l4_fpage(page.addr, page.log2_order, L4_FPAGE_RWX),
|
||||
l4_fpage(page.addr, (unsigned)page.log2_order, L4_FPAGE_RWX),
|
||||
L4_FP_ALL_SPACES);
|
||||
|
||||
page = flex.page();
|
||||
|
@ -190,7 +190,7 @@ class Genode::Capability_map : private Noncopyable
|
||||
* \param id the global capability id
|
||||
* \return pointer of Cap_index when found, otherwise zero
|
||||
*/
|
||||
Cap_index* find(int id);
|
||||
Cap_index* find(Cap_index::id_t id);
|
||||
|
||||
/**
|
||||
* Create and insert a new Cap_index with a specific capability id
|
||||
@ -203,7 +203,7 @@ class Genode::Capability_map : private Noncopyable
|
||||
* \return pointer to the new Cap_index object, or zero
|
||||
* when allocation failed
|
||||
*/
|
||||
Cap_index* insert(int id);
|
||||
Cap_index* insert(Cap_index::id_t id);
|
||||
|
||||
|
||||
/**
|
||||
@ -217,7 +217,7 @@ class Genode::Capability_map : private Noncopyable
|
||||
* \return pointer to the new Cap_index object, or zero
|
||||
* when allocation failed
|
||||
*/
|
||||
Cap_index* insert(int id, addr_t kcap);
|
||||
Cap_index* insert(Cap_index::id_t id, addr_t kcap);
|
||||
|
||||
/**
|
||||
* Create and insert a new Cap_index with a specific capability id
|
||||
@ -236,7 +236,7 @@ class Genode::Capability_map : private Noncopyable
|
||||
* with the same id exists and it's kernel-object
|
||||
* differs to the one given by kcap
|
||||
*/
|
||||
Cap_index *insert_map(int id, addr_t kcap);
|
||||
Cap_index *insert_map(Cap_index::id_t id, addr_t kcap);
|
||||
|
||||
/**
|
||||
* Remove (resp. invalidate) a Cap_index object
|
||||
|
@ -28,13 +28,17 @@
|
||||
*/
|
||||
class Genode::Native_capability::Data : public Avl_node<Data>
|
||||
{
|
||||
public:
|
||||
|
||||
using id_t = uint16_t;
|
||||
|
||||
private:
|
||||
|
||||
constexpr static uint16_t INVALID_ID = ~0;
|
||||
constexpr static uint16_t UNUSED = 0;
|
||||
|
||||
uint8_t _ref_cnt; /* reference counter */
|
||||
uint16_t _id; /* global capability id */
|
||||
uint8_t _ref_cnt; /* reference counter */
|
||||
id_t _id; /* global capability id */
|
||||
|
||||
public:
|
||||
|
||||
@ -56,7 +60,7 @@ class Genode::Native_capability::Data : public Avl_node<Data>
|
||||
************************/
|
||||
|
||||
bool higher(Data *n);
|
||||
Data *find_by_id(uint16_t id);
|
||||
Data *find_by_id(id_t id);
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__BASE__INTERNAL__CAPABILITY_DATA_H_ */
|
||||
|
@ -30,7 +30,7 @@ namespace Genode {
|
||||
|
||||
static inline Parent_capability parent_cap()
|
||||
{
|
||||
unsigned long const local_name = _parent_cap;
|
||||
Cap_index::id_t const local_name = (Cap_index::id_t)_parent_cap;
|
||||
|
||||
static Cap_index *i = cap_map().insert(local_name, Foc::PARENT_CAP);
|
||||
/*
|
||||
|
@ -104,7 +104,7 @@ uint8_t Cap_index::dec()
|
||||
** Capability_map class **
|
||||
****************************/
|
||||
|
||||
Cap_index* Capability_map::find(int id)
|
||||
Cap_index* Capability_map::find(Cap_index::id_t id)
|
||||
{
|
||||
Lock_guard<Spin_lock> guard(_lock);
|
||||
|
||||
@ -112,7 +112,7 @@ Cap_index* Capability_map::find(int id)
|
||||
}
|
||||
|
||||
|
||||
Cap_index* Capability_map::insert(int id)
|
||||
Cap_index* Capability_map::insert(Cap_index::id_t id)
|
||||
{
|
||||
Lock_guard<Spin_lock> guard(_lock);
|
||||
|
||||
@ -128,7 +128,7 @@ Cap_index* Capability_map::insert(int id)
|
||||
}
|
||||
|
||||
|
||||
Cap_index* Capability_map::insert(int id, addr_t kcap)
|
||||
Cap_index* Capability_map::insert(Cap_index::id_t id, addr_t kcap)
|
||||
{
|
||||
Lock_guard<Spin_lock> guard(_lock);
|
||||
|
||||
@ -146,7 +146,7 @@ Cap_index* Capability_map::insert(int id, addr_t kcap)
|
||||
}
|
||||
|
||||
|
||||
Cap_index* Capability_map::insert_map(int id, addr_t kcap)
|
||||
Cap_index* Capability_map::insert_map(Cap_index::id_t id, addr_t kcap)
|
||||
{
|
||||
using namespace Foc;
|
||||
|
||||
|
@ -49,13 +49,13 @@ enum Debug { DEBUG_MSG = 1 };
|
||||
|
||||
static inline bool ipc_error(l4_msgtag_t tag, bool print)
|
||||
{
|
||||
int const ipc_error = l4_ipc_error(tag, l4_utcb());
|
||||
Foc::l4_umword_t const ipc_error = l4_ipc_error(tag, l4_utcb());
|
||||
if (ipc_error && print) raw("Ipc error: ", ipc_error, " occurred!");
|
||||
return ipc_error;
|
||||
}
|
||||
|
||||
|
||||
static constexpr unsigned long INVALID_BADGE = ~0UL;
|
||||
static constexpr Cap_index::id_t INVALID_BADGE = 0xffff;
|
||||
|
||||
|
||||
/**
|
||||
@ -63,9 +63,9 @@ static constexpr unsigned long INVALID_BADGE = ~0UL;
|
||||
*/
|
||||
struct Cap_info
|
||||
{
|
||||
bool valid = false;
|
||||
unsigned long sel = 0;
|
||||
unsigned long badge = 0;
|
||||
bool valid = false;
|
||||
unsigned long sel = 0;
|
||||
Cap_index::id_t badge = 0;
|
||||
};
|
||||
|
||||
|
||||
@ -74,9 +74,9 @@ struct Cap_info
|
||||
*
|
||||
* \return protocol word (local name or exception code)
|
||||
*/
|
||||
static unsigned long extract_msg_from_utcb(l4_msgtag_t tag,
|
||||
Receive_window &rcv_window,
|
||||
Msgbuf_base &rcv_msg)
|
||||
static int extract_msg_from_utcb(l4_msgtag_t tag,
|
||||
Receive_window &rcv_window,
|
||||
Msgbuf_base &rcv_msg)
|
||||
{
|
||||
unsigned num_msg_words = l4_msgtag_words(tag);
|
||||
|
||||
@ -90,7 +90,7 @@ static unsigned long extract_msg_from_utcb(l4_msgtag_t tag,
|
||||
unsigned long const protocol_word = *msg_words++;
|
||||
|
||||
/* read number of capability arguments from second message word */
|
||||
size_t const num_caps = min(*msg_words, Msgbuf_base::MAX_CAPS_PER_MSG);
|
||||
unsigned const num_caps = (unsigned)min(*msg_words, Msgbuf_base::MAX_CAPS_PER_MSG);
|
||||
msg_words++;
|
||||
|
||||
num_msg_words -= 2;
|
||||
@ -114,7 +114,7 @@ static unsigned long extract_msg_from_utcb(l4_msgtag_t tag,
|
||||
|
||||
for (unsigned i = 0, sel_idx = 0; i < num_caps; i++) {
|
||||
|
||||
unsigned long const badge = *msg_words++;
|
||||
Cap_index::id_t const badge = (Cap_index::id_t)(*msg_words++);
|
||||
|
||||
if (badge == INVALID_BADGE)
|
||||
continue;
|
||||
@ -135,7 +135,7 @@ static unsigned long extract_msg_from_utcb(l4_msgtag_t tag,
|
||||
if ((num_msg_words)*sizeof(l4_mword_t) > rcv_msg.capacity()) {
|
||||
if (DEBUG_MSG)
|
||||
raw("receive message buffer too small");
|
||||
num_msg_words = rcv_msg.capacity()/sizeof(l4_mword_t);
|
||||
num_msg_words = (unsigned)(rcv_msg.capacity()/sizeof(l4_mword_t));
|
||||
}
|
||||
|
||||
/* read message payload beginning from the second UTCB message register */
|
||||
@ -160,7 +160,7 @@ static unsigned long extract_msg_from_utcb(l4_msgtag_t tag,
|
||||
}
|
||||
}
|
||||
|
||||
return protocol_word;
|
||||
return (int)protocol_word;
|
||||
}
|
||||
|
||||
|
||||
@ -175,8 +175,8 @@ static l4_msgtag_t copy_msgbuf_to_utcb(Msgbuf_base &snd_msg,
|
||||
unsigned long protocol_word)
|
||||
{
|
||||
|
||||
unsigned const num_data_words = snd_msg.data_size() / sizeof(l4_mword_t);
|
||||
unsigned const num_caps = snd_msg.used_caps();
|
||||
unsigned const num_data_words = (unsigned)(snd_msg.data_size() / sizeof(l4_mword_t));
|
||||
unsigned const num_caps = (unsigned)snd_msg.used_caps();
|
||||
|
||||
/* validate capabilities present in the message buffer */
|
||||
for (unsigned i = 0; i < num_caps; i++) {
|
||||
@ -201,7 +201,7 @@ static l4_msgtag_t copy_msgbuf_to_utcb(Msgbuf_base &snd_msg,
|
||||
Native_capability const &cap = snd_msg.cap(i);
|
||||
if (cap.valid()) {
|
||||
caps[i].valid = true;
|
||||
caps[i].badge = cap.local_name();
|
||||
caps[i].badge = (Cap_index::id_t)cap.local_name();
|
||||
caps[i].sel = cap.data()->kcap();
|
||||
}
|
||||
}
|
||||
|
@ -29,9 +29,12 @@
|
||||
#include <foc/native_capability.h>
|
||||
|
||||
namespace Foc {
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wconversion"
|
||||
#include <l4/sys/vcpu.h>
|
||||
#include <l4/sys/__vm-svm.h>
|
||||
#include <l4/sys/__vm-vmx.h>
|
||||
#pragma GCC diagnostic pop /* restore -Wconversion warnings */
|
||||
}
|
||||
|
||||
using namespace Genode;
|
||||
@ -218,9 +221,9 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
CR0_PG = 0 /* 1U << 31 - not needed in case of UG */
|
||||
};
|
||||
|
||||
addr_t const _cr0_mask { CR0_NM | CR0_CD };
|
||||
addr_t const vmcb_ctrl0 { CTRL0_IO | CTRL0_MSR };
|
||||
addr_t const vmcb_ctrl1 { 0 };
|
||||
addr_t const _cr0_mask { CR0_NM | CR0_CD };
|
||||
uint32_t const vmcb_ctrl0 { CTRL0_IO | CTRL0_MSR };
|
||||
uint32_t const vmcb_ctrl1 { 0 };
|
||||
|
||||
addr_t vmcb_cr0_shadow { 0 };
|
||||
addr_t vmcb_cr4_shadow { 0 };
|
||||
@ -481,7 +484,7 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
* Convert to AMD (and Genode) format comprising 16 bits.
|
||||
*/
|
||||
uint16_t _convert_ar_16(addr_t value) {
|
||||
return ((value & 0x1f000) >> 4) | (value & 0xff); }
|
||||
return (uint16_t)(((value & 0x1f000) >> 4) | (value & 0xff)); }
|
||||
|
||||
void _read_intel_state(Vcpu_state &state, void *vmcs,
|
||||
Foc::l4_vcpu_state_t *vcpu)
|
||||
@ -495,18 +498,15 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
state.di.charge(vcpu->r.di);
|
||||
state.si.charge(vcpu->r.si);
|
||||
|
||||
state.flags.charge(Foc::l4_vm_vmx_read(vmcs, Vmcs::FLAGS));
|
||||
|
||||
state.sp.charge(Foc::l4_vm_vmx_read(vmcs, Vmcs::SP));
|
||||
|
||||
state.ip.charge(Foc::l4_vm_vmx_read(vmcs, Vmcs::IP));
|
||||
state.ip_len.charge(Foc::l4_vm_vmx_read(vmcs, Vmcs::INST_LEN));
|
||||
|
||||
state.dr7.charge(Foc::l4_vm_vmx_read(vmcs, Vmcs::DR7));
|
||||
state.flags .charge((addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::FLAGS));
|
||||
state.sp .charge((addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::SP));
|
||||
state.ip .charge((addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::IP));
|
||||
state.ip_len.charge((addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::INST_LEN));
|
||||
state.dr7 .charge((addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::DR7));
|
||||
|
||||
#ifdef __x86_64__
|
||||
state.r8.charge(vcpu->r.r8);
|
||||
state.r9.charge(vcpu->r.r9);
|
||||
state.r8 .charge(vcpu->r.r8);
|
||||
state.r9 .charge(vcpu->r.r9);
|
||||
state.r10.charge(vcpu->r.r10);
|
||||
state.r11.charge(vcpu->r.r11);
|
||||
state.r12.charge(vcpu->r.r12);
|
||||
@ -516,21 +516,25 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
#endif
|
||||
|
||||
{
|
||||
addr_t const cr0 = Foc::l4_vm_vmx_read(vmcs, Vmcs::CR0);
|
||||
addr_t const cr0_shadow = Foc::l4_vm_vmx_read(vmcs, Vmcs::CR0_SHADOW);
|
||||
addr_t const cr0 = (addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::CR0);
|
||||
addr_t const cr0_shadow = (addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::CR0_SHADOW);
|
||||
|
||||
state.cr0.charge((cr0 & ~vmcs_cr0_mask) | (cr0_shadow & vmcs_cr0_mask));
|
||||
|
||||
if (state.cr0.value() != cr0_shadow)
|
||||
Foc::l4_vm_vmx_write(vmcs, Vmcs::CR0_SHADOW, state.cr0.value());
|
||||
}
|
||||
|
||||
unsigned const cr2 = Foc::l4_vm_vmx_get_cr2_index(vmcs);
|
||||
state.cr2.charge(Foc::l4_vm_vmx_read(vmcs, cr2));
|
||||
state.cr3.charge(Foc::l4_vm_vmx_read(vmcs, Vmcs::CR3));
|
||||
state.cr2.charge((addr_t)Foc::l4_vm_vmx_read(vmcs, cr2));
|
||||
state.cr3.charge((addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::CR3));
|
||||
|
||||
{
|
||||
addr_t const cr4 = Foc::l4_vm_vmx_read(vmcs, Vmcs::CR4);
|
||||
addr_t const cr4_shadow = Foc::l4_vm_vmx_read(vmcs, Vmcs::CR4_SHADOW);
|
||||
addr_t const cr4 = (addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::CR4);
|
||||
addr_t const cr4_shadow = (addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::CR4_SHADOW);
|
||||
|
||||
state.cr4.charge((cr4 & ~vmcs_cr4_mask) | (cr4_shadow & vmcs_cr4_mask));
|
||||
|
||||
if (state.cr4.value() != cr4_shadow)
|
||||
Foc::l4_vm_vmx_write(vmcs, Vmcs::CR4_SHADOW,
|
||||
state.cr4.value());
|
||||
@ -545,7 +549,7 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
|
||||
{
|
||||
Segment cs { l4_vm_vmx_read_16(vmcs, Vmcs::CS_SEL),
|
||||
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::CS_AR)),
|
||||
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::CS_AR)),
|
||||
l4_vm_vmx_read_32(vmcs, Vmcs::CS_LIMIT),
|
||||
l4_vm_vmx_read_nat(vmcs, Vmcs::CS_BASE) };
|
||||
|
||||
@ -554,7 +558,7 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
|
||||
{
|
||||
Segment ss { l4_vm_vmx_read_16(vmcs, Vmcs::SS_SEL),
|
||||
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::SS_AR)),
|
||||
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::SS_AR)),
|
||||
l4_vm_vmx_read_32(vmcs, Vmcs::SS_LIMIT),
|
||||
l4_vm_vmx_read_nat(vmcs, Vmcs::SS_BASE) };
|
||||
|
||||
@ -563,7 +567,7 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
|
||||
{
|
||||
Segment es { l4_vm_vmx_read_16(vmcs, Vmcs::ES_SEL),
|
||||
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::ES_AR)),
|
||||
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::ES_AR)),
|
||||
l4_vm_vmx_read_32(vmcs, Vmcs::ES_LIMIT),
|
||||
l4_vm_vmx_read_nat(vmcs, Vmcs::ES_BASE) };
|
||||
|
||||
@ -572,7 +576,7 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
|
||||
{
|
||||
Segment ds { l4_vm_vmx_read_16(vmcs, Vmcs::DS_SEL),
|
||||
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::DS_AR)),
|
||||
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::DS_AR)),
|
||||
l4_vm_vmx_read_32(vmcs, Vmcs::DS_LIMIT),
|
||||
l4_vm_vmx_read_nat(vmcs, Vmcs::DS_BASE) };
|
||||
|
||||
@ -581,7 +585,7 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
|
||||
{
|
||||
Segment fs { l4_vm_vmx_read_16(vmcs, Vmcs::FS_SEL),
|
||||
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::FS_AR)),
|
||||
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::FS_AR)),
|
||||
l4_vm_vmx_read_32(vmcs, Vmcs::FS_LIMIT),
|
||||
l4_vm_vmx_read_nat(vmcs, Vmcs::FS_BASE) };
|
||||
|
||||
@ -590,7 +594,7 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
|
||||
{
|
||||
Segment gs { l4_vm_vmx_read_16(vmcs, Vmcs::GS_SEL),
|
||||
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::GS_AR)),
|
||||
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::GS_AR)),
|
||||
l4_vm_vmx_read_32(vmcs, Vmcs::GS_LIMIT),
|
||||
l4_vm_vmx_read_nat(vmcs, Vmcs::GS_BASE) };
|
||||
|
||||
@ -599,7 +603,7 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
|
||||
{
|
||||
Segment tr { l4_vm_vmx_read_16(vmcs, Vmcs::TR_SEL),
|
||||
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::TR_AR)),
|
||||
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::TR_AR)),
|
||||
l4_vm_vmx_read_32(vmcs, Vmcs::TR_LIMIT),
|
||||
l4_vm_vmx_read_nat(vmcs, Vmcs::TR_BASE) };
|
||||
|
||||
@ -608,7 +612,7 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
|
||||
{
|
||||
Segment ldtr { l4_vm_vmx_read_16(vmcs, Vmcs::LDTR_SEL),
|
||||
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::LDTR_AR)),
|
||||
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::LDTR_AR)),
|
||||
l4_vm_vmx_read_32(vmcs, Vmcs::LDTR_LIMIT),
|
||||
l4_vm_vmx_read_nat(vmcs, Vmcs::LDTR_BASE) };
|
||||
|
||||
@ -621,35 +625,35 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
state.idtr.charge(Range{.limit = l4_vm_vmx_read_32(vmcs, Vmcs::IDTR_LIMIT),
|
||||
.base = l4_vm_vmx_read_nat(vmcs, Vmcs::IDTR_BASE)});
|
||||
|
||||
state.sysenter_cs.charge(l4_vm_vmx_read(vmcs, Vmcs::SYSENTER_CS));
|
||||
state.sysenter_sp.charge(l4_vm_vmx_read(vmcs, Vmcs::SYSENTER_SP));
|
||||
state.sysenter_ip.charge(l4_vm_vmx_read(vmcs, Vmcs::SYSENTER_IP));
|
||||
state.sysenter_cs.charge((addr_t)l4_vm_vmx_read(vmcs, Vmcs::SYSENTER_CS));
|
||||
state.sysenter_sp.charge((addr_t)l4_vm_vmx_read(vmcs, Vmcs::SYSENTER_SP));
|
||||
state.sysenter_ip.charge((addr_t)l4_vm_vmx_read(vmcs, Vmcs::SYSENTER_IP));
|
||||
|
||||
state.qual_primary.charge(l4_vm_vmx_read(vmcs, Vmcs::EXIT_QUAL));
|
||||
state.qual_primary .charge(l4_vm_vmx_read(vmcs, Vmcs::EXIT_QUAL));
|
||||
state.qual_secondary.charge(l4_vm_vmx_read(vmcs, Vmcs::GUEST_PHYS));
|
||||
|
||||
state.ctrl_primary.charge(l4_vm_vmx_read(vmcs, Vmcs::CTRL_0));
|
||||
state.ctrl_secondary.charge(l4_vm_vmx_read(vmcs, Vmcs::CTRL_1));
|
||||
state.ctrl_primary .charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::CTRL_0));
|
||||
state.ctrl_secondary.charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::CTRL_1));
|
||||
|
||||
if (state.exit_reason == INTEL_EXIT_INVALID ||
|
||||
state.exit_reason == VMEXIT_PAUSED)
|
||||
{
|
||||
state.inj_info.charge(l4_vm_vmx_read(vmcs, Vmcs::INTR_INFO));
|
||||
state.inj_error.charge(l4_vm_vmx_read(vmcs, Vmcs::INTR_ERROR));
|
||||
state.inj_info .charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::INTR_INFO));
|
||||
state.inj_error.charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::INTR_ERROR));
|
||||
} else {
|
||||
state.inj_info.charge(l4_vm_vmx_read(vmcs, Vmcs::IDT_INFO));
|
||||
state.inj_error.charge(l4_vm_vmx_read(vmcs, Vmcs::IDT_ERROR));
|
||||
state.inj_info .charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::IDT_INFO));
|
||||
state.inj_error.charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::IDT_ERROR));
|
||||
}
|
||||
|
||||
state.intr_state.charge(l4_vm_vmx_read(vmcs, Vmcs::STATE_INTR));
|
||||
state.actv_state.charge(l4_vm_vmx_read(vmcs, Vmcs::STATE_ACTV));
|
||||
state.intr_state.charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::STATE_INTR));
|
||||
state.actv_state.charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::STATE_ACTV));
|
||||
|
||||
state.tsc.charge(Trace::timestamp());
|
||||
state.tsc_offset.charge(_tsc_offset);
|
||||
|
||||
state.efer.charge(l4_vm_vmx_read(vmcs, Vmcs::EFER));
|
||||
state.efer.charge((addr_t)l4_vm_vmx_read(vmcs, Vmcs::EFER));
|
||||
|
||||
state.star.charge(l4_vm_vmx_read(vmcs, Vmcs::MSR_STAR));
|
||||
state.star .charge(l4_vm_vmx_read(vmcs, Vmcs::MSR_STAR));
|
||||
state.lstar.charge(l4_vm_vmx_read(vmcs, Vmcs::MSR_LSTAR));
|
||||
state.cstar.charge(l4_vm_vmx_read(vmcs, Vmcs::MSR_CSTAR));
|
||||
state.fmask.charge(l4_vm_vmx_read(vmcs, Vmcs::MSR_FMASK));
|
||||
@ -665,7 +669,7 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
void _read_amd_state(Vcpu_state &state, Foc::l4_vm_svm_vmcb_t *vmcb,
|
||||
Foc::l4_vcpu_state_t * const vcpu)
|
||||
{
|
||||
state.ax.charge(vmcb->state_save_area.rax);
|
||||
state.ax.charge((addr_t)vmcb->state_save_area.rax);
|
||||
state.cx.charge(vcpu->r.cx);
|
||||
state.dx.charge(vcpu->r.dx);
|
||||
state.bx.charge(vcpu->r.bx);
|
||||
@ -674,18 +678,18 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
state.si.charge(vcpu->r.si);
|
||||
state.bp.charge(vcpu->r.bp);
|
||||
|
||||
state.flags.charge(vmcb->state_save_area.rflags);
|
||||
state.flags.charge((addr_t)vmcb->state_save_area.rflags);
|
||||
|
||||
state.sp.charge(vmcb->state_save_area.rsp);
|
||||
state.sp.charge((addr_t)vmcb->state_save_area.rsp);
|
||||
|
||||
state.ip.charge(vmcb->state_save_area.rip);
|
||||
state.ip.charge((addr_t)vmcb->state_save_area.rip);
|
||||
state.ip_len.charge(0); /* unsupported on AMD */
|
||||
|
||||
state.dr7.charge(vmcb->state_save_area.dr7);
|
||||
state.dr7.charge((addr_t)vmcb->state_save_area.dr7);
|
||||
|
||||
#ifdef __x86_64__
|
||||
state.r8.charge(vcpu->r.r8);
|
||||
state.r9.charge(vcpu->r.r9);
|
||||
state.r8 .charge(vcpu->r.r8);
|
||||
state.r9 .charge(vcpu->r.r9);
|
||||
state.r10.charge(vcpu->r.r10);
|
||||
state.r11.charge(vcpu->r.r11);
|
||||
state.r12.charge(vcpu->r.r12);
|
||||
@ -695,15 +699,15 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
#endif
|
||||
|
||||
{
|
||||
addr_t const cr0 = vmcb->state_save_area.cr0;
|
||||
addr_t const cr0 = (addr_t)vmcb->state_save_area.cr0;
|
||||
state.cr0.charge((cr0 & ~vmcb_cr0_mask) | (vmcb_cr0_shadow & vmcb_cr0_mask));
|
||||
if (state.cr0.value() != vmcb_cr0_shadow)
|
||||
vmcb_cr0_shadow = state.cr0.value();
|
||||
}
|
||||
state.cr2.charge(vmcb->state_save_area.cr2);
|
||||
state.cr3.charge(vmcb->state_save_area.cr3);
|
||||
state.cr2.charge((addr_t)vmcb->state_save_area.cr2);
|
||||
state.cr3.charge((addr_t)vmcb->state_save_area.cr3);
|
||||
{
|
||||
addr_t const cr4 = vmcb->state_save_area.cr4;
|
||||
addr_t const cr4 = (addr_t)vmcb->state_save_area.cr4;
|
||||
state.cr4.charge((cr4 & ~vmcb_cr4_mask) | (vmcb_cr4_shadow & vmcb_cr4_mask));
|
||||
if (state.cr4.value() != vmcb_cr4_shadow)
|
||||
vmcb_cr4_shadow = state.cr4.value();
|
||||
@ -712,44 +716,44 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
typedef Vcpu_state::Segment Segment;
|
||||
|
||||
state.cs.charge(Segment{vmcb->state_save_area.cs.selector,
|
||||
vmcb->state_save_area.cs.attrib,
|
||||
vmcb->state_save_area.cs.limit,
|
||||
(addr_t)vmcb->state_save_area.cs.base});
|
||||
vmcb->state_save_area.cs.attrib,
|
||||
vmcb->state_save_area.cs.limit,
|
||||
(addr_t)vmcb->state_save_area.cs.base});
|
||||
|
||||
state.ss.charge(Segment{vmcb->state_save_area.ss.selector,
|
||||
vmcb->state_save_area.ss.attrib,
|
||||
vmcb->state_save_area.ss.limit,
|
||||
(addr_t)vmcb->state_save_area.ss.base});
|
||||
vmcb->state_save_area.ss.attrib,
|
||||
vmcb->state_save_area.ss.limit,
|
||||
(addr_t)vmcb->state_save_area.ss.base});
|
||||
|
||||
state.es.charge(Segment{vmcb->state_save_area.es.selector,
|
||||
vmcb->state_save_area.es.attrib,
|
||||
vmcb->state_save_area.es.limit,
|
||||
(addr_t)vmcb->state_save_area.es.base});
|
||||
vmcb->state_save_area.es.attrib,
|
||||
vmcb->state_save_area.es.limit,
|
||||
(addr_t)vmcb->state_save_area.es.base});
|
||||
|
||||
state.ds.charge(Segment{vmcb->state_save_area.ds.selector,
|
||||
vmcb->state_save_area.ds.attrib,
|
||||
vmcb->state_save_area.ds.limit,
|
||||
(addr_t)vmcb->state_save_area.ds.base});
|
||||
vmcb->state_save_area.ds.attrib,
|
||||
vmcb->state_save_area.ds.limit,
|
||||
(addr_t)vmcb->state_save_area.ds.base});
|
||||
|
||||
state.fs.charge(Segment{vmcb->state_save_area.fs.selector,
|
||||
vmcb->state_save_area.fs.attrib,
|
||||
vmcb->state_save_area.fs.limit,
|
||||
(addr_t)vmcb->state_save_area.fs.base});
|
||||
vmcb->state_save_area.fs.attrib,
|
||||
vmcb->state_save_area.fs.limit,
|
||||
(addr_t)vmcb->state_save_area.fs.base});
|
||||
|
||||
state.gs.charge(Segment{vmcb->state_save_area.gs.selector,
|
||||
vmcb->state_save_area.gs.attrib,
|
||||
vmcb->state_save_area.gs.limit,
|
||||
(addr_t)vmcb->state_save_area.gs.base});
|
||||
vmcb->state_save_area.gs.attrib,
|
||||
vmcb->state_save_area.gs.limit,
|
||||
(addr_t)vmcb->state_save_area.gs.base});
|
||||
|
||||
state.tr.charge(Segment{vmcb->state_save_area.tr.selector,
|
||||
vmcb->state_save_area.tr.attrib,
|
||||
vmcb->state_save_area.tr.limit,
|
||||
(addr_t)vmcb->state_save_area.tr.base});
|
||||
vmcb->state_save_area.tr.attrib,
|
||||
vmcb->state_save_area.tr.limit,
|
||||
(addr_t)vmcb->state_save_area.tr.base});
|
||||
|
||||
state.ldtr.charge(Segment{vmcb->state_save_area.ldtr.selector,
|
||||
vmcb->state_save_area.ldtr.attrib,
|
||||
vmcb->state_save_area.ldtr.limit,
|
||||
(addr_t)vmcb->state_save_area.ldtr.base});
|
||||
vmcb->state_save_area.ldtr.attrib,
|
||||
vmcb->state_save_area.ldtr.limit,
|
||||
(addr_t)vmcb->state_save_area.ldtr.base});
|
||||
|
||||
typedef Vcpu_state::Range Range;
|
||||
|
||||
@ -759,11 +763,11 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
state.idtr.charge(Range{.limit = vmcb->state_save_area.idtr.limit,
|
||||
.base = (addr_t)vmcb->state_save_area.idtr.base });
|
||||
|
||||
state.sysenter_cs.charge(vmcb->state_save_area.sysenter_cs);
|
||||
state.sysenter_sp.charge(vmcb->state_save_area.sysenter_esp);
|
||||
state.sysenter_ip.charge(vmcb->state_save_area.sysenter_eip);
|
||||
state.sysenter_cs.charge((addr_t)vmcb->state_save_area.sysenter_cs);
|
||||
state.sysenter_sp.charge((addr_t)vmcb->state_save_area.sysenter_esp);
|
||||
state.sysenter_ip.charge((addr_t)vmcb->state_save_area.sysenter_eip);
|
||||
|
||||
state.qual_primary.charge(vmcb->control_area.exitinfo1);
|
||||
state.qual_primary .charge(vmcb->control_area.exitinfo1);
|
||||
state.qual_secondary.charge(vmcb->control_area.exitinfo2);
|
||||
|
||||
uint32_t inj_info = 0;
|
||||
@ -771,22 +775,22 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
if (state.exit_reason == AMD_EXIT_INVALID ||
|
||||
state.exit_reason == VMEXIT_PAUSED)
|
||||
{
|
||||
inj_info = vmcb->control_area.eventinj;
|
||||
inj_error = vmcb->control_area.eventinj >> 32;
|
||||
inj_info = (uint32_t)vmcb->control_area.eventinj;
|
||||
inj_error = (uint32_t)(vmcb->control_area.eventinj >> 32);
|
||||
} else {
|
||||
inj_info = vmcb->control_area.exitintinfo;
|
||||
inj_error = vmcb->control_area.exitintinfo >> 32;
|
||||
inj_info = (uint32_t)vmcb->control_area.exitintinfo;
|
||||
inj_error = (uint32_t)(vmcb->control_area.exitintinfo >> 32);
|
||||
}
|
||||
state.inj_info.charge(inj_info);
|
||||
state.inj_info .charge(inj_info);
|
||||
state.inj_error.charge(inj_error);
|
||||
|
||||
state.intr_state.charge(vmcb->control_area.interrupt_shadow);
|
||||
state.intr_state.charge((uint32_t)vmcb->control_area.interrupt_shadow);
|
||||
state.actv_state.charge(0);
|
||||
|
||||
state.tsc.charge(Trace::timestamp());
|
||||
state.tsc_offset.charge(_tsc_offset);
|
||||
|
||||
state.efer.charge(vmcb->state_save_area.efer);
|
||||
state.efer.charge((addr_t)vmcb->state_save_area.efer);
|
||||
|
||||
if (state.pdpte_0.charged() || state.pdpte_1.charged() ||
|
||||
state.pdpte_2.charged() || state.pdpte_3.charged()) {
|
||||
@ -894,9 +898,9 @@ struct Foc_vcpu : Thread, Noncopyable
|
||||
}
|
||||
|
||||
if (state.inj_info.charged() || state.inj_error.charged()) {
|
||||
addr_t ctrl_0 = state.ctrl_primary.charged() ?
|
||||
state.ctrl_primary.value() :
|
||||
Foc::l4_vm_vmx_read(vmcs, Vmcs::CTRL_0);
|
||||
uint32_t ctrl_0 = state.ctrl_primary.charged()
|
||||
? (uint32_t)state.ctrl_primary.value()
|
||||
: (uint32_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::CTRL_0);
|
||||
|
||||
if (state.inj_info.value() & 0x2000)
|
||||
warning("unimplemented ", state.inj_info.value() & 0x1000, " ",
|
||||
|
@ -38,7 +38,8 @@ Main::Main(Env &env)
|
||||
Foc::l4_cap_idx_t tid = Capability_space::kcap(env.pd_session_cap());
|
||||
|
||||
/* try the first 1000 local name IDs */
|
||||
for (int local_name = 0; local_name < COUNT; local_name++, idx++) {
|
||||
using id_t = Native_capability::Data::id_t;
|
||||
for (id_t local_name = 0; local_name < COUNT; local_name++, idx++) {
|
||||
idx->id(local_name);
|
||||
l4_task_map(L4_BASE_TASK_CAP, L4_BASE_TASK_CAP,
|
||||
l4_obj_fpage(tid, 0, L4_FPAGE_RWX),
|
||||
|
@ -97,7 +97,7 @@ namespace Kernel {
|
||||
*/
|
||||
inline int timeout(timeout_t const duration_us, capid_t const sigid)
|
||||
{
|
||||
return call(call_id_timeout(), duration_us, sigid);
|
||||
return (int)call(call_id_timeout(), duration_us, sigid);
|
||||
}
|
||||
|
||||
|
||||
@ -230,7 +230,7 @@ namespace Kernel {
|
||||
*/
|
||||
inline int send_request_msg(capid_t const thread_id, unsigned rcv_caps)
|
||||
{
|
||||
return call(call_id_send_request_msg(), thread_id, rcv_caps);
|
||||
return (int)call(call_id_send_request_msg(), thread_id, rcv_caps);
|
||||
}
|
||||
|
||||
|
||||
@ -248,7 +248,7 @@ namespace Kernel {
|
||||
*/
|
||||
inline int await_request_msg(unsigned rcv_caps)
|
||||
{
|
||||
return call(call_id_await_request_msg(), rcv_caps);
|
||||
return (int)call(call_id_await_request_msg(), rcv_caps);
|
||||
}
|
||||
|
||||
|
||||
@ -266,7 +266,7 @@ namespace Kernel {
|
||||
*/
|
||||
inline int send_reply_msg(unsigned rcv_caps, bool const await_request_msg)
|
||||
{
|
||||
return call(call_id_send_reply_msg(), rcv_caps, await_request_msg);
|
||||
return (int)call(call_id_send_reply_msg(), rcv_caps, await_request_msg);
|
||||
}
|
||||
|
||||
|
||||
@ -302,7 +302,7 @@ namespace Kernel {
|
||||
*/
|
||||
inline int await_signal(capid_t const receiver_id)
|
||||
{
|
||||
return call(call_id_await_signal(), receiver_id);
|
||||
return (int)call(call_id_await_signal(), receiver_id);
|
||||
}
|
||||
|
||||
|
||||
@ -320,7 +320,7 @@ namespace Kernel {
|
||||
*/
|
||||
inline int pending_signal(capid_t const receiver_id)
|
||||
{
|
||||
return call(call_id_pending_signal(), receiver_id);
|
||||
return (int)call(call_id_pending_signal(), receiver_id);
|
||||
}
|
||||
|
||||
|
||||
@ -352,7 +352,7 @@ namespace Kernel {
|
||||
*/
|
||||
inline int submit_signal(capid_t const context, unsigned const num)
|
||||
{
|
||||
return call(call_id_submit_signal(), context, num);
|
||||
return (int)call(call_id_submit_signal(), context, num);
|
||||
}
|
||||
|
||||
|
||||
@ -377,7 +377,7 @@ namespace Kernel {
|
||||
*/
|
||||
inline int kill_signal_context(capid_t const context)
|
||||
{
|
||||
return call(call_id_kill_signal_context(), context);
|
||||
return (int)call(call_id_kill_signal_context(), context);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -38,3 +38,5 @@ vpath hw/% $(BASE_HW_DIR)/src/lib
|
||||
vpath lib/base/% $(BASE_HW_DIR)/src
|
||||
vpath lib/base/% $(BASE_DIR)/src
|
||||
vpath lib/startup/% $(BASE_DIR)/src
|
||||
|
||||
CC_CXX_WARN_STRICT_CONVERSION =
|
||||
|
@ -14,3 +14,5 @@ SRC_CC += spec/arm/bcm2835_system_timer.cc
|
||||
|
||||
# include less specific configuration
|
||||
include $(call select_from_repositories,lib/mk/spec/arm_v6/core-hw.inc)
|
||||
|
||||
CC_CXX_WARN_STRICT_CONVERSION =
|
||||
|
@ -1,16 +1,8 @@
|
||||
#
|
||||
# \brief Build config for Genodes core process
|
||||
# \author Stefan Kalkowski
|
||||
# \author Martin Stein
|
||||
# \date 2012-10-24
|
||||
#
|
||||
|
||||
# add include paths
|
||||
REP_INC_DIR += src/core/board/imx53_qsb
|
||||
|
||||
SRC_CC += spec/arm/imx_epit.cc
|
||||
SRC_CC += spec/arm/imx_tzic.cc
|
||||
|
||||
# include less specific configuration
|
||||
include $(call select_from_repositories,lib/mk/spec/cortex_a8/core-hw.inc)
|
||||
|
||||
CC_CXX_WARN_STRICT_CONVERSION =
|
||||
|
@ -11,4 +11,3 @@ SRC_S += spec/arm_v7/trustzone/exception_vector.s
|
||||
|
||||
# include less specific configuration
|
||||
include $(call select_from_repositories,lib/mk/spec/arm_v7/core-hw-imx53_qsb.inc)
|
||||
|
||||
|
@ -11,3 +11,5 @@ SRC_CC += spec/arm/kernel/lock.cc
|
||||
|
||||
# include less specific configuration
|
||||
include $(call select_from_repositories,lib/mk/spec/arm_v7/core-hw.inc)
|
||||
|
||||
CC_CXX_WARN_STRICT_CONVERSION =
|
||||
|
@ -15,3 +15,5 @@ SRC_CC += kernel/cpu_mp.cc
|
||||
|
||||
# include less specific configuration
|
||||
include $(call select_from_repositories,lib/mk/spec/arm_v7/core-hw.inc)
|
||||
|
||||
CC_CXX_WARN_STRICT_CONVERSION =
|
||||
|
@ -31,8 +31,9 @@ void * Platform::Ram_allocator::alloc_aligned(size_t size, unsigned align)
|
||||
{
|
||||
using namespace Genode;
|
||||
|
||||
return Base::alloc_aligned(Hw::round_page(size),
|
||||
max(align, get_page_size_log2())).convert<void *>(
|
||||
align = max(align, (unsigned)get_page_size_log2());
|
||||
|
||||
return Base::alloc_aligned(Hw::round_page(size), align).convert<void *>(
|
||||
|
||||
[&] (void *ptr) { return ptr; },
|
||||
[&] (Ram_allocator::Alloc_error e) -> void *
|
||||
|
@ -307,7 +307,7 @@ unsigned Bootstrap::Platform::enable_mmu()
|
||||
|
||||
/* skip the SMP when ACPI parsing did not reveal the number of CPUs */
|
||||
if (board.cpus <= 1)
|
||||
return cpu_id;
|
||||
return (unsigned)cpu_id;
|
||||
|
||||
Lapic lapic(board.core_mmio.virt_addr(Hw::Cpu_memory_map::lapic_phys_base()));
|
||||
|
||||
@ -317,7 +317,7 @@ unsigned Bootstrap::Platform::enable_mmu()
|
||||
|
||||
if (!Cpu::IA32_apic_base::Bsp::get(lapic_msr))
|
||||
/* AP - done */
|
||||
return cpu_id;
|
||||
return (unsigned)cpu_id;
|
||||
|
||||
/* BSP - we're primary CPU - wake now all other CPUs */
|
||||
|
||||
@ -329,7 +329,7 @@ unsigned Bootstrap::Platform::enable_mmu()
|
||||
/* debates ongoing whether the second SIPI is still required */
|
||||
ipi_to_all(lapic, AP_BOOT_CODE_PAGE >> 12, Lapic::Icr_low::Delivery_mode::SIPI);
|
||||
|
||||
return cpu_id;
|
||||
return (unsigned)cpu_id;
|
||||
}
|
||||
|
||||
|
||||
|
@ -66,7 +66,7 @@ Core_region_map::attach(Dataspace_capability ds_cap, size_t size,
|
||||
using namespace Hw;
|
||||
|
||||
/* map the dataspace's physical pages to corresponding virtual addresses */
|
||||
unsigned num_pages = page_rounded_size >> get_page_size_log2();
|
||||
unsigned num_pages = (unsigned)(page_rounded_size >> get_page_size_log2());
|
||||
Page_flags const flags { (writeable && ds.writable()) ? RW : RO,
|
||||
NO_EXEC, KERN, GLOBAL,
|
||||
ds.io_mem() ? DEVICE : RAM,
|
||||
|
@ -28,7 +28,7 @@ using namespace Genode;
|
||||
|
||||
unsigned Irq_session_component::_find_irq_number(const char * const args)
|
||||
{
|
||||
return Arg_string::find_arg(args, "irq_number").long_value(-1);
|
||||
return (unsigned)Arg_string::find_arg(args, "irq_number").long_value(-1);
|
||||
}
|
||||
|
||||
|
||||
@ -64,7 +64,8 @@ Irq_session_component::~Irq_session_component()
|
||||
Irq_session_component::Irq_session_component(Range_allocator &irq_alloc,
|
||||
const char * const args)
|
||||
:
|
||||
_irq_args(args), _irq_number(Platform::irq(_irq_args.irq_number())),
|
||||
_irq_args(args),
|
||||
_irq_number((unsigned)Platform::irq(_irq_args.irq_number())),
|
||||
_irq_alloc(irq_alloc), _kobj(), _is_msi(false), _address(0), _value(0)
|
||||
{
|
||||
long const mmconf =
|
||||
|
@ -132,8 +132,8 @@ namespace Kernel {
|
||||
inline int start_thread(Thread & thread, unsigned const cpu_id,
|
||||
Pd & pd, Native_utcb & utcb)
|
||||
{
|
||||
return call(call_id_start_thread(), (Call_arg)&thread, cpu_id,
|
||||
(Call_arg)&pd, (Call_arg)&utcb);
|
||||
return (int)call(call_id_start_thread(), (Call_arg)&thread, cpu_id,
|
||||
(Call_arg)&pd, (Call_arg)&utcb);
|
||||
}
|
||||
|
||||
|
||||
|
@ -121,8 +121,8 @@ class Kernel::Cpu : public Genode::Cpu, private Irq::Pool, private Timeout
|
||||
Inter_processor_work_list _local_work_list {};
|
||||
|
||||
void _arch_init();
|
||||
unsigned _quota() const { return _timer.us_to_ticks(cpu_quota_us); }
|
||||
unsigned _fill() const { return _timer.us_to_ticks(cpu_fill_us); }
|
||||
unsigned _quota() const { return (unsigned)_timer.us_to_ticks(cpu_quota_us); }
|
||||
unsigned _fill() const { return (unsigned)_timer.us_to_ticks(cpu_fill_us); }
|
||||
|
||||
public:
|
||||
|
||||
|
@ -188,8 +188,8 @@ class Kernel::User_irq : public Kernel::Irq
|
||||
Genode::Irq_session::Polarity polarity,
|
||||
capid_t sig)
|
||||
{
|
||||
return call(call_id_new_irq(), (Call_arg)&irq, nr,
|
||||
(trigger << 2) | polarity, sig);
|
||||
return (capid_t)call(call_id_new_irq(), (Call_arg)&irq, nr,
|
||||
(trigger << 2) | polarity, sig);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -195,7 +195,7 @@ void Object_identity_reference::invalidate()
|
||||
Object_identity_reference::Object_identity_reference(Object_identity *oi,
|
||||
Pd &pd)
|
||||
:
|
||||
_capid(pd.capid_alloc().alloc()), _identity(oi), _pd(pd), _in_utcbs(0)
|
||||
_capid((capid_t)pd.capid_alloc().alloc()), _identity(oi), _pd(pd), _in_utcbs(0)
|
||||
{
|
||||
if (_identity)
|
||||
_identity->insert(this);
|
||||
|
@ -250,7 +250,7 @@ class Kernel::Core_object_identity : public Object_identity,
|
||||
|
||||
static capid_t syscall_create(Genode::Constructible<Core_object_identity<T>> & t,
|
||||
capid_t const cap) {
|
||||
return call(call_id_new_obj(), (Call_arg)&t, (Call_arg)cap); }
|
||||
return (capid_t)call(call_id_new_obj(), (Call_arg)&t, (Call_arg)cap); }
|
||||
|
||||
static void syscall_destroy(Genode::Constructible<Core_object_identity<T>> & t) {
|
||||
call(call_id_delete_obj(), (Call_arg)&t); }
|
||||
|
@ -72,7 +72,7 @@ class Kernel::Pd
|
||||
_platform_pd(platform_pd),
|
||||
mmu_regs((addr_t)&table, addr_space_id_alloc)
|
||||
{
|
||||
capid_t invalid = _capid_alloc.alloc();
|
||||
capid_t invalid = (capid_t)_capid_alloc.alloc();
|
||||
assert(invalid == cap_id_invalid());
|
||||
}
|
||||
|
||||
@ -86,8 +86,8 @@ class Kernel::Pd
|
||||
Hw::Page_table &tt,
|
||||
Genode::Platform_pd &pd)
|
||||
{
|
||||
return call(call_id_new_pd(), (Call_arg)&p,
|
||||
(Call_arg)&tt, (Call_arg)&pd);
|
||||
return (capid_t)call(call_id_new_pd(), (Call_arg)&p,
|
||||
(Call_arg)&tt, (Call_arg)&pd);
|
||||
}
|
||||
|
||||
static void syscall_destroy(Genode::Kernel_object<Pd> & p) {
|
||||
|
@ -203,8 +203,8 @@ class Kernel::Signal_context
|
||||
Signal_receiver & receiver,
|
||||
addr_t const imprint)
|
||||
{
|
||||
return call(call_id_new_signal_context(), (Call_arg)&c,
|
||||
(Call_arg)&receiver, (Call_arg)imprint);
|
||||
return (capid_t)call(call_id_new_signal_context(), (Call_arg)&c,
|
||||
(Call_arg)&receiver, (Call_arg)imprint);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -283,7 +283,7 @@ class Kernel::Signal_receiver
|
||||
* \retval capability id of the new kernel object
|
||||
*/
|
||||
static capid_t syscall_create(Genode::Kernel_object<Signal_receiver> &r) {
|
||||
return call(call_id_new_signal_receiver(), (Call_arg)&r); }
|
||||
return (capid_t)call(call_id_new_signal_receiver(), (Call_arg)&r); }
|
||||
|
||||
/**
|
||||
* Syscall to destruct a signal receiver
|
||||
|
@ -90,7 +90,7 @@ void Thread::_ipc_free_recv_caps()
|
||||
void Thread::_ipc_init(Genode::Native_utcb &utcb, Thread &starter)
|
||||
{
|
||||
_utcb = &utcb;
|
||||
_ipc_alloc_recv_caps(starter._utcb->cap_cnt());
|
||||
_ipc_alloc_recv_caps((unsigned)(starter._utcb->cap_cnt()));
|
||||
ipc_copy_msg(starter);
|
||||
}
|
||||
|
||||
@ -311,14 +311,14 @@ size_t Thread::_core_to_kernel_quota(size_t const quota) const
|
||||
void Thread::_call_thread_quota()
|
||||
{
|
||||
Thread * const thread = (Thread *)user_arg_1();
|
||||
thread->Cpu_job::quota(_core_to_kernel_quota(user_arg_2()));
|
||||
thread->Cpu_job::quota((unsigned)(_core_to_kernel_quota(user_arg_2())));
|
||||
}
|
||||
|
||||
|
||||
void Thread::_call_start_thread()
|
||||
{
|
||||
/* lookup CPU */
|
||||
Cpu & cpu = _cpu_pool.cpu(user_arg_2());
|
||||
Cpu & cpu = _cpu_pool.cpu((unsigned)user_arg_2());
|
||||
user_arg_0(0);
|
||||
Thread &thread = *(Thread*)user_arg_1();
|
||||
|
||||
@ -362,7 +362,7 @@ void Thread::_call_stop_thread()
|
||||
|
||||
void Thread::_call_restart_thread()
|
||||
{
|
||||
Thread *thread_ptr = pd().cap_tree().find<Thread>(user_arg_1());
|
||||
Thread *thread_ptr = pd().cap_tree().find<Thread>((capid_t)user_arg_1());
|
||||
|
||||
if (!thread_ptr)
|
||||
return;
|
||||
@ -450,7 +450,7 @@ void Thread::_call_delete_thread()
|
||||
void Thread::_call_await_request_msg()
|
||||
{
|
||||
if (_ipc_node.can_await_request()) {
|
||||
_ipc_alloc_recv_caps(user_arg_1());
|
||||
_ipc_alloc_recv_caps((unsigned)user_arg_1());
|
||||
_ipc_node.await_request();
|
||||
if (_ipc_node.awaits_request()) {
|
||||
_become_inactive(AWAITS_IPC);
|
||||
@ -467,7 +467,7 @@ void Thread::_call_await_request_msg()
|
||||
void Thread::_call_timeout()
|
||||
{
|
||||
Timer & t = _cpu->timer();
|
||||
_timeout_sigid = user_arg_2();
|
||||
_timeout_sigid = (Kernel::capid_t)user_arg_2();
|
||||
t.set_timeout(this, t.us_to_ticks(user_arg_1()));
|
||||
}
|
||||
|
||||
@ -499,7 +499,7 @@ void Thread::timeout_triggered()
|
||||
|
||||
void Thread::_call_send_request_msg()
|
||||
{
|
||||
Object_identity_reference * oir = pd().cap_tree().find(user_arg_1());
|
||||
Object_identity_reference * oir = pd().cap_tree().find((capid_t)user_arg_1());
|
||||
Thread * const dst = (oir) ? oir->object<Thread>() : nullptr;
|
||||
if (!dst) {
|
||||
Genode::raw(*this, ": cannot send to unknown recipient ",
|
||||
@ -513,7 +513,7 @@ void Thread::_call_send_request_msg()
|
||||
if (!_ipc_node.can_send_request()) {
|
||||
Genode::raw("IPC send request: bad state");
|
||||
} else {
|
||||
_ipc_alloc_recv_caps(user_arg_2());
|
||||
_ipc_alloc_recv_caps((unsigned)user_arg_2());
|
||||
_ipc_capid = oir ? oir->capid() : cap_id_invalid();
|
||||
_ipc_node.send_request(dst->_ipc_node, help);
|
||||
}
|
||||
@ -536,7 +536,7 @@ void Thread::_call_pager()
|
||||
{
|
||||
/* override event route */
|
||||
Thread &thread = *(Thread *)user_arg_1();
|
||||
thread._pager = pd().cap_tree().find<Signal_context>(user_arg_2());
|
||||
thread._pager = pd().cap_tree().find<Signal_context>((Kernel::capid_t)user_arg_2());
|
||||
}
|
||||
|
||||
|
||||
@ -552,7 +552,7 @@ void Thread::_call_await_signal()
|
||||
return;
|
||||
}
|
||||
/* lookup receiver */
|
||||
Signal_receiver * const r = pd().cap_tree().find<Signal_receiver>(user_arg_1());
|
||||
Signal_receiver * const r = pd().cap_tree().find<Signal_receiver>((Kernel::capid_t)user_arg_1());
|
||||
if (!r) {
|
||||
Genode::raw(*this, ": cannot await, unknown signal receiver ",
|
||||
(unsigned)user_arg_1());
|
||||
@ -573,7 +573,7 @@ void Thread::_call_await_signal()
|
||||
void Thread::_call_pending_signal()
|
||||
{
|
||||
/* lookup receiver */
|
||||
Signal_receiver * const r = pd().cap_tree().find<Signal_receiver>(user_arg_1());
|
||||
Signal_receiver * const r = pd().cap_tree().find<Signal_receiver>((Kernel::capid_t)user_arg_1());
|
||||
if (!r) {
|
||||
Genode::raw(*this, ": cannot await, unknown signal receiver ",
|
||||
(unsigned)user_arg_1());
|
||||
@ -601,7 +601,7 @@ void Thread::_call_pending_signal()
|
||||
void Thread::_call_cancel_next_await_signal()
|
||||
{
|
||||
/* kill the caller if the capability of the target thread is invalid */
|
||||
Thread * const thread = pd().cap_tree().find<Thread>(user_arg_1());
|
||||
Thread * const thread = pd().cap_tree().find<Thread>((Kernel::capid_t)user_arg_1());
|
||||
if (!thread || (&pd() != &thread->pd())) {
|
||||
raw(*this, ": failed to lookup thread ", (unsigned)user_arg_1());
|
||||
_die();
|
||||
@ -620,7 +620,7 @@ void Thread::_call_cancel_next_await_signal()
|
||||
void Thread::_call_submit_signal()
|
||||
{
|
||||
/* lookup signal context */
|
||||
Signal_context * const c = pd().cap_tree().find<Signal_context>(user_arg_1());
|
||||
Signal_context * const c = pd().cap_tree().find<Signal_context>((Kernel::capid_t)user_arg_1());
|
||||
if(!c) {
|
||||
/* cannot submit unknown signal context */
|
||||
user_arg_0(-1);
|
||||
@ -628,12 +628,12 @@ void Thread::_call_submit_signal()
|
||||
}
|
||||
|
||||
/* trigger signal context */
|
||||
if (!c->can_submit(user_arg_2())) {
|
||||
if (!c->can_submit((unsigned)user_arg_2())) {
|
||||
Genode::raw("failed to submit signal context");
|
||||
user_arg_0(-1);
|
||||
return;
|
||||
}
|
||||
c->submit(user_arg_2());
|
||||
c->submit((unsigned)user_arg_2());
|
||||
user_arg_0(0);
|
||||
}
|
||||
|
||||
@ -641,7 +641,7 @@ void Thread::_call_submit_signal()
|
||||
void Thread::_call_ack_signal()
|
||||
{
|
||||
/* lookup signal context */
|
||||
Signal_context * const c = pd().cap_tree().find<Signal_context>(user_arg_1());
|
||||
Signal_context * const c = pd().cap_tree().find<Signal_context>((Kernel::capid_t)user_arg_1());
|
||||
if (!c) {
|
||||
Genode::raw(*this, ": cannot ack unknown signal context");
|
||||
return;
|
||||
@ -655,7 +655,7 @@ void Thread::_call_ack_signal()
|
||||
void Thread::_call_kill_signal_context()
|
||||
{
|
||||
/* lookup signal context */
|
||||
Signal_context * const c = pd().cap_tree().find<Signal_context>(user_arg_1());
|
||||
Signal_context * const c = pd().cap_tree().find<Signal_context>((Kernel::capid_t)user_arg_1());
|
||||
if (!c) {
|
||||
Genode::raw(*this, ": cannot kill unknown signal context");
|
||||
user_arg_0(-1);
|
||||
@ -674,7 +674,7 @@ void Thread::_call_kill_signal_context()
|
||||
|
||||
void Thread::_call_new_irq()
|
||||
{
|
||||
Signal_context * const c = pd().cap_tree().find<Signal_context>(user_arg_4());
|
||||
Signal_context * const c = pd().cap_tree().find<Signal_context>((Kernel::capid_t)user_arg_4());
|
||||
if (!c) {
|
||||
Genode::raw(*this, ": invalid signal context for interrupt");
|
||||
user_arg_0(-1);
|
||||
@ -699,7 +699,7 @@ void Thread::_call_ack_irq() {
|
||||
void Thread::_call_new_obj()
|
||||
{
|
||||
/* lookup thread */
|
||||
Object_identity_reference * ref = pd().cap_tree().find(user_arg_2());
|
||||
Object_identity_reference * ref = pd().cap_tree().find((Kernel::capid_t)user_arg_2());
|
||||
Thread * thread = ref ? ref->object<Thread>() : nullptr;
|
||||
if (!thread ||
|
||||
(static_cast<Core_object<Thread>*>(thread)->capid() != ref->capid())) {
|
||||
@ -726,14 +726,14 @@ void Thread::_call_delete_obj()
|
||||
|
||||
void Thread::_call_ack_cap()
|
||||
{
|
||||
Object_identity_reference * oir = pd().cap_tree().find(user_arg_1());
|
||||
Object_identity_reference * oir = pd().cap_tree().find((Kernel::capid_t)user_arg_1());
|
||||
if (oir) oir->remove_from_utcb();
|
||||
}
|
||||
|
||||
|
||||
void Thread::_call_delete_cap()
|
||||
{
|
||||
Object_identity_reference * oir = pd().cap_tree().find(user_arg_1());
|
||||
Object_identity_reference * oir = pd().cap_tree().find((Kernel::capid_t)user_arg_1());
|
||||
if (!oir) return;
|
||||
|
||||
if (oir->in_utcb()) return;
|
||||
@ -766,7 +766,7 @@ void Thread::_call()
|
||||
try {
|
||||
|
||||
/* switch over unrestricted kernel calls */
|
||||
unsigned const call_id = user_arg_0();
|
||||
unsigned const call_id = (unsigned)user_arg_0();
|
||||
switch (call_id) {
|
||||
case call_id_cache_coherent_region(): _call_cache_coherent_region(); return;
|
||||
case call_id_cache_clean_inv_region(): _call_cache_clean_invalidate_data_region(); return;
|
||||
|
@ -356,8 +356,9 @@ class Kernel::Thread : private Kernel::Object, public Cpu_job, private Timeout
|
||||
size_t const quota,
|
||||
char const * const label)
|
||||
{
|
||||
return call(call_id_new_thread(), (Call_arg)&t, (Call_arg)priority,
|
||||
(Call_arg)quota, (Call_arg)label);
|
||||
return (capid_t)call(call_id_new_thread(), (Call_arg)&t,
|
||||
(Call_arg)priority, (Call_arg)quota,
|
||||
(Call_arg)label);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -371,8 +372,8 @@ class Kernel::Thread : private Kernel::Object, public Cpu_job, private Timeout
|
||||
static capid_t syscall_create(Genode::Kernel_object<Thread> & t,
|
||||
char const * const label)
|
||||
{
|
||||
return call(call_id_new_core_thread(), (Call_arg)&t,
|
||||
(Call_arg)label);
|
||||
return (capid_t)call(call_id_new_core_thread(), (Call_arg)&t,
|
||||
(Call_arg)label);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -101,8 +101,8 @@ class Kernel::Vm : private Kernel::Object, public Cpu_job
|
||||
capid_t const signal_context_id,
|
||||
Identity & id)
|
||||
{
|
||||
return call(call_id_new_vm(), (Call_arg)&vm, (Call_arg)cpu,
|
||||
(Call_arg)state, (Call_arg)&id, signal_context_id);
|
||||
return (capid_t)call(call_id_new_vm(), (Call_arg)&vm, (Call_arg)cpu,
|
||||
(Call_arg)state, (Call_arg)&id, signal_context_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -19,7 +19,7 @@
|
||||
void Kernel::Thread::_call_new_vm()
|
||||
{
|
||||
Signal_context * context =
|
||||
pd().cap_tree().find<Signal_context>(user_arg_5());
|
||||
pd().cap_tree().find<Signal_context>((capid_t)user_arg_5());
|
||||
if (!context) {
|
||||
user_arg_0(cap_id_invalid());
|
||||
return;
|
||||
@ -36,7 +36,7 @@ void Kernel::Thread::_call_delete_vm() { _call_delete<Vm>(); }
|
||||
|
||||
void Kernel::Thread::_call_run_vm()
|
||||
{
|
||||
Object_identity_reference * ref = pd().cap_tree().find(user_arg_1());
|
||||
Object_identity_reference * ref = pd().cap_tree().find((capid_t)user_arg_1());
|
||||
Vm * vm = ref ? ref->object<Vm>() : nullptr;
|
||||
|
||||
if (!vm) {
|
||||
@ -52,7 +52,7 @@ void Kernel::Thread::_call_run_vm()
|
||||
|
||||
void Kernel::Thread::_call_pause_vm()
|
||||
{
|
||||
Object_identity_reference * ref = pd().cap_tree().find(user_arg_1());
|
||||
Object_identity_reference * ref = pd().cap_tree().find((capid_t)user_arg_1());
|
||||
Vm * vm = ref ? ref->object<Vm>() : nullptr;
|
||||
|
||||
if (!vm) {
|
||||
|
@ -300,11 +300,9 @@ Platform::Platform()
|
||||
** Support for core memory management **
|
||||
****************************************/
|
||||
|
||||
bool Mapped_mem_allocator::_map_local(addr_t virt_addr, addr_t phys_addr,
|
||||
unsigned size) {
|
||||
return ::map_local(phys_addr, virt_addr, size / get_page_size()); }
|
||||
bool Mapped_mem_allocator::_map_local(addr_t virt, addr_t phys, size_t size) {
|
||||
return ::map_local(phys, virt, size / get_page_size()); }
|
||||
|
||||
|
||||
bool Mapped_mem_allocator::_unmap_local(addr_t virt_addr, addr_t,
|
||||
unsigned size) {
|
||||
return ::unmap_local(virt_addr, size / get_page_size()); }
|
||||
bool Mapped_mem_allocator::_unmap_local(addr_t virt, addr_t, size_t size) {
|
||||
return ::unmap_local(virt, size / get_page_size()); }
|
||||
|
@ -54,7 +54,7 @@ Platform_thread::~Platform_thread()
|
||||
|
||||
void Platform_thread::quota(size_t const quota)
|
||||
{
|
||||
_quota = quota;
|
||||
_quota = (unsigned)quota;
|
||||
Kernel::thread_quota(*_kobj, quota);
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ Platform_thread::Platform_thread(size_t const quota,
|
||||
_pager(nullptr),
|
||||
_utcb_pd_addr((Native_utcb *)utcb),
|
||||
_priority(_scale_priority(virt_prio)),
|
||||
_quota(quota),
|
||||
_quota((unsigned)quota),
|
||||
_main_thread(false),
|
||||
_location(location),
|
||||
_kobj(_kobj.CALLED_FROM_CORE, _priority, _quota, _label.string())
|
||||
|
@ -71,7 +71,7 @@ struct Genode::Arm_cpu : public Hw::Arm_cpu
|
||||
|
||||
~Mmu_context();
|
||||
|
||||
uint8_t id() { return cidr; }
|
||||
uint8_t id() { return (uint8_t)cidr; }
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -24,7 +24,7 @@ unsigned Timer::interrupt_id() const { return Board::TIMER_IRQ; }
|
||||
unsigned long Board::Timer::_freq() { return Genode::Cpu::Cntfrq::read(); }
|
||||
|
||||
|
||||
Board::Timer::Timer(unsigned) : ticks_per_ms(_freq() / 1000)
|
||||
Board::Timer::Timer(unsigned) : ticks_per_ms((unsigned)(_freq() / 1000))
|
||||
{
|
||||
Cpu::Cntp_ctl::access_t ctl = 0;
|
||||
Cpu::Cntp_ctl::Enable::set(ctl, 1);
|
||||
@ -35,7 +35,7 @@ Board::Timer::Timer(unsigned) : ticks_per_ms(_freq() / 1000)
|
||||
void Timer::_start_one_shot(time_t const ticks)
|
||||
{
|
||||
_device.last_time = Cpu::Cntpct::read();
|
||||
Cpu::Cntp_tval::write(ticks);
|
||||
Cpu::Cntp_tval::write((Cpu::Cntp_tval::access_t)ticks);
|
||||
Cpu::Cntp_ctl::access_t ctl = Cpu::Cntp_ctl::read();
|
||||
Cpu::Cntp_ctl::Istatus::set(ctl, 0);
|
||||
Cpu::Cntp_ctl::write(ctl);
|
||||
|
@ -96,7 +96,7 @@ static Vmid_allocator &alloc()
|
||||
allocator = unmanaged_singleton<Vmid_allocator>();
|
||||
|
||||
/* reserve VM ID 0 for the hypervisor */
|
||||
unsigned id = allocator->alloc();
|
||||
addr_t id = allocator->alloc();
|
||||
assert (id == 0);
|
||||
}
|
||||
return *allocator;
|
||||
|
@ -96,7 +96,7 @@ struct Genode::Cpu : Hw::Arm_64_cpu
|
||||
~Mmu_context();
|
||||
|
||||
Genode::uint16_t id() {
|
||||
return Ttbr::Asid::get(ttbr); }
|
||||
return Ttbr::Asid::get(ttbr) & 0xffff; }
|
||||
};
|
||||
|
||||
void switch_to(Context&, Mmu_context &);
|
||||
|
@ -47,7 +47,7 @@ Mmu_context(addr_t page_table_base,
|
||||
|
||||
Mmu_context::~Mmu_context()
|
||||
{
|
||||
unsigned asid = Satp::Asid::get(satp);
|
||||
unsigned asid = (uint16_t)Satp::Asid::get(satp); /* ASID is 16 bit */
|
||||
Cpu::invalidate_tlb_by_pid(asid);
|
||||
_addr_space_id_alloc.free(asid);
|
||||
}
|
||||
|
@ -130,7 +130,9 @@ unsigned Genode::Cpu::executing_id()
|
||||
void * const stack_ptr = nullptr;
|
||||
addr_t const stack_addr = reinterpret_cast<addr_t>(&stack_ptr);
|
||||
addr_t const stack_base = reinterpret_cast<addr_t>(&kernel_stack);
|
||||
unsigned const cpu_id = (stack_addr - stack_base) / kernel_stack_size;
|
||||
|
||||
unsigned const cpu_id = (unsigned)((stack_addr - stack_base) / kernel_stack_size);
|
||||
|
||||
return cpu_id;
|
||||
}
|
||||
|
||||
|
@ -212,7 +212,7 @@ void Global_interrupt_controller::_update_irt_entry(unsigned irq)
|
||||
Irte::Trg::set(irte, _irq_mode[irq].trigger_mode);
|
||||
|
||||
write<Ioregsel>(IOREDTBL + 2 * irq);
|
||||
write<Iowin>(irte);
|
||||
write<Iowin>((Iowin::access_t)(irte));
|
||||
}
|
||||
|
||||
|
||||
@ -251,9 +251,9 @@ Global_interrupt_controller::Global_interrupt_controller()
|
||||
if (i < _irte_count) {
|
||||
Irte::access_t irte = _create_irt_entry(i);
|
||||
write<Ioregsel>(IOREDTBL + 2 * i + 1);
|
||||
write<Iowin>(irte >> Iowin::ACCESS_WIDTH);
|
||||
write<Iowin>((Iowin::access_t)(irte >> Iowin::ACCESS_WIDTH));
|
||||
write<Ioregsel>(IOREDTBL + 2 * i);
|
||||
write<Iowin>(irte);
|
||||
write<Iowin>((Iowin::access_t)(irte));
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -284,5 +284,5 @@ void Global_interrupt_controller::toggle_mask(unsigned const vector,
|
||||
write<Ioregsel>(IOREDTBL + (2 * irq));
|
||||
Irte::access_t irte = read<Iowin>();
|
||||
Irte::Mask::set(irte, set);
|
||||
write<Iowin>(irte);
|
||||
write<Iowin>((Iowin::access_t)(irte));
|
||||
}
|
||||
|
@ -51,6 +51,8 @@ class Board::Global_interrupt_controller : public Genode::Mmio
|
||||
{
|
||||
private:
|
||||
|
||||
using uint8_t = Genode::uint8_t;
|
||||
|
||||
enum {
|
||||
/* Register selectors */
|
||||
IOAPICVER = 0x01,
|
||||
@ -82,9 +84,9 @@ class Board::Global_interrupt_controller : public Genode::Mmio
|
||||
struct Maximum_redirection_entry : Bitfield<16, 8> { };
|
||||
};
|
||||
|
||||
unsigned _irte_count = 0; /* number of redirection table entries */
|
||||
Genode::uint8_t _lapic_id[NR_OF_CPUS]; /* unique name of the LAPIC of each CPU */
|
||||
Irq_mode _irq_mode[IRQ_COUNT];
|
||||
unsigned _irte_count = 0; /* number of redirection table entries */
|
||||
uint8_t _lapic_id[NR_OF_CPUS]; /* unique name of the LAPIC of each CPU */
|
||||
Irq_mode _irq_mode[IRQ_COUNT];
|
||||
|
||||
/**
|
||||
* Return whether 'irq' is an edge-triggered interrupt
|
||||
@ -137,10 +139,9 @@ class Board::Global_interrupt_controller : public Genode::Mmio
|
||||
** Accessors **
|
||||
***************/
|
||||
|
||||
void lapic_id(unsigned cpu_id,
|
||||
Genode::uint8_t lapic_id);
|
||||
void lapic_id(unsigned cpu_id, uint8_t lapic_id);
|
||||
|
||||
Genode::uint8_t lapic_id(unsigned cpu_id) const;
|
||||
uint8_t lapic_id(unsigned cpu_id) const;
|
||||
};
|
||||
|
||||
|
||||
@ -222,7 +223,7 @@ class Board::Local_interrupt_controller : public Genode::Mmio
|
||||
{
|
||||
if (cpu_id < NR_OF_CPUS) {
|
||||
Id::access_t const lapic_id = read<Id>();
|
||||
_global_irq_ctrl.lapic_id(cpu_id, (lapic_id >> 24) & 0xff);
|
||||
_global_irq_ctrl.lapic_id(cpu_id, (unsigned char)((lapic_id >> 24) & 0xff));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,10 +30,10 @@ uint32_t Board::Timer::pit_calc_timer_freq(void)
|
||||
{
|
||||
uint32_t t_start, t_end;
|
||||
|
||||
/* Set channel gate high and disable speaker */
|
||||
outb(PIT_CH2_GATE, (inb(0x61) & ~0x02) | 0x01);
|
||||
/* set channel gate high and disable speaker */
|
||||
outb(PIT_CH2_GATE, (uint8_t)((inb(0x61) & ~0x02) | 0x01));
|
||||
|
||||
/* Set timer counter (mode 0, binary count) */
|
||||
/* set timer counter (mode 0, binary count) */
|
||||
outb(PIT_MODE, 0xb0);
|
||||
outb(PIT_CH2_DATA, PIT_SLEEP_TICS & 0xff);
|
||||
outb(PIT_CH2_DATA, PIT_SLEEP_TICS >> 8);
|
||||
@ -57,7 +57,7 @@ Board::Timer::Timer(unsigned)
|
||||
:
|
||||
Mmio(Platform::mmio_to_virt(Hw::Cpu_memory_map::lapic_phys_base()))
|
||||
{
|
||||
/* Enable LAPIC timer in one-shot mode */
|
||||
/* enable LAPIC timer in one-shot mode */
|
||||
write<Tmr_lvt::Vector>(Board::TIMER_VECTOR_KERNEL);
|
||||
write<Tmr_lvt::Delivery>(0);
|
||||
write<Tmr_lvt::Mask>(0);
|
||||
@ -71,7 +71,7 @@ Board::Timer::Timer(unsigned)
|
||||
raw("Failed to calibrate timer frequency");
|
||||
throw Calibration_failed();
|
||||
}
|
||||
write<Divide_configuration::Divide_value>(div);
|
||||
write<Divide_configuration::Divide_value>((uint8_t)div);
|
||||
|
||||
/* Calculate timer frequency */
|
||||
ticks_per_ms = pit_calc_timer_freq();
|
||||
@ -88,7 +88,7 @@ Board::Timer::Timer(unsigned)
|
||||
|
||||
|
||||
void Timer::_start_one_shot(time_t const ticks) {
|
||||
_device.write<Board::Timer::Tmr_initial>(ticks); }
|
||||
_device.write<Board::Timer::Tmr_initial>((uint32_t)ticks); }
|
||||
|
||||
|
||||
time_t Timer::ticks_to_us(time_t const ticks) const {
|
||||
|
@ -27,8 +27,7 @@ namespace Genode { namespace Capability_space {
|
||||
*/
|
||||
static inline Kernel::capid_t capid(Native_capability const &cap)
|
||||
{
|
||||
addr_t const index = (addr_t)cap.data();
|
||||
return index;
|
||||
return (Kernel::capid_t)((addr_t)cap.data() & 0xffffU);
|
||||
}
|
||||
|
||||
static inline Native_capability import(Kernel::capid_t capid)
|
||||
|
@ -66,7 +66,7 @@ class Hw::Page_table_allocator
|
||||
{
|
||||
static_assert((sizeof(TABLE) == TABLE_SIZE), "unexpected size");
|
||||
table.~TABLE();
|
||||
_free(_offset(table) / sizeof(TABLE));
|
||||
_free((unsigned)(_offset(table) / sizeof(TABLE)));
|
||||
}
|
||||
};
|
||||
|
||||
@ -114,7 +114,7 @@ class Hw::Page_table_allocator<TABLE_SIZE>::Array<COUNT>::Allocator
|
||||
unsigned _alloc() override
|
||||
{
|
||||
try {
|
||||
return _free_tables.alloc();
|
||||
return (unsigned)_free_tables.alloc();
|
||||
} catch (typename Bit_allocator::Out_of_indices&) {}
|
||||
throw Out_of_tables();
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ struct Hw::Arm_64_cpu
|
||||
|
||||
struct Iss : Bitfield<0, 25>
|
||||
{
|
||||
struct Abort : Register<32>
|
||||
struct Abort : Register<64>
|
||||
{
|
||||
struct Level : Bitfield<0, 2> {};
|
||||
struct Fsc : Bitfield<2, 4>
|
||||
@ -231,7 +231,7 @@ struct Hw::Arm_64_cpu
|
||||
struct Asid : Bitfield<48, 8> { };
|
||||
);
|
||||
|
||||
static inline unsigned current_privilege_level() {
|
||||
static Current_el::access_t current_privilege_level() {
|
||||
return Current_el::El::get(Current_el::read()); }
|
||||
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
#include <hw/spec/arm/psci.h>
|
||||
|
||||
#define PSCI_CALL_IMPL(instr) \
|
||||
static inline int call(unsigned int func, unsigned long a0, \
|
||||
unsigned int a1, unsigned int a2) { \
|
||||
static inline int call(Genode::umword_t func, Genode::umword_t a0, \
|
||||
Genode::umword_t a1, Genode::umword_t a2) { \
|
||||
unsigned long result = 0; \
|
||||
asm volatile ("mov x0, %1 \n" \
|
||||
"mov x1, %2 \n" \
|
||||
@ -30,7 +30,7 @@
|
||||
: "r"(func), "r"(a0), "r"(a1), "r"(a2) \
|
||||
: "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", \
|
||||
"x8", "x9", "x10", "x11", "x12", "x13", "x14"); \
|
||||
return result; \
|
||||
return (int)result; \
|
||||
}
|
||||
|
||||
namespace Hw {
|
||||
|
@ -181,7 +181,7 @@ class Sv39::Level_x_translation_table
|
||||
* Return how many entries of an alignment fit into region
|
||||
*/
|
||||
static constexpr size_t _count(size_t region, size_t alignment) {
|
||||
return align_addr<size_t>(region, alignment) / (1UL << alignment); }
|
||||
return align_addr<size_t>(region, (unsigned)alignment) / (1UL << alignment); }
|
||||
|
||||
|
||||
template <typename FUNC>
|
||||
|
@ -87,7 +87,7 @@ void Hw::for_each_rsdt_entry(Hw::Acpi_generic &rsdt, FUNC fn)
|
||||
typedef Genode::uint32_t entry_t;
|
||||
|
||||
unsigned const table_size = rsdt.size;
|
||||
unsigned const entry_count = (table_size - sizeof(rsdt)) / sizeof(entry_t);
|
||||
unsigned const entry_count = (unsigned)((table_size - sizeof(rsdt)) / sizeof(entry_t));
|
||||
|
||||
entry_t * entries = reinterpret_cast<entry_t *>(&rsdt + 1);
|
||||
for (unsigned i = 0; i < entry_count; i++)
|
||||
@ -104,7 +104,7 @@ void Hw::for_each_xsdt_entry(Hw::Acpi_generic &xsdt, FUNC fn)
|
||||
typedef Genode::uint64_t entry_t;
|
||||
|
||||
unsigned const table_size = xsdt.size;
|
||||
unsigned const entry_count = (table_size - sizeof(xsdt)) / sizeof(entry_t);
|
||||
unsigned const entry_count = (unsigned)((table_size - sizeof(xsdt)) / sizeof(entry_t));
|
||||
|
||||
entry_t * entries = reinterpret_cast<entry_t *>(&xsdt + 1);
|
||||
for (unsigned i = 0; i < entry_count; i++)
|
||||
|
@ -618,7 +618,7 @@ class Hw::Pml4_table
|
||||
*/
|
||||
static constexpr size_t _count(size_t region, size_t alignment)
|
||||
{
|
||||
return Genode::align_addr<size_t>(region, alignment)
|
||||
return Genode::align_addr<size_t>(region, (int)alignment)
|
||||
/ (1UL << alignment);
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,10 @@ void Native_capability::_dec()
|
||||
return;
|
||||
|
||||
spinlock_lock(&spinlock);
|
||||
if (!--ref_counter[(addr_t)_data]) { Kernel::delete_cap((addr_t)_data); }
|
||||
|
||||
if (!--ref_counter[(addr_t)_data])
|
||||
Kernel::delete_cap((Kernel::capid_t)((addr_t)_data & 0xffff));
|
||||
|
||||
spinlock_unlock(&spinlock);
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,9 @@ Rpc_exception_code Genode::ipc_call(Native_capability dst,
|
||||
|
||||
copy_msg_to_utcb(snd_msg, *Thread::myself()->utcb());
|
||||
|
||||
switch (Kernel::send_request_msg(Capability_space::capid(dst), rcv_caps)) {
|
||||
switch (Kernel::send_request_msg(Capability_space::capid(dst),
|
||||
(unsigned)rcv_caps)) {
|
||||
|
||||
case -1: throw Blocking_canceled();
|
||||
case -2: throw Allocator::Out_of_memory();
|
||||
default:
|
||||
@ -111,7 +113,7 @@ Rpc_exception_code Genode::ipc_call(Native_capability dst,
|
||||
},
|
||||
[&] () { upgrade_capability_slab(); });
|
||||
|
||||
return Rpc_exception_code(utcb.exception_code());
|
||||
return Rpc_exception_code((int)utcb.exception_code());
|
||||
}
|
||||
|
||||
|
||||
|
@ -59,7 +59,7 @@ unsigned share_id(void * const pointer)
|
||||
addr_t const base = (addr_t)data()->shares;
|
||||
if (address < base || address >= base + sizeof(data()->shares)) {
|
||||
return 0; }
|
||||
return (address - base) / sizeof(Cpu_share) + 1;
|
||||
return (unsigned)((address - base) / sizeof(Cpu_share) + 1);
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,16 +39,16 @@ Timer::Time_source::Time_source(Env &env)
|
||||
void Timer::Time_source::set_timeout(Microseconds duration,
|
||||
Timeout_handler &handler)
|
||||
{
|
||||
Kernel::timeout_t duration_us = duration.value;
|
||||
Kernel::timeout_t duration_us = (Kernel::timeout_t)duration.value;
|
||||
if (duration_us < MIN_TIMEOUT_US) {
|
||||
duration_us = MIN_TIMEOUT_US; }
|
||||
|
||||
if (duration_us > _max_timeout_us) {
|
||||
duration_us = _max_timeout_us; }
|
||||
duration_us = (Kernel::timeout_t)_max_timeout_us; }
|
||||
|
||||
_handler = &handler;
|
||||
Signal_context_capability cap = _signal_handler;
|
||||
Kernel::timeout(duration_us, (addr_t)cap.data());
|
||||
Kernel::timeout(duration_us, (Kernel::capid_t)((addr_t)cap.data() & 0xffff));
|
||||
}
|
||||
|
||||
|
||||
|
@ -32,19 +32,19 @@
|
||||
|
||||
inline int lx_mkdir(char const *pathname, mode_t mode)
|
||||
{
|
||||
return lx_syscall(SYS_mkdirat, AT_FDCWD, pathname, mode);
|
||||
return (int)lx_syscall(SYS_mkdirat, AT_FDCWD, pathname, mode);
|
||||
}
|
||||
|
||||
|
||||
inline int lx_ftruncate(int fd, unsigned long length)
|
||||
{
|
||||
return lx_syscall(SYS_ftruncate, fd, length);
|
||||
return (int)lx_syscall(SYS_ftruncate, fd, length);
|
||||
}
|
||||
|
||||
|
||||
inline int lx_unlink(const char *fname)
|
||||
{
|
||||
return lx_syscall(SYS_unlinkat, AT_FDCWD, fname, 0);
|
||||
return (int)lx_syscall(SYS_unlinkat, AT_FDCWD, fname, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ inline int lx_unlink(const char *fname)
|
||||
|
||||
inline int lx_open(char const *pathname, int flags, mode_t mode = 0)
|
||||
{
|
||||
return lx_syscall(SYS_openat, AT_FDCWD, pathname, flags, mode);
|
||||
return (int)lx_syscall(SYS_openat, AT_FDCWD, pathname, flags, mode);
|
||||
}
|
||||
|
||||
|
||||
@ -62,16 +62,16 @@ inline int lx_stat_size(char const *path, Genode::uint64_t &out_size)
|
||||
{
|
||||
#ifdef __aarch64__
|
||||
struct statx buf { };
|
||||
int result = lx_syscall(SYS_statx, AT_FDCWD, path, 0, STATX_SIZE, &buf);
|
||||
int result = (int)lx_syscall(SYS_statx, AT_FDCWD, path, 0, STATX_SIZE, &buf);
|
||||
out_size = buf.stx_size;
|
||||
#else
|
||||
#ifdef _LP64
|
||||
struct stat buf { };
|
||||
int result = lx_syscall(SYS_stat, path, &buf);
|
||||
int result = (int)lx_syscall(SYS_stat, path, &buf);
|
||||
out_size = buf.st_size;
|
||||
#else
|
||||
struct stat64 buf { };
|
||||
int result = lx_syscall(SYS_stat64, path, &buf);
|
||||
int result = (int)lx_syscall(SYS_stat64, path, &buf);
|
||||
out_size = buf.st_size;
|
||||
#endif
|
||||
#endif
|
||||
@ -86,7 +86,7 @@ inline int lx_stat_size(char const *path, Genode::uint64_t &out_size)
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
inline int lx_iopl(int level)
|
||||
{
|
||||
return lx_syscall(SYS_iopl, level);
|
||||
return (int)lx_syscall(SYS_iopl, level);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -103,13 +103,13 @@ inline int lx_ioctl_iomem(int fd, unsigned long phys, Genode::size_t offset)
|
||||
Genode::size_t length;
|
||||
} range = {phys, offset};
|
||||
|
||||
return lx_syscall(SYS_ioctl, fd, _IOW('g', 1, void *), &range);
|
||||
return (int)lx_syscall(SYS_ioctl, fd, _IOW('g', 1, void *), &range);
|
||||
}
|
||||
|
||||
|
||||
inline int lx_ioctl_irq(int fd, int irq)
|
||||
{
|
||||
return lx_syscall(SYS_ioctl, fd, _IOW('g', 2, int*), &irq);
|
||||
return (int)lx_syscall(SYS_ioctl, fd, _IOW('g', 2, int*), &irq);
|
||||
}
|
||||
|
||||
|
||||
@ -120,13 +120,13 @@ inline int lx_ioctl_irq(int fd, int irq)
|
||||
inline int lx_execve(const char *filename, char *const argv[],
|
||||
char *const envp[])
|
||||
{
|
||||
return lx_syscall(SYS_execve, filename, argv, envp);
|
||||
return (int)lx_syscall(SYS_execve, filename, argv, envp);
|
||||
}
|
||||
|
||||
|
||||
inline int lx_kill(int pid, int signal)
|
||||
{
|
||||
return lx_syscall(SYS_kill, pid, signal);
|
||||
return (int)lx_syscall(SYS_kill, pid, signal);
|
||||
}
|
||||
|
||||
|
||||
@ -138,19 +138,19 @@ inline int lx_create_process(int (*entry)(), void *stack)
|
||||
* this condition.
|
||||
*/
|
||||
int const flags = CLONE_VFORK | LX_SIGCHLD;
|
||||
return lx_clone((int (*)())entry, stack, flags);
|
||||
return (int)lx_clone((int (*)())entry, stack, flags);
|
||||
}
|
||||
|
||||
|
||||
inline int lx_setuid(unsigned int uid)
|
||||
{
|
||||
return lx_syscall(SYS_setuid, uid);
|
||||
return (int)lx_syscall(SYS_setuid, uid);
|
||||
}
|
||||
|
||||
|
||||
inline int lx_setgid(unsigned int gid)
|
||||
{
|
||||
return lx_syscall(SYS_setgid, gid);
|
||||
return (int)lx_syscall(SYS_setgid, gid);
|
||||
}
|
||||
|
||||
|
||||
@ -164,7 +164,7 @@ inline int lx_setgid(unsigned int gid)
|
||||
*/
|
||||
inline int lx_pollpid()
|
||||
{
|
||||
return lx_syscall(SYS_wait4, -1 /* any PID */, (int *)0, 1 /* WNOHANG */, 0);
|
||||
return (int)lx_syscall(SYS_wait4, -1 /* any PID */, (int *)0, 1 /* WNOHANG */, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -193,7 +193,7 @@ inline void lx_boost_rlimit()
|
||||
{
|
||||
rlimit rlimit { };
|
||||
|
||||
if (int const res = lx_syscall(SYS_getrlimit, RLIMIT_NOFILE, &rlimit)) {
|
||||
if (int const res = (int)lx_syscall(SYS_getrlimit, RLIMIT_NOFILE, &rlimit)) {
|
||||
Genode::warning("unable to obtain RLIMIT_NOFILE (", res, "), keeping limit unchanged");
|
||||
return;
|
||||
}
|
||||
@ -201,7 +201,7 @@ inline void lx_boost_rlimit()
|
||||
/* increase soft limit to hard limit */
|
||||
rlimit.rlim_cur = rlimit.rlim_max;
|
||||
|
||||
if (int const res = lx_syscall(SYS_setrlimit, RLIMIT_NOFILE, &rlimit))
|
||||
if (int const res = (int)lx_syscall(SYS_setrlimit, RLIMIT_NOFILE, &rlimit))
|
||||
Genode::warning("unable to boost RLIMIT_NOFILE (", res, "), keeping limit unchanged");
|
||||
}
|
||||
|
||||
@ -215,7 +215,7 @@ inline void lx_boost_rlimit()
|
||||
inline int lx_socket(int domain, int type, int protocol)
|
||||
{
|
||||
long args[3] = { domain, type, protocol };
|
||||
return lx_socketcall(SYS_SOCKET, args);
|
||||
return (int)lx_socketcall(SYS_SOCKET, args);
|
||||
}
|
||||
|
||||
|
||||
@ -223,7 +223,7 @@ inline int lx_bind(int sockfd, const struct sockaddr *addr,
|
||||
socklen_t addrlen)
|
||||
{
|
||||
long args[3] = { sockfd, (long)addr, (long)addrlen };
|
||||
return lx_socketcall(SYS_BIND, args);
|
||||
return (int)lx_socketcall(SYS_BIND, args);
|
||||
}
|
||||
|
||||
|
||||
@ -231,28 +231,28 @@ inline int lx_connect(int sockfd, const struct sockaddr *serv_addr,
|
||||
socklen_t addrlen)
|
||||
{
|
||||
long args[3] = { sockfd, (long)serv_addr, (long)addrlen };
|
||||
return lx_socketcall(SYS_CONNECT, args);
|
||||
return (int)lx_socketcall(SYS_CONNECT, args);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
inline int lx_socket(int domain, int type, int protocol)
|
||||
{
|
||||
return lx_syscall(SYS_socket, domain, type, protocol);
|
||||
return (int)lx_syscall(SYS_socket, domain, type, protocol);
|
||||
}
|
||||
|
||||
|
||||
inline int lx_bind(int sockfd, const struct sockaddr *addr,
|
||||
socklen_t addrlen)
|
||||
{
|
||||
return lx_syscall(SYS_bind, sockfd, addr, addrlen);
|
||||
return (int)lx_syscall(SYS_bind, sockfd, addr, addrlen);
|
||||
}
|
||||
|
||||
|
||||
inline int lx_connect(int sockfd, const struct sockaddr *serv_addr,
|
||||
socklen_t addrlen)
|
||||
{
|
||||
return lx_syscall(SYS_connect, sockfd, serv_addr, addrlen);
|
||||
return (int)lx_syscall(SYS_connect, sockfd, serv_addr, addrlen);
|
||||
}
|
||||
|
||||
#endif /* SYS_socketcall */
|
||||
@ -264,13 +264,13 @@ inline int lx_connect(int sockfd, const struct sockaddr *serv_addr,
|
||||
|
||||
inline int lx_pipe(int pipefd[2])
|
||||
{
|
||||
return lx_syscall(SYS_pipe2, pipefd, 0);
|
||||
return (int)lx_syscall(SYS_pipe2, pipefd, 0);
|
||||
}
|
||||
|
||||
|
||||
inline int lx_read(int fd, void *buf, Genode::size_t count)
|
||||
{
|
||||
return lx_syscall(SYS_read, fd, buf, count);
|
||||
return (int)lx_syscall(SYS_read, fd, buf, count);
|
||||
}
|
||||
|
||||
#endif /* _CORE__INCLUDE__CORE_LINUX_SYSCALLS_H_ */
|
||||
|
@ -190,7 +190,7 @@ Native_pd_component::Native_pd_component(Pd_session_component &pd, const char *)
|
||||
Native_pd_component::~Native_pd_component()
|
||||
{
|
||||
if (_pid)
|
||||
lx_kill(_pid, 9);
|
||||
lx_kill((int)_pid, 9);
|
||||
|
||||
_pd_session._ep.dissolve(this);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ size_t Dataspace_component::_file_size()
|
||||
if (lx_stat_size(_fname.buf, size) < 0)
|
||||
throw Service_denied();
|
||||
|
||||
return align_addr(size, 12);
|
||||
return align_addr((size_t)size, 12);
|
||||
}
|
||||
|
||||
|
||||
|
@ -121,7 +121,7 @@ class Genode::Capability_space_tpl : Noncopyable
|
||||
unsigned _index(Data const &data) const
|
||||
{
|
||||
addr_t const offset = (addr_t)&data - (addr_t)_caps_data;
|
||||
return offset / sizeof(_caps_data[0]);
|
||||
return (unsigned)(offset / sizeof(_caps_data[0]));
|
||||
}
|
||||
|
||||
Data *_lookup_unsynchronized(Rpc_obj_key key) const
|
||||
@ -186,7 +186,7 @@ class Genode::Capability_space_tpl : Noncopyable
|
||||
* object.
|
||||
*/
|
||||
if (!data.dst.foreign)
|
||||
lx_close(data.rpc_obj_key().value());
|
||||
lx_close((int)data.rpc_obj_key().value());
|
||||
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ namespace {
|
||||
if (!cmsg)
|
||||
return 0;
|
||||
|
||||
return (cmsg->cmsg_len - CMSG_ALIGN(sizeof(cmsghdr)))/sizeof(int);
|
||||
return (unsigned)((cmsg->cmsg_len - CMSG_ALIGN(sizeof(cmsghdr)))/sizeof(int));
|
||||
}
|
||||
};
|
||||
|
||||
@ -352,7 +352,7 @@ Rpc_exception_code Genode::ipc_call(Native_capability dst,
|
||||
|
||||
extract_sds_from_message(0, rcv_msg, rcv_header, rcv_msgbuf);
|
||||
|
||||
return Rpc_exception_code(rcv_header.protocol_word);
|
||||
return Rpc_exception_code((int)rcv_header.protocol_word);
|
||||
}
|
||||
|
||||
|
||||
|
@ -203,7 +203,7 @@ Native_capability Native_thread::Epoll::alloc_rpc_cap()
|
||||
|
||||
void Native_thread::Epoll::free_rpc_cap(Native_capability cap)
|
||||
{
|
||||
int const local_socket = Capability_space::ipc_cap_data(cap).rpc_obj_key.value();
|
||||
int const local_socket = (int)Capability_space::ipc_cap_data(cap).rpc_obj_key.value();
|
||||
|
||||
_exec_control([&] () { _remove(Lx_sd{local_socket}); });
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ void Genode::binary_ready_hook_for_platform()
|
||||
};
|
||||
|
||||
uint64_t flags = SECCOMP_FILTER_FLAG_TSYNC;
|
||||
auto ret = lx_seccomp(SECCOMP_SET_MODE_FILTER, flags, &program);
|
||||
auto ret = lx_seccomp(SECCOMP_SET_MODE_FILTER, (int)flags, &program);
|
||||
if (ret != 0) {
|
||||
error("SECCOMP_SET_MODE_FILTER failed ", ret);
|
||||
throw Exception();
|
||||
|
@ -33,10 +33,13 @@
|
||||
*/
|
||||
|
||||
/* Linux includes */
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wconversion"
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
#pragma GCC diagnostic pop /* restore -Wconversion warnings */
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/thread.h>
|
||||
|
@ -46,6 +46,12 @@
|
||||
*/
|
||||
#define size_t __SIZE_TYPE__
|
||||
|
||||
/*
|
||||
* Disable -Wconversion warnings caused by host headers
|
||||
*/
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wconversion"
|
||||
|
||||
/* Linux includes */
|
||||
#include <sys/cdefs.h> /* include first to avoid double definition of '__always_inline' */
|
||||
#include <linux/futex.h>
|
||||
@ -60,6 +66,7 @@
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#pragma GCC diagnostic pop /* restore -Wconversion warnings */
|
||||
|
||||
#undef size_t
|
||||
|
||||
@ -92,32 +99,32 @@ extern "C" int lx_clone(int (*fn)(), void *child_stack, int flags);
|
||||
*****************************************/
|
||||
|
||||
|
||||
inline pid_t lx_getpid() { return lx_syscall(SYS_getpid); }
|
||||
inline pid_t lx_gettid() { return lx_syscall(SYS_gettid); }
|
||||
inline uid_t lx_getuid() { return lx_syscall(SYS_getuid); }
|
||||
inline pid_t lx_getpid() { return (pid_t)lx_syscall(SYS_getpid); }
|
||||
inline pid_t lx_gettid() { return (pid_t)lx_syscall(SYS_gettid); }
|
||||
inline uid_t lx_getuid() { return (uid_t)lx_syscall(SYS_getuid); }
|
||||
|
||||
|
||||
inline int lx_write(int fd, const void *buf, Genode::size_t count)
|
||||
{
|
||||
return lx_syscall(SYS_write, fd, buf, count);
|
||||
return (int)lx_syscall(SYS_write, fd, buf, count);
|
||||
}
|
||||
|
||||
|
||||
inline int lx_close(int fd)
|
||||
{
|
||||
return lx_syscall(SYS_close, fd);
|
||||
return (int)lx_syscall(SYS_close, fd);
|
||||
}
|
||||
|
||||
|
||||
inline int lx_dup(int fd)
|
||||
{
|
||||
return lx_syscall(SYS_dup, fd);
|
||||
return (int)lx_syscall(SYS_dup, fd);
|
||||
}
|
||||
|
||||
|
||||
inline int lx_dup2(int fd, int to)
|
||||
{
|
||||
return lx_syscall(SYS_dup3, fd, to, 0);
|
||||
return (int)lx_syscall(SYS_dup3, fd, to, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -192,19 +199,19 @@ inline int lx_recvmsg(Lx_sd sockfd, struct msghdr *msg, int flags)
|
||||
|
||||
inline int lx_socketpair(int domain, int type, int protocol, int sd[2])
|
||||
{
|
||||
return lx_syscall(SYS_socketpair, domain, type, protocol, (unsigned long)sd);
|
||||
return (int)lx_syscall(SYS_socketpair, domain, type, protocol, (unsigned long)sd);
|
||||
}
|
||||
|
||||
|
||||
inline int lx_sendmsg(Lx_sd sockfd, const struct msghdr *msg, int flags)
|
||||
{
|
||||
return lx_syscall(SYS_sendmsg, sockfd.value, msg, flags);
|
||||
return (int)lx_syscall(SYS_sendmsg, sockfd.value, msg, flags);
|
||||
}
|
||||
|
||||
|
||||
inline int lx_recvmsg(Lx_sd sockfd, struct msghdr *msg, int flags)
|
||||
{
|
||||
return lx_syscall(SYS_recvmsg, sockfd.value, msg, flags);
|
||||
return (int)lx_syscall(SYS_recvmsg, sockfd.value, msg, flags);
|
||||
}
|
||||
|
||||
/* TODO add missing socket system calls */
|
||||
@ -236,7 +243,7 @@ struct Lx_socketpair
|
||||
|
||||
inline Lx_epoll_sd lx_epoll_create()
|
||||
{
|
||||
int const ret = lx_syscall(SYS_epoll_create1, 0);
|
||||
int const ret = (int)lx_syscall(SYS_epoll_create1, 0);
|
||||
if (ret < 0) {
|
||||
/*
|
||||
* No recovery possible, just leave a diagnostic message and block
|
||||
@ -251,14 +258,14 @@ inline Lx_epoll_sd lx_epoll_create()
|
||||
|
||||
inline int lx_epoll_ctl(Lx_epoll_sd epoll, int op, Lx_sd fd, epoll_event *event)
|
||||
{
|
||||
return lx_syscall(SYS_epoll_ctl, epoll.value, op, fd.value, event);
|
||||
return (int)lx_syscall(SYS_epoll_ctl, epoll.value, op, fd.value, event);
|
||||
}
|
||||
|
||||
|
||||
inline int lx_epoll_wait(Lx_epoll_sd epoll, struct epoll_event *events,
|
||||
int maxevents, int timeout)
|
||||
{
|
||||
return lx_syscall(SYS_epoll_pwait, epoll.value, events, maxevents, timeout, 0);
|
||||
return (int)lx_syscall(SYS_epoll_pwait, epoll.value, events, maxevents, timeout, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -298,7 +305,7 @@ inline void *lx_mmap(void *start, Genode::size_t length, int prot, int flags,
|
||||
|
||||
inline int lx_munmap(void *addr, Genode::size_t length)
|
||||
{
|
||||
return lx_syscall(SYS_munmap, addr, length);
|
||||
return (int)lx_syscall(SYS_munmap, addr, length);
|
||||
}
|
||||
|
||||
|
||||
@ -376,7 +383,7 @@ inline int lx_sigaction(int signum, void (*handler)(int), bool altstack)
|
||||
|
||||
lx_sigemptyset(&act.mask);
|
||||
|
||||
return lx_syscall(SYS_rt_sigaction, signum, &act, 0UL, LX_NSIG/8);
|
||||
return (int)lx_syscall(SYS_rt_sigaction, signum, &act, 0UL, LX_NSIG/8);
|
||||
}
|
||||
|
||||
|
||||
@ -388,7 +395,7 @@ inline int lx_sigaction(int signum, void (*handler)(int), bool altstack)
|
||||
*/
|
||||
inline int lx_tgkill(int pid, int tid, int signal)
|
||||
{
|
||||
return lx_syscall(SYS_tgkill, pid, tid, signal);
|
||||
return (int)lx_syscall(SYS_tgkill, pid, tid, signal);
|
||||
}
|
||||
|
||||
|
||||
@ -399,7 +406,7 @@ inline int lx_sigaltstack(void *signal_stack, Genode::size_t stack_size)
|
||||
{
|
||||
stack_t stack { signal_stack, 0, stack_size };
|
||||
|
||||
return lx_syscall(SYS_sigaltstack, &stack, nullptr);
|
||||
return (int)lx_syscall(SYS_sigaltstack, &stack, nullptr);
|
||||
}
|
||||
|
||||
|
||||
@ -408,7 +415,7 @@ inline int lx_create_thread(void (*entry)(), void *stack)
|
||||
int flags = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND
|
||||
| CLONE_THREAD | CLONE_SYSVSEM;
|
||||
|
||||
return lx_clone((int (*)())entry, stack, flags);
|
||||
return (int)lx_clone((int (*)())entry, stack, flags);
|
||||
}
|
||||
|
||||
|
||||
@ -420,7 +427,7 @@ struct timespec;
|
||||
|
||||
inline int lx_nanosleep(const struct timespec *req, struct timespec *rem)
|
||||
{
|
||||
return lx_syscall(SYS_nanosleep, req, rem);
|
||||
return (int)lx_syscall(SYS_nanosleep, req, rem);
|
||||
}
|
||||
|
||||
|
||||
@ -431,7 +438,7 @@ enum {
|
||||
|
||||
inline int lx_futex(const int *uaddr, int op, int val)
|
||||
{
|
||||
return lx_syscall(SYS_futex, uaddr, op, val, 0, 0, 0);
|
||||
return (int)lx_syscall(SYS_futex, uaddr, op, val, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -523,13 +530,13 @@ inline bool lx_sigsetmask(int signum, bool state)
|
||||
inline int lx_prctl(int option, unsigned long arg2, unsigned long arg3,
|
||||
unsigned long arg4, unsigned long arg5)
|
||||
{
|
||||
return lx_syscall(SYS_prctl, option, arg2, arg3, arg4, arg5);
|
||||
return (int)lx_syscall(SYS_prctl, option, arg2, arg3, arg4, arg5);
|
||||
}
|
||||
|
||||
|
||||
inline int lx_seccomp(int option, int flag, void* program)
|
||||
{
|
||||
return lx_syscall(SYS_seccomp, option, flag, program);
|
||||
return (int)lx_syscall(SYS_seccomp, option, flag, program);
|
||||
}
|
||||
|
||||
#endif /* _LIB__SYSCALL__LINUX_SYSCALLS_H_ */
|
||||
|
@ -19,8 +19,11 @@
|
||||
#include "testlib.h"
|
||||
|
||||
/* Linux includes */
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wconversion"
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#pragma GCC diagnostic pop /* restore -Wconversion warnings */
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
|
@ -23,7 +23,7 @@ using namespace Genode;
|
||||
|
||||
|
||||
inline int lx_gettimeofday(struct timeval *tv, struct timeval *tz) {
|
||||
return lx_syscall(SYS_gettimeofday, tv, tz); }
|
||||
return (int)lx_syscall(SYS_gettimeofday, tv, tz); }
|
||||
|
||||
|
||||
Microseconds Timer::Time_source::max_timeout() const
|
||||
@ -44,8 +44,8 @@ Duration Timer::Time_source::curr_time()
|
||||
void Timer::Time_source::_usleep(uint64_t us)
|
||||
{
|
||||
struct timespec ts;
|
||||
ts.tv_sec = us / (1000 * 1000);
|
||||
ts.tv_nsec = (us % (1000 * 1000)) * 1000;
|
||||
ts.tv_sec = (long)us / (1000 * 1000);
|
||||
ts.tv_nsec = ((long)us % (1000 * 1000)) * 1000;
|
||||
|
||||
if (lx_nanosleep(&ts, &ts) != 0)
|
||||
throw Blocking_canceled();
|
||||
|
@ -94,13 +94,13 @@ namespace Genode {
|
||||
inline void inc()
|
||||
{
|
||||
if (_range)
|
||||
_range->inc(_local_name - _range->base());
|
||||
_range->inc((unsigned)(_local_name - _range->base()));
|
||||
}
|
||||
|
||||
inline void dec()
|
||||
{
|
||||
if (_range)
|
||||
_range->dec(_local_name - _range->base());
|
||||
_range->dec((unsigned)(_local_name - _range->base()));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -184,7 +184,7 @@ namespace Nova {
|
||||
if (!boot || !is_cpu_enabled(boot_cpu))
|
||||
return false;
|
||||
|
||||
map_cpus[cpu_i++] = boot_cpu;
|
||||
map_cpus[cpu_i++] = (uint8_t)boot_cpu;
|
||||
if (cpu_i >= num_cpus)
|
||||
return true;
|
||||
|
||||
@ -204,7 +204,7 @@ namespace Nova {
|
||||
c->thread == thread))
|
||||
continue;
|
||||
|
||||
map_cpus [cpu_i++] = i;
|
||||
map_cpus[cpu_i++] = (uint8_t)i;
|
||||
if (cpu_i >= num_cpus)
|
||||
return true;
|
||||
}
|
||||
@ -376,12 +376,12 @@ namespace Nova {
|
||||
return sel_hotspot << 12;
|
||||
}
|
||||
|
||||
mword_t addr() const { return base() << BASE_SHIFT; }
|
||||
mword_t base() const { return _query<BASE_MASK, BASE_SHIFT>(); }
|
||||
mword_t order() const { return _query<ORDER_MASK, ORDER_SHIFT>(); }
|
||||
bool is_null() const { return (_value & TYPE_MASK) == NULL_CRD_TYPE; }
|
||||
uint8_t type() const { return _query<TYPE_MASK, TYPE_SHIFT>(); }
|
||||
uint8_t rights() const { return _query<RIGHTS_MASK, RIGHTS_SHIFT>(); }
|
||||
mword_t addr() const { return base() << BASE_SHIFT; }
|
||||
mword_t base() const { return _query<BASE_MASK, BASE_SHIFT>(); }
|
||||
mword_t order() const { return _query<ORDER_MASK, ORDER_SHIFT>(); }
|
||||
bool is_null() const { return (_value & TYPE_MASK) == NULL_CRD_TYPE; }
|
||||
uint8_t type() const { return (uint8_t)_query<TYPE_MASK, TYPE_SHIFT>(); }
|
||||
uint8_t rights() const { return (uint8_t)_query<RIGHTS_MASK, RIGHTS_SHIFT>(); }
|
||||
} __attribute__((packed));
|
||||
|
||||
|
||||
@ -606,71 +606,73 @@ namespace Nova {
|
||||
};
|
||||
|
||||
#ifdef __x86_64__
|
||||
inline mword_t read_r8() { return r8; }
|
||||
inline void write_r8(mword_t value) { r8 = value; }
|
||||
inline mword_t read_r9() { return r9; }
|
||||
inline void write_r9(mword_t value) { r9 = value; }
|
||||
inline mword_t read_r10() { return r10; }
|
||||
inline void write_r10(mword_t value) { r10 = value; }
|
||||
inline mword_t read_r11() { return r11; }
|
||||
inline void write_r11(mword_t value) { r11 = value; }
|
||||
inline mword_t read_r12() { return r12; }
|
||||
inline void write_r12(mword_t value) { r12 = value; }
|
||||
inline mword_t read_r13() { return r13; }
|
||||
inline void write_r13(mword_t value) { r13 = value; }
|
||||
inline mword_t read_r14() { return r14; }
|
||||
inline void write_r14(mword_t value) { r14 = value; }
|
||||
inline mword_t read_r15() { return r15; }
|
||||
inline void write_r15(mword_t value) { r15 = value; }
|
||||
inline mword_t read_efer() { return efer; }
|
||||
inline void write_efer(mword_t value) { efer = value; }
|
||||
inline mword_t read_star() { return star; }
|
||||
inline void write_star(mword_t value) { star = value; }
|
||||
inline mword_t read_lstar() { return lstar; }
|
||||
inline void write_lstar(mword_t value) { lstar = value; }
|
||||
inline mword_t read_cstar() { return cstar; }
|
||||
inline void write_cstar(mword_t value) { cstar = value; }
|
||||
inline mword_t read_fmask() { return fmask; }
|
||||
inline void write_fmask(mword_t value) { fmask = value; }
|
||||
inline mword_t read_kernel_gs_base() { return kernel_gs_base; }
|
||||
inline void write_kernel_gs_base(mword_t value) { kernel_gs_base = value; }
|
||||
inline uint32_t read_tpr() { return tpr; }
|
||||
inline void write_tpr(uint32_t value) { tpr = value; }
|
||||
inline uint32_t read_tpr_threshold() { return tpr_threshold; }
|
||||
inline void write_tpr_threshold(uint32_t value) { tpr_threshold = value; }
|
||||
uint64_t read_r8() const { return r8; }
|
||||
uint64_t read_r9() const { return r9; }
|
||||
uint64_t read_r10() const { return r10; }
|
||||
uint64_t read_r11() const { return r11; }
|
||||
uint64_t read_r12() const { return r12; }
|
||||
uint64_t read_r13() const { return r13; }
|
||||
uint64_t read_r14() const { return r14; }
|
||||
uint64_t read_r15() const { return r15; }
|
||||
mword_t read_efer() const { return efer; }
|
||||
uint64_t read_star() const { return star; }
|
||||
uint64_t read_lstar() const { return lstar; }
|
||||
uint64_t read_cstar() const { return cstar; }
|
||||
uint64_t read_fmask() const { return fmask; }
|
||||
uint64_t read_kernel_gs_base() const { return kernel_gs_base; }
|
||||
uint32_t read_tpr() const { return tpr; }
|
||||
uint32_t read_tpr_threshold() const { return tpr_threshold; }
|
||||
|
||||
void write_r8 (uint64_t value) { r8 = value; }
|
||||
void write_r9 (uint64_t value) { r9 = value; }
|
||||
void write_r10 (uint64_t value) { r10 = value; }
|
||||
void write_r11 (uint64_t value) { r11 = value; }
|
||||
void write_r12 (uint64_t value) { r12 = value; }
|
||||
void write_r13 (uint64_t value) { r13 = value; }
|
||||
void write_r14 (uint64_t value) { r14 = value; }
|
||||
void write_r15 (uint64_t value) { r15 = value; }
|
||||
void write_efer (mword_t value) { efer = value; }
|
||||
void write_star (uint64_t value) { star = value; }
|
||||
void write_lstar (uint64_t value) { lstar = value; }
|
||||
void write_cstar (uint64_t value) { cstar = value; }
|
||||
void write_fmask (uint64_t value) { fmask = value; }
|
||||
void write_kernel_gs_base (uint64_t value) { kernel_gs_base = value; }
|
||||
void write_tpr (uint32_t value) { tpr = value; }
|
||||
void write_tpr_threshold (uint32_t value) { tpr_threshold = value; }
|
||||
#else
|
||||
inline mword_t read_r8() { return 0UL; }
|
||||
inline void write_r8(mword_t) { }
|
||||
inline mword_t read_r9() { return 0UL; }
|
||||
inline void write_r9(mword_t) { }
|
||||
inline mword_t read_r10() { return 0UL; }
|
||||
inline void write_r10(mword_t) { }
|
||||
inline mword_t read_r11() { return 0UL; }
|
||||
inline void write_r11(mword_t) { }
|
||||
inline mword_t read_r12() { return 0UL; }
|
||||
inline void write_r12(mword_t) { }
|
||||
inline mword_t read_r13() { return 0UL; }
|
||||
inline void write_r13(mword_t) { }
|
||||
inline mword_t read_r14() { return 0UL; }
|
||||
inline void write_r14(mword_t) { }
|
||||
inline mword_t read_r15() { return 0UL; }
|
||||
inline void write_r15(mword_t) { }
|
||||
inline mword_t read_efer() { return 0UL; }
|
||||
inline void write_efer(mword_t) { }
|
||||
inline mword_t read_star() { return 0UL; }
|
||||
inline void write_star(mword_t) { }
|
||||
inline mword_t read_lstar() { return 0UL; }
|
||||
inline void write_lstar(mword_t) { }
|
||||
inline mword_t read_cstar() { return 0UL; }
|
||||
inline void write_cstar(mword_t) { }
|
||||
inline mword_t read_fmask() { return 0UL; }
|
||||
inline void write_fmask(mword_t) { }
|
||||
inline mword_t read_kernel_gs_base() { return 0UL; }
|
||||
inline void write_kernel_gs_base(mword_t) { }
|
||||
inline uint32_t read_tpr() { return 0; }
|
||||
inline void write_tpr(uint32_t) { }
|
||||
inline uint32_t read_tpr_threshold() { return 0; }
|
||||
inline void write_tpr_threshold(uint32_t) { }
|
||||
uint64_t read_r8() const { return 0; }
|
||||
uint64_t read_r9() const { return 0; }
|
||||
uint64_t read_r10() const { return 0; }
|
||||
uint64_t read_r11() const { return 0; }
|
||||
uint64_t read_r12() const { return 0; }
|
||||
uint64_t read_r13() const { return 0; }
|
||||
uint64_t read_r14() const { return 0; }
|
||||
uint64_t read_r15() const { return 0; }
|
||||
mword_t read_efer() const { return 0; }
|
||||
uint64_t read_star() const { return 0; }
|
||||
uint64_t read_lstar() const { return 0; }
|
||||
uint64_t read_cstar() const { return 0; }
|
||||
uint64_t read_fmask() const { return 0; }
|
||||
uint64_t read_kernel_gs_base() const { return 0; }
|
||||
uint32_t read_tpr() const { return 0; }
|
||||
uint32_t read_tpr_threshold() const { return 0; }
|
||||
|
||||
void write_r8 (uint64_t) { }
|
||||
void write_r9 (uint64_t) { }
|
||||
void write_r10 (uint64_t) { }
|
||||
void write_r11 (uint64_t) { }
|
||||
void write_r12 (uint64_t) { }
|
||||
void write_r13 (uint64_t) { }
|
||||
void write_r14 (uint64_t) { }
|
||||
void write_r15 (uint64_t) { }
|
||||
void write_efer (mword_t) { }
|
||||
void write_star (uint64_t) { }
|
||||
void write_lstar (uint64_t) { }
|
||||
void write_cstar (uint64_t) { }
|
||||
void write_fmask (uint64_t) { }
|
||||
void write_kernel_gs_base (uint64_t) { }
|
||||
void write_tpr (uint32_t) { }
|
||||
void write_tpr_threshold (uint32_t) { }
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -689,7 +691,7 @@ namespace Nova {
|
||||
/**
|
||||
* Return current number of message items on UTCB
|
||||
*/
|
||||
unsigned msg_items() { return items >> 16; }
|
||||
unsigned msg_items() { return (unsigned)(items >> 16); }
|
||||
|
||||
/**
|
||||
* Append message-transfer item to message buffer
|
||||
@ -749,6 +751,12 @@ namespace Nova {
|
||||
}
|
||||
|
||||
mword_t mtd_value() const { return static_cast<Mtd>(mtd).value(); }
|
||||
|
||||
/**
|
||||
* Return fault address and type of page-fault message
|
||||
*/
|
||||
mword_t pf_addr() const { return (mword_t)qual[1]; }
|
||||
uint8_t pf_type() const { return (uint8_t)qual[0]; }
|
||||
};
|
||||
|
||||
static_assert(sizeof(Utcb) == 4096, "Unexpected size of UTCB");
|
||||
|
@ -62,7 +62,7 @@ namespace Nova {
|
||||
: "+a" (status)
|
||||
:
|
||||
: "ecx", "edx", "memory");
|
||||
return status;
|
||||
return (uint8_t)status;
|
||||
}
|
||||
|
||||
|
||||
@ -83,7 +83,7 @@ namespace Nova {
|
||||
:
|
||||
: "ecx", "edx", "memory");
|
||||
if (p2) *p2 = p1;
|
||||
return status;
|
||||
return (uint8_t)status;
|
||||
}
|
||||
|
||||
|
||||
@ -102,7 +102,7 @@ namespace Nova {
|
||||
: "+a" (status)
|
||||
: "D" (p1), "S" (p2)
|
||||
: "ecx", "edx");
|
||||
return status;
|
||||
return (uint8_t)status;
|
||||
}
|
||||
|
||||
|
||||
@ -125,7 +125,7 @@ namespace Nova {
|
||||
: "+a" (status), "+d" (p3)
|
||||
: "D" (p1), "S" (p2)
|
||||
: "ecx");
|
||||
return status;
|
||||
return (uint8_t)status;
|
||||
}
|
||||
|
||||
|
||||
@ -154,7 +154,7 @@ namespace Nova {
|
||||
: "+a" (status), "+c" (p3), "+d" (p4)
|
||||
: "D" (p1), "S" (p2)
|
||||
: "memory");
|
||||
return status;
|
||||
return (uint8_t)status;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE
|
||||
@ -179,7 +179,7 @@ namespace Nova {
|
||||
: "+a" (status), "+D" (p1), "+S" (p2), "+c" (p3)
|
||||
:
|
||||
: "edx", "memory");
|
||||
return status;
|
||||
return (uint8_t)status;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE
|
||||
@ -350,7 +350,7 @@ namespace Nova {
|
||||
ALWAYS_INLINE
|
||||
inline uint8_t sm_ctrl(unsigned sm, Sem_op op, unsigned long long timeout = 0)
|
||||
{
|
||||
return syscall_2(NOVA_SM_CTRL, op, sm, timeout >> 32, timeout);
|
||||
return syscall_2(NOVA_SM_CTRL, op, sm, (mword_t)(timeout >> 32), (mword_t)timeout);
|
||||
}
|
||||
|
||||
|
||||
|
@ -57,7 +57,7 @@ namespace Nova {
|
||||
: "+D" (status)
|
||||
:
|
||||
: "rcx", "r11", "memory");
|
||||
return status;
|
||||
return (uint8_t)status;
|
||||
}
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@ namespace Nova {
|
||||
:
|
||||
: "rcx", "r11", "memory");
|
||||
if (p2) *p2 = p1;
|
||||
return status;
|
||||
return (uint8_t)status;
|
||||
}
|
||||
|
||||
|
||||
@ -86,7 +86,7 @@ namespace Nova {
|
||||
: "+D" (status)
|
||||
: "S" (p1), "d" (p2)
|
||||
: "rcx", "r11", "memory");
|
||||
return status;
|
||||
return (uint8_t)status;
|
||||
}
|
||||
|
||||
|
||||
@ -100,7 +100,7 @@ namespace Nova {
|
||||
: "+D" (status)
|
||||
: "S" (p1), "d" (p2), "a" (p3)
|
||||
: "rcx", "r11", "memory");
|
||||
return status;
|
||||
return (uint8_t)status;
|
||||
}
|
||||
|
||||
|
||||
@ -115,7 +115,7 @@ namespace Nova {
|
||||
: "+D" (status)
|
||||
: "S" (p1), "d" (p2), "a" (p3), "r" (r8)
|
||||
: "rcx", "r11", "memory");
|
||||
return status;
|
||||
return (uint8_t)status;
|
||||
}
|
||||
|
||||
|
||||
@ -129,7 +129,7 @@ namespace Nova {
|
||||
: "+D" (status), "+S"(p1), "+d"(p2)
|
||||
: "a" (p3)
|
||||
: "rcx", "r11", "memory");
|
||||
return status;
|
||||
return (uint8_t)status;
|
||||
}
|
||||
|
||||
|
||||
@ -159,7 +159,7 @@ namespace Nova {
|
||||
inline uint8_t create_pd(mword_t pd0, mword_t pd, Crd crd,
|
||||
unsigned lower_limit, unsigned long upper_limit)
|
||||
{
|
||||
return syscall_3(NOVA_CREATE_PD, 0, pd0, pd, crd.value(),
|
||||
return syscall_3(NOVA_CREATE_PD, 0, (unsigned)pd0, pd, crd.value(),
|
||||
upper_limit << 32 | lower_limit);
|
||||
}
|
||||
|
||||
@ -202,7 +202,7 @@ namespace Nova {
|
||||
ALWAYS_INLINE
|
||||
inline uint8_t create_sc(mword_t sc, mword_t pd, mword_t ec, Qpd qpd)
|
||||
{
|
||||
return syscall_3(NOVA_CREATE_SC, 0, sc, pd, ec, qpd.value());
|
||||
return syscall_3(NOVA_CREATE_SC, 0, (unsigned)sc, pd, ec, qpd.value());
|
||||
}
|
||||
|
||||
|
||||
@ -229,14 +229,14 @@ namespace Nova {
|
||||
ALWAYS_INLINE
|
||||
inline uint8_t create_sm(mword_t sm, mword_t pd, mword_t cnt)
|
||||
{
|
||||
return syscall_3(NOVA_CREATE_SM, 0, sm, pd, cnt, 0);
|
||||
return syscall_3(NOVA_CREATE_SM, 0, (unsigned)sm, pd, cnt, 0);
|
||||
}
|
||||
|
||||
|
||||
ALWAYS_INLINE
|
||||
inline uint8_t create_si(mword_t si, mword_t pd, mword_t value, mword_t sm)
|
||||
{
|
||||
return syscall_3(NOVA_CREATE_SM, 0, si, pd, value, sm);
|
||||
return syscall_3(NOVA_CREATE_SM, 0, (unsigned)si, pd, value, sm);
|
||||
}
|
||||
|
||||
|
||||
|
@ -40,7 +40,7 @@ static inline void * alloc_region(Dataspace_component &ds, const size_t size)
|
||||
size_t align_log2 = log2(ds.size());
|
||||
for (; align_log2 >= get_page_size_log2(); align_log2--) {
|
||||
|
||||
platform().region_alloc().alloc_aligned(size, align_log2).with_result(
|
||||
platform().region_alloc().alloc_aligned(size, (unsigned)align_log2).with_result(
|
||||
[&] (void *ptr) { virt_addr = ptr; },
|
||||
[&] (Allocator::Alloc_error) { });
|
||||
|
||||
|
@ -115,7 +115,7 @@ lsb_bit(unsigned long const &value, unsigned char const shift = 0)
|
||||
unsigned long const scan = value >> shift;
|
||||
if (scan == 0) return 0;
|
||||
|
||||
unsigned char pos = __builtin_ctzl(scan);
|
||||
unsigned char pos = (unsigned char)__builtin_ctzl(scan);
|
||||
unsigned char res = shift ? pos + shift : pos;
|
||||
return res;
|
||||
}
|
||||
@ -207,7 +207,7 @@ inline void unmap_local(Nova::Utcb &, Genode::addr_t start,
|
||||
|
||||
while (num_pages) {
|
||||
unsigned char const base_bit = lsb_bit(base);
|
||||
unsigned char const order_bit = min(log2(num_pages), 31U);
|
||||
unsigned char const order_bit = (unsigned char)min(log2(num_pages), 31U);
|
||||
unsigned char const order = min(order_bit, base_bit);
|
||||
|
||||
Mem_crd const crd(base, order, rwx);
|
||||
|
@ -100,10 +100,10 @@ namespace Genode {
|
||||
/* convenience function to access pause/recall state */
|
||||
inline bool blocked() { return _status & BLOCKED;}
|
||||
inline void block() { _status |= BLOCKED; }
|
||||
inline void unblock() { _status &= ~BLOCKED; }
|
||||
inline void unblock() { _status &= (uint8_t)(~BLOCKED); }
|
||||
inline bool blocked_pause_sm() { return _status & BLOCKED_PAUSE_SM;}
|
||||
inline void block_pause_sm() { _status |= BLOCKED_PAUSE_SM; }
|
||||
inline void unblock_pause_sm() { _status &= ~BLOCKED_PAUSE_SM; }
|
||||
inline void block_pause_sm() { _status |= (uint8_t)BLOCKED_PAUSE_SM; }
|
||||
inline void unblock_pause_sm() { _status &= (uint8_t)(~BLOCKED_PAUSE_SM); }
|
||||
|
||||
inline void mark_dead() { _status |= DEAD; }
|
||||
inline bool is_dead() { return _status & DEAD; }
|
||||
@ -118,10 +118,10 @@ namespace Genode {
|
||||
|
||||
inline bool to_submit() { return _status & SUBMIT_SIGNAL; }
|
||||
inline void submit_signal() { _status |= SUBMIT_SIGNAL; }
|
||||
inline void reset_submit() { _status &= ~SUBMIT_SIGNAL; }
|
||||
inline void reset_submit() { _status &= (uint8_t)(~SUBMIT_SIGNAL); }
|
||||
|
||||
bool migrate() const { return _status & MIGRATE; }
|
||||
void reset_migrate() { _status &= ~MIGRATE; }
|
||||
void reset_migrate() { _status &= (uint8_t)(~MIGRATE); }
|
||||
void request_migrate() { _status |= MIGRATE; }
|
||||
} _state { };
|
||||
|
||||
@ -287,7 +287,7 @@ namespace Genode {
|
||||
if (on)
|
||||
_state._status |= _state.SINGLESTEP;
|
||||
else
|
||||
_state._status &= ~_state.SINGLESTEP;
|
||||
_state._status &= (uint8_t)(~_state.SINGLESTEP);
|
||||
|
||||
_state_lock.release();
|
||||
|
||||
|
@ -26,9 +26,12 @@ namespace Genode {
|
||||
|
||||
constexpr size_t get_super_page_size_log2() { return 22; }
|
||||
constexpr size_t get_super_page_size() { return 1 << get_super_page_size_log2(); }
|
||||
inline addr_t trunc_page(addr_t addr) { return addr & _align_mask(get_page_size_log2()); }
|
||||
inline addr_t round_page(addr_t addr) { return trunc_page(addr + get_page_size() - 1); }
|
||||
|
||||
template <typename T>
|
||||
inline T trunc_page(T addr) { return addr & _align_mask(get_page_size_log2()); }
|
||||
|
||||
template <typename T>
|
||||
inline T round_page(T addr) { return trunc_page(addr + get_page_size() - 1); }
|
||||
|
||||
inline addr_t map_src_addr(addr_t /* core_local */, addr_t phys) { return phys; }
|
||||
|
||||
|
@ -32,9 +32,9 @@ Ipc_pager::Ipc_pager(Nova::Utcb &utcb, addr_t pd_dst, addr_t pd_core)
|
||||
_pd_dst(pd_dst),
|
||||
_pd_core(pd_core),
|
||||
_fault_ip(utcb.ip),
|
||||
_fault_addr(utcb.qual[1]),
|
||||
_fault_addr(utcb.pf_addr()),
|
||||
_sp(utcb.sp),
|
||||
_fault_type(utcb.qual[0]),
|
||||
_fault_type(utcb.pf_type()),
|
||||
_syscall_res(Nova::NOVA_OK),
|
||||
_normal_ipc((((addr_t)&utcb.qual[2] - (addr_t)utcb.msg()) / sizeof(addr_t))
|
||||
== utcb.msg_words())
|
||||
|
@ -225,7 +225,7 @@ Irq_session_component::Irq_session_component(Range_allocator &irq_alloc,
|
||||
throw Service_denied();
|
||||
}
|
||||
|
||||
_irq_number = irq_number;
|
||||
_irq_number = (unsigned)irq_number;
|
||||
|
||||
_irq_object.start(_irq_number, device_phys);
|
||||
}
|
||||
|
@ -101,8 +101,10 @@ struct Page_fault_info
|
||||
|
||||
Page_fault_info(char const *pd, char const *thread, unsigned cpu,
|
||||
addr_t ip, addr_t addr, addr_t sp, unsigned type)
|
||||
: pd(pd), thread(thread), cpu(cpu), ip(ip), addr(addr),
|
||||
sp(sp), pf_type(type) { }
|
||||
:
|
||||
pd(pd), thread(thread), cpu(cpu), ip(ip), addr(addr),
|
||||
sp(sp), pf_type((uint8_t)type)
|
||||
{ }
|
||||
|
||||
void print(Genode::Output &out) const
|
||||
{
|
||||
@ -191,7 +193,7 @@ void Pager_object::_page_fault_handler(Pager_object &obj)
|
||||
ipc_pager.fault_ip(),
|
||||
ipc_pager.fault_addr(),
|
||||
ipc_pager.sp(),
|
||||
ipc_pager.fault_type());
|
||||
(uint8_t)ipc_pager.fault_type());
|
||||
|
||||
/* region manager fault - to be handled */
|
||||
log("page fault, ", fault_info, " reason=", error);
|
||||
|
@ -113,10 +113,10 @@ static void page_fault_handler()
|
||||
{
|
||||
Utcb *utcb = (Utcb *)CORE_PAGER_UTCB_ADDR;
|
||||
|
||||
addr_t pf_addr = utcb->qual[1];
|
||||
addr_t pf_ip = utcb->ip;
|
||||
addr_t pf_sp = utcb->sp;
|
||||
addr_t pf_type = utcb->qual[0];
|
||||
addr_t const pf_addr = utcb->pf_addr();
|
||||
addr_t const pf_ip = utcb->ip;
|
||||
addr_t const pf_sp = utcb->sp;
|
||||
uint8_t const pf_type = utcb->pf_type();
|
||||
|
||||
error("\nPAGE-FAULT IN CORE addr=", Hex(pf_addr), " ip=", Hex(pf_ip),
|
||||
" (", (pf_type & Ipc_pager::ERR_W) ? "write" : "read", ")");
|
||||
@ -370,7 +370,7 @@ Platform::Platform()
|
||||
" vs ", sizeof(map_cpu_ids) / sizeof(map_cpu_ids[0]));
|
||||
nova_die();
|
||||
}
|
||||
if (!hip.remap_cpu_ids(map_cpu_ids, boot_cpu())) {
|
||||
if (!hip.remap_cpu_ids(map_cpu_ids, (unsigned)boot_cpu())) {
|
||||
error("re-ording cpu_id failed");
|
||||
nova_die();
|
||||
}
|
||||
@ -492,7 +492,7 @@ Platform::Platform()
|
||||
Hip::Mem_desc *boot_fb = nullptr;
|
||||
|
||||
bool efi_boot = false;
|
||||
addr_t kernel_memory = 0;
|
||||
size_t kernel_memory = 0;
|
||||
|
||||
/*
|
||||
* All "available" ram must be added to our physical allocator before all
|
||||
@ -506,13 +506,13 @@ Platform::Platform()
|
||||
if (mem_desc->type == Hip::Mem_desc::FRAMEBUFFER)
|
||||
boot_fb = mem_desc;
|
||||
if (mem_desc->type == Hip::Mem_desc::MICROHYPERVISOR)
|
||||
kernel_memory += mem_desc->size;
|
||||
kernel_memory += (size_t)mem_desc->size;
|
||||
|
||||
if (mem_desc->type != Hip::Mem_desc::AVAILABLE_MEMORY) continue;
|
||||
|
||||
if (verbose_boot_info) {
|
||||
addr_t const base = mem_desc->addr;
|
||||
size_t const size = mem_desc->size;
|
||||
uint64_t const base = mem_desc->addr;
|
||||
uint64_t const size = mem_desc->size;
|
||||
log("detected physical memory: ", Hex(base, Hex::PREFIX, Hex::PAD),
|
||||
" - size: ", Hex(size, Hex::PREFIX, Hex::PAD));
|
||||
}
|
||||
@ -522,11 +522,11 @@ Platform::Platform()
|
||||
/* skip regions above 4G on 32 bit, no op on 64 bit */
|
||||
if (mem_desc->addr > ~0UL) continue;
|
||||
|
||||
addr_t base = round_page(mem_desc->addr);
|
||||
size_t size;
|
||||
uint64_t base = round_page(mem_desc->addr);
|
||||
uint64_t size;
|
||||
/* truncate size if base+size larger then natural 32/64 bit boundary */
|
||||
if (mem_desc->addr >= ~0UL - mem_desc->size + 1)
|
||||
size = trunc_page(~0UL - mem_desc->addr + 1);
|
||||
if (mem_desc->addr >= ~0ULL - mem_desc->size + 1)
|
||||
size = trunc_page(~0ULL - mem_desc->addr + 1);
|
||||
else
|
||||
size = trunc_page(mem_desc->addr + mem_desc->size) - base;
|
||||
|
||||
@ -534,12 +534,12 @@ Platform::Platform()
|
||||
log("use physical memory: ", Hex(base, Hex::PREFIX, Hex::PAD),
|
||||
" - size: ", Hex(size, Hex::PREFIX, Hex::PAD));
|
||||
|
||||
_io_mem_alloc.remove_range(base, size);
|
||||
ram_alloc().add_range(base, size);
|
||||
_io_mem_alloc.remove_range((addr_t)base, (size_t)size);
|
||||
ram_alloc().add_range((addr_t)base, (size_t)size);
|
||||
}
|
||||
|
||||
uint64_t hyp_log = 0;
|
||||
uint64_t hyp_log_size = 0;
|
||||
addr_t hyp_log = 0;
|
||||
size_t hyp_log_size = 0;
|
||||
|
||||
/*
|
||||
* Exclude all non-available memory from physical allocator AFTER all
|
||||
@ -551,16 +551,16 @@ Platform::Platform()
|
||||
if (mem_desc->type == Hip::Mem_desc::AVAILABLE_MEMORY) continue;
|
||||
|
||||
if (mem_desc->type == Hip::Mem_desc::HYPERVISOR_LOG) {
|
||||
hyp_log = mem_desc->addr;
|
||||
hyp_log_size = mem_desc->size;
|
||||
hyp_log = (addr_t)mem_desc->addr;
|
||||
hyp_log_size = (size_t)mem_desc->size;
|
||||
}
|
||||
|
||||
addr_t base = trunc_page(mem_desc->addr);
|
||||
size_t size = mem_desc->size;
|
||||
uint64_t base = trunc_page(mem_desc->addr);
|
||||
uint64_t size = mem_desc->size;
|
||||
|
||||
/* remove framebuffer from available memory */
|
||||
if (mem_desc->type == Hip::Mem_desc::FRAMEBUFFER) {
|
||||
uint32_t const height = Resolution::Height::get(mem_desc->size);
|
||||
uint32_t const height = (uint32_t)Resolution::Height::get(mem_desc->size);
|
||||
uint32_t const pitch = mem_desc->aux;
|
||||
/* calculate size of framebuffer */
|
||||
size = pitch * height;
|
||||
@ -585,9 +585,9 @@ Platform::Platform()
|
||||
/* make acpi regions as io_mem available to platform driver */
|
||||
if (mem_desc->type == Hip::Mem_desc::ACPI_RECLAIM_MEMORY ||
|
||||
mem_desc->type == Hip::Mem_desc::ACPI_NVS_MEMORY)
|
||||
_io_mem_alloc.add_range(base, size);
|
||||
_io_mem_alloc.add_range((addr_t)base, (size_t)size);
|
||||
|
||||
ram_alloc().remove_range(base, size);
|
||||
ram_alloc().remove_range((addr_t)base, (size_t)size);
|
||||
}
|
||||
|
||||
/* needed as I/O memory by the VESA driver */
|
||||
@ -634,9 +634,9 @@ Platform::Platform()
|
||||
continue;
|
||||
|
||||
error("region overlap ",
|
||||
Hex_range<addr_t>(mem_desc->addr, mem_desc->size), " "
|
||||
Hex_range<addr_t>((addr_t)mem_desc->addr, (size_t)mem_desc->size), " "
|
||||
"(", (int)mem_desc->type, ") with ",
|
||||
Hex_range<addr_t>(mem_d->addr, mem_d->size), " "
|
||||
Hex_range<addr_t>((addr_t)mem_d->addr, (size_t)mem_d->size), " "
|
||||
"(", (int)mem_d->type, ")");
|
||||
nova_die();
|
||||
}
|
||||
@ -659,7 +659,7 @@ Platform::Platform()
|
||||
if (!mem_desc->addr || !mem_desc->size) continue;
|
||||
|
||||
/* assume core's ELF image has one-page header */
|
||||
_core_phys_start = trunc_page(mem_desc->addr + get_page_size());
|
||||
_core_phys_start = (addr_t)trunc_page(mem_desc->addr + get_page_size());
|
||||
}
|
||||
|
||||
_init_rom_modules();
|
||||
@ -842,7 +842,7 @@ Platform::Platform()
|
||||
|
||||
cap_map().insert(range);
|
||||
|
||||
index = range.base() + range.elements();
|
||||
index = (unsigned)(range.base() + range.elements());
|
||||
}
|
||||
_max_caps = index - first_index;
|
||||
|
||||
@ -894,15 +894,15 @@ Platform::Platform()
|
||||
};
|
||||
|
||||
new (core_mem_alloc()) Trace_source(Trace::sources(), location,
|
||||
sc_idle_base + kernel_cpu_id,
|
||||
(unsigned)(sc_idle_base + kernel_cpu_id),
|
||||
"idle");
|
||||
|
||||
new (core_mem_alloc()) Trace_source(Trace::sources(), location,
|
||||
sc_idle_base + kernel_cpu_id,
|
||||
(unsigned)(sc_idle_base + kernel_cpu_id),
|
||||
"cross");
|
||||
|
||||
new (core_mem_alloc()) Trace_source(Trace::sources(), location,
|
||||
sc_idle_base + kernel_cpu_id,
|
||||
(unsigned)(sc_idle_base + kernel_cpu_id),
|
||||
"killed");
|
||||
});
|
||||
|
||||
@ -988,8 +988,7 @@ unsigned Platform::pager_index(Affinity::Location location) const
|
||||
** Support for core memory management **
|
||||
****************************************/
|
||||
|
||||
bool Mapped_mem_allocator::_map_local(addr_t virt_addr, addr_t phys_addr,
|
||||
unsigned size)
|
||||
bool Mapped_mem_allocator::_map_local(addr_t virt_addr, addr_t phys_addr, size_t size)
|
||||
{
|
||||
/* platform_specific()->core_pd_sel() deadlocks if called from platform constructor */
|
||||
Hip const &hip = *(Hip const *)__initial_sp;
|
||||
@ -1003,7 +1002,7 @@ bool Mapped_mem_allocator::_map_local(addr_t virt_addr, addr_t phys_addr,
|
||||
}
|
||||
|
||||
|
||||
bool Mapped_mem_allocator::_unmap_local(addr_t virt_addr, addr_t, unsigned size)
|
||||
bool Mapped_mem_allocator::_unmap_local(addr_t virt_addr, addr_t, size_t size)
|
||||
{
|
||||
unmap_local(*(Utcb *)Thread::myself()->utcb(),
|
||||
virt_addr, size / get_page_size());
|
||||
|
@ -359,7 +359,7 @@ Platform_thread::Platform_thread(size_t, const char *name, unsigned prio,
|
||||
_sel_exc_base(Native_thread::INVALID_INDEX),
|
||||
_location(platform_specific().sanitize(affinity)),
|
||||
_features(0),
|
||||
_priority(scale_priority(prio, name)),
|
||||
_priority((uint8_t)(scale_priority(prio, name))),
|
||||
_name(name)
|
||||
{ }
|
||||
|
||||
|
@ -41,7 +41,7 @@ static inline void * alloc_region(Dataspace_component &ds, const size_t size)
|
||||
size_t align_log2 = log2(ds.size());
|
||||
for (; align_log2 >= get_page_size_log2(); align_log2--) {
|
||||
|
||||
platform().region_alloc().alloc_aligned(size, align_log2).with_result(
|
||||
platform().region_alloc().alloc_aligned(size, (unsigned)align_log2).with_result(
|
||||
[&] (void *ptr) { virt_addr = ptr; },
|
||||
[&] (Range_allocator::Alloc_error) { /* try next iteration */ }
|
||||
);
|
||||
|
@ -96,7 +96,7 @@ void Thread::start()
|
||||
Affinity::Location location = _affinity;
|
||||
|
||||
if (!location.valid())
|
||||
location = Affinity::Location(boot_cpu(), 0);
|
||||
location = Affinity::Location((int)boot_cpu(), 0);
|
||||
|
||||
/* create local EC */
|
||||
enum { LOCAL_THREAD = false };
|
||||
|
@ -333,7 +333,7 @@ Capability<Vm_session::Native_vcpu> Vm_session_component::create_vcpu(Thread_cap
|
||||
_constrained_md_ram_alloc,
|
||||
_cap_quota_guard(),
|
||||
vcpu_id,
|
||||
kernel_cpu_id,
|
||||
(unsigned)kernel_cpu_id,
|
||||
vcpu_location,
|
||||
_priority,
|
||||
_session_label,
|
||||
|
@ -104,7 +104,7 @@ static inline bool copy_msgbuf_to_utcb(Nova::Utcb &utcb,
|
||||
for (unsigned i = 0; i < num_data_words; i++)
|
||||
*dst++ = *src++;
|
||||
|
||||
utcb.set_msg_word(num_msg_words);
|
||||
utcb.set_msg_word((unsigned)num_msg_words);
|
||||
|
||||
/* append portal capability selectors */
|
||||
for (unsigned i = 0; i < snd_msg.used_caps(); i++) {
|
||||
|
@ -35,8 +35,8 @@ static inline void spinlock_lock(volatile T *lock_variable)
|
||||
using Genode::cmpxchg;
|
||||
|
||||
Genode::Thread * myself = Genode::Thread::myself();
|
||||
T const tid = myself ? myself->native_thread().ec_sel
|
||||
: (Genode::addr_t)Nova::EC_SEL_THREAD;
|
||||
T const tid = (T)(myself ? myself->native_thread().ec_sel
|
||||
: (Genode::addr_t)Nova::EC_SEL_THREAD);
|
||||
|
||||
unsigned help_counter = 0;
|
||||
|
||||
|
@ -95,7 +95,7 @@ namespace Genode {
|
||||
|
||||
} while (imprint == 0);
|
||||
|
||||
return Signal(imprint, count);
|
||||
return Signal(imprint, (int)count);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user