hw: don't use assert in Kernel::new_vm

ref #1101
This commit is contained in:
Martin Stein 2014-03-17 01:42:34 +01:00 committed by Norman Feske
parent f8b4541e2b
commit 7bbabcf817

View File

@ -884,21 +884,26 @@ void Thread::_call_bin_signal_receiver()
void Thread::_call_new_vm() void Thread::_call_new_vm()
{ {
/* check permissions */ /* check permissions */
assert(_core()); if (!_core()) {
PWRN("not entitled to create virtual machine");
/* dispatch arguments */ user_arg_0(0);
void * const allocator = (void * const)user_arg_1(); return;
Genode::Cpu_state_modes * const state = }
(Genode::Cpu_state_modes * const)user_arg_2(); /* lookup signal context */
Signal_context * const context = auto const context = Signal_context::pool()->object(user_arg_3());
Signal_context::pool()->object(user_arg_3()); if (!context) {
assert(context); PWRN("failed to lookup signal context");
user_arg_0(0);
/* create vm */ return;
}
/* create virtual machine */
typedef Genode::Cpu_state_modes Cpu_state_modes;
auto const allocator = reinterpret_cast<void *>(user_arg_1());
auto const state = reinterpret_cast<Cpu_state_modes *>(user_arg_2());
Vm * const vm = new (allocator) Vm(state, context); Vm * const vm = new (allocator) Vm(state, context);
/* return vm id */ /* return kernel name of virtual machine */
user_arg_0((Call_ret)vm->id()); user_arg_0(vm->id());
} }