mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-13 22:23:45 +00:00
lx_emul: support execution till condition applies
In rare cases it is necessary to execute Linux contributed code until certain work is finished, e.g. when in a synchronous RPC call, a session construction or destruction a result is needed. Therefore, we introduce a new lx_emul function called lx_emul_execute_kernel_until. Ref genodelabs/genode#4483
This commit is contained in:
parent
8ca2c597e0
commit
4b983f92c5
@ -24,6 +24,8 @@ void lx_emul_register_initcall(int (*initcall)(void), const char * name);
|
||||
|
||||
void lx_emul_start_kernel(void * dtb);
|
||||
|
||||
void lx_emul_execute_kernel_until(int (*condition)(void));
|
||||
|
||||
void lx_emul_setup_arch(void * dtb);
|
||||
|
||||
int lx_emul_init_task_function(void * dtb);
|
||||
|
@ -48,7 +48,7 @@ extern "C" void lx_emul_register_initcall(int (*initcall)(void),
|
||||
}
|
||||
|
||||
|
||||
void lx_emul_start_kernel(void * dtb)
|
||||
extern "C" void lx_emul_start_kernel(void * dtb)
|
||||
{
|
||||
using namespace Lx_kit;
|
||||
|
||||
@ -61,3 +61,13 @@ void lx_emul_start_kernel(void * dtb)
|
||||
|
||||
env().scheduler.schedule();
|
||||
}
|
||||
|
||||
|
||||
extern "C" void lx_emul_execute_kernel_until(int (*condition)(void))
|
||||
{
|
||||
Lx_kit::env().scheduler.schedule();
|
||||
|
||||
while (!condition()) {
|
||||
Lx_kit::env().env.ep().wait_and_dispatch_one_io_signal();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user