summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2013-05-12 14:05:25 +0200
committerRichard Braun <rbraun@sceen.net>2013-05-12 14:05:25 +0200
commit9d6f40a35b8ced80435454c60475e07f045c1e80 (patch)
treecfa2f682a0c63cf8e748a9629255fc24f9743af9
parent4af3612ecbc968ca6a8b33b6dc5b0addaddfb01c (diff)
kern/thread: minor name change in struct thread_attr
Rename sched_policy to policy.
-rw-r--r--kern/thread.c12
-rw-r--r--kern/thread.h2
2 files changed, 7 insertions, 7 deletions
diff --git a/kern/thread.c b/kern/thread.c
index 9418668f..e24e024b 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -1409,7 +1409,7 @@ thread_init(struct thread *thread, void *stack, const struct thread_attr *attr,
assert(task != NULL);
name = (attr->name == NULL) ? task->name : attr->name;
assert(name != NULL);
- assert(attr->sched_policy < THREAD_NR_SCHED_POLICIES);
+ assert(attr->policy < THREAD_NR_SCHED_POLICIES);
/*
* The expected interrupt, preemption and run queue lock state when
@@ -1427,8 +1427,8 @@ thread_init(struct thread *thread, void *stack, const struct thread_attr *attr,
thread->state = THREAD_SLEEPING;
thread->preempt = 2;
thread->pinned = 0;
- thread->sched_policy = attr->sched_policy;
- thread->sched_class = thread_policy_table[attr->sched_policy];
+ thread->sched_policy = attr->policy;
+ thread->sched_class = thread_policy_table[attr->policy];
thread_init_sched(thread, attr->priority);
thread->task = task;
thread->stack = stack;
@@ -1522,7 +1522,7 @@ thread_setup_reaper(void)
attr.task = NULL;
attr.name = "x15_reaper";
- attr.sched_policy = THREAD_SCHED_POLICY_TS;
+ attr.policy = THREAD_SCHED_POLICY_TS;
attr.priority = THREAD_SCHED_TS_PRIO_DEFAULT;
error = thread_create(&thread, &attr, thread_reaper, NULL);
@@ -1588,7 +1588,7 @@ thread_setup_balancer(struct thread_runq *runq)
snprintf(name, sizeof(name), "x15_balancer/%u", thread_runq_id(runq));
attr.task = NULL;
attr.name = name;
- attr.sched_policy = THREAD_SCHED_POLICY_RR;
+ attr.policy = THREAD_SCHED_POLICY_RR;
attr.priority = THREAD_SCHED_RT_PRIO_MIN;
error = thread_create(&balancer, &attr, thread_balancer, runq);
@@ -1648,7 +1648,7 @@ thread_setup_idler(struct thread_runq *runq)
snprintf(name, sizeof(name), "x15_idler/%u", thread_runq_id(runq));
attr.task = kernel_task;
attr.name = name;
- attr.sched_policy = THREAD_SCHED_POLICY_IDLE;
+ attr.policy = THREAD_SCHED_POLICY_IDLE;
thread_init(idler, stack, &attr, thread_idler, NULL);
/* An idler thread needs special tuning */
diff --git a/kern/thread.h b/kern/thread.h
index c92e6354..2671d2dc 100644
--- a/kern/thread.h
+++ b/kern/thread.h
@@ -172,7 +172,7 @@ struct thread {
struct thread_attr {
struct task *task;
const char *name;
- unsigned char sched_policy;
+ unsigned char policy;
unsigned short priority;
};