mirror of
https://github.com/drasko/codezero.git
synced 2026-01-15 04:13:16 +01:00
Added thread group identification to c0 and libl4
tgid will be used when threads will be created in same address space.
This commit is contained in:
@@ -71,6 +71,8 @@ int sys_getid(syscall_context_t *regs)
|
||||
|
||||
ids->tid = this->tid;
|
||||
ids->spid = this->spid;
|
||||
ids->tgid = this->tgid;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -175,6 +175,12 @@ out:
|
||||
if ((ids->spid = id_get(space_id_pool,
|
||||
ids->spid)) < 0)
|
||||
ids->spid = id_new(space_id_pool);
|
||||
|
||||
/* It also gets a thread group id */
|
||||
if ((ids->tgid = id_get(tgroup_id_pool,
|
||||
ids->tgid)) < 0)
|
||||
ids->tgid = id_new(tgroup_id_pool);
|
||||
|
||||
}
|
||||
|
||||
/* Set all ids */
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
/* ID pools for threads and spaces. */
|
||||
struct id_pool *thread_id_pool;
|
||||
struct id_pool *space_id_pool;
|
||||
struct id_pool *tgroup_id_pool;
|
||||
|
||||
/* Hash table for all existing tasks */
|
||||
struct list_head global_task_list;
|
||||
|
||||
@@ -331,8 +331,10 @@ void init_tasks()
|
||||
/* Initialise thread and space id pools */
|
||||
thread_id_pool = id_pool_new_init(THREAD_IDS_MAX);
|
||||
space_id_pool = id_pool_new_init(SPACE_IDS_MAX);
|
||||
tgroup_id_pool = id_pool_new_init(TGROUP_IDS_MAX);
|
||||
ids.tid = id_new(thread_id_pool);
|
||||
ids.spid = id_new(space_id_pool);
|
||||
ids.tgid = id_new(tgroup_id_pool);
|
||||
|
||||
/* Initialise the global task list head */
|
||||
INIT_LIST_HEAD(&global_task_list);
|
||||
|
||||
Reference in New Issue
Block a user