From 61598093bbdd283a7edc367d900f223070ead8d2 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Fri, 10 May 2024 07:43:03 +0000 Subject: [PATCH] add ax88772C AX88772C_eeprom_tools --- kernel/kernel/sched/stop_task.c | 48 +++++++++++++++++++----------------------------- 1 files changed, 19 insertions(+), 29 deletions(-) diff --git a/kernel/kernel/sched/stop_task.c b/kernel/kernel/sched/stop_task.c index 6446d61..ceb5b6b 100644 --- a/kernel/kernel/sched/stop_task.c +++ b/kernel/kernel/sched/stop_task.c @@ -11,10 +11,15 @@ #ifdef CONFIG_SMP static int -select_task_rq_stop(struct task_struct *p, int cpu, int sd_flag, int flags, - int sibling_count_hint) +select_task_rq_stop(struct task_struct *p, int cpu, int sd_flag, int flags) { return task_cpu(p); /* stop tasks as never migrate */ +} + +static int +balance_stop(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) +{ + return sched_stop_runnable(rq); } #endif /* CONFIG_SMP */ @@ -24,19 +29,18 @@ /* we're never preempted */ } -static struct task_struct * -pick_next_task_stop(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) +static void set_next_task_stop(struct rq *rq, struct task_struct *stop, bool first) { - struct task_struct *stop = rq->stop; + stop->se.exec_start = rq_clock_task(rq); +} - if (!stop || !task_on_rq_queued(stop)) +static struct task_struct *pick_next_task_stop(struct rq *rq) +{ + if (!sched_stop_runnable(rq)) return NULL; - put_prev_task(rq, prev); - - stop->se.exec_start = rq_clock_task(rq); - - return stop; + set_next_task_stop(rq, rq->stop, true); + return rq->stop; } static void @@ -87,13 +91,6 @@ { } -static void set_curr_task_stop(struct rq *rq) -{ - struct task_struct *stop = rq->stop; - - stop->se.exec_start = rq_clock_task(rq); -} - static void switched_to_stop(struct rq *rq, struct task_struct *p) { BUG(); /* its impossible to change to this class */ @@ -105,12 +102,6 @@ BUG(); /* how!?, what priority? */ } -static unsigned int -get_rr_interval_stop(struct rq *rq, struct task_struct *task) -{ - return 0; -} - static void update_curr_stop(struct rq *rq) { } @@ -118,8 +109,8 @@ /* * Simple, special scheduling class for the per-CPU stop tasks: */ -const struct sched_class stop_sched_class = { - .next = &dl_sched_class, +const struct sched_class stop_sched_class + __section("__stop_sched_class") = { .enqueue_task = enqueue_task_stop, .dequeue_task = dequeue_task_stop, @@ -129,16 +120,15 @@ .pick_next_task = pick_next_task_stop, .put_prev_task = put_prev_task_stop, + .set_next_task = set_next_task_stop, #ifdef CONFIG_SMP + .balance = balance_stop, .select_task_rq = select_task_rq_stop, .set_cpus_allowed = set_cpus_allowed_common, #endif - .set_curr_task = set_curr_task_stop, .task_tick = task_tick_stop, - - .get_rr_interval = get_rr_interval_stop, .prio_changed = prio_changed_stop, .switched_to = switched_to_stop, -- Gitblit v1.6.2