sched: task: implement task_config_get and task_config_set
This commit is contained in:
@@ -297,6 +297,40 @@ struct task *task_from_tid(tid_t id)
|
||||
return t;
|
||||
}
|
||||
|
||||
kern_status_t task_config_get(
|
||||
struct task *task,
|
||||
kern_config_key_t key,
|
||||
void *out,
|
||||
size_t max)
|
||||
{
|
||||
switch (key) {
|
||||
case TASK_CFG_ID: {
|
||||
if (max != sizeof(tid_t)) {
|
||||
return KERN_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
tid_t *value = out;
|
||||
*value = task->t_id;
|
||||
return KERN_OK;
|
||||
}
|
||||
|
||||
default:
|
||||
return KERN_INVALID_ARGUMENT;
|
||||
}
|
||||
}
|
||||
|
||||
kern_status_t task_config_set(
|
||||
struct task *task,
|
||||
kern_config_key_t key,
|
||||
const void *ptr,
|
||||
size_t len)
|
||||
{
|
||||
switch (key) {
|
||||
default:
|
||||
return KERN_INVALID_ARGUMENT;
|
||||
}
|
||||
}
|
||||
|
||||
void task_exit(int status)
|
||||
{
|
||||
struct task *self = get_current_task();
|
||||
|
||||
Reference in New Issue
Block a user