mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
committed by
Christian Helmuth
parent
4b43b5c1c1
commit
0c617366e5
@@ -26,6 +26,8 @@ struct task_struct * lx_emul_task_get_current(void);
|
||||
|
||||
struct task_struct * lx_emul_task_get(int pid);
|
||||
|
||||
int lx_emul_task_pid(struct task_struct *task);
|
||||
|
||||
void lx_emul_task_create(struct task_struct * task,
|
||||
const char * name,
|
||||
int pid,
|
||||
|
||||
@@ -70,6 +70,19 @@ extern "C" struct task_struct * lx_emul_task_get(int pid)
|
||||
}
|
||||
|
||||
|
||||
extern "C" int lx_emul_task_pid(struct task_struct * t)
|
||||
{
|
||||
int ret = -1;
|
||||
|
||||
Lx_kit::env().scheduler.for_each_task([&] (Lx_kit::Task & task) {
|
||||
if (t == task.lx_task())
|
||||
ret = task.pid();
|
||||
});
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
extern "C" void lx_emul_task_name(struct task_struct * t, const char * name)
|
||||
{
|
||||
Lx_kit::env().scheduler.task((void*)t).name(name);
|
||||
|
||||
Reference in New Issue
Block a user