File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,13 +18,13 @@ struct thread_info;
1818#define SCHED_OPT_TICK 3
1919
2020struct sched {
21- int (* init )(void );
21+ int (* init )(struct thread_info * thread );
2222 int (* enqueue )(struct thread_info * thread );
2323 int (* dequeue )(struct thread_info * thread );
2424 int (* elect )(int switch_type );
2525};
2626
27- int sched_select (int sched_type );
27+ int sched_select (int sched_type , struct thread_info * thread );
2828int sched_enqueue (struct thread_info * thread );
2929int sched_dequeue (struct thread_info * thread );
3030int sched_elect (int flags );
Original file line number Diff line number Diff line change @@ -135,9 +135,6 @@ struct thread_info *start_kernel(void)
135135 show_page_bitmap (); // init_pages();
136136 kmem_cache_init ();
137137
138- /* select a scheduling policy */
139- sched_select (SCHED_CLASS );
140-
141138 /* idle_thread is not added to the runqueue */
142139 task_init (& idle_task );
143140 thread_idle =
@@ -161,6 +158,9 @@ struct thread_info *start_kernel(void)
161158 printk ("Created main_thread at <%p> with priority=%d\n" , thread_main ,
162159 thread_main -> ti_priority );
163160
161+ /* select a scheduling policy */
162+ sched_select (SCHED_CLASS , thread_main );
163+
164164 /* Reclaim the early-stack physical memory. In the current context, no
165165 * page allocation after this point are allowed. */
166166 printk ("Reclaim early stack's physical memory (%d Bytes, order=%d).\n" ,
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ extern const struct sched sched_bitmap;
66
77static const struct sched * sched ;
88
9- int sched_select (int sched_type )
9+ int sched_select (int sched_type , struct thread_info * thread )
1010{
1111 switch (sched_type ) {
1212 case SCHED_CLASS_RR :
@@ -19,7 +19,7 @@ int sched_select(int sched_type)
1919 return -1 ;
2020 }
2121
22- return sched -> init ();
22+ return sched -> init (thread );
2323}
2424
2525int sched_enqueue (struct thread_info * thread )
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ static struct {
1818 .expire = & _expire ,
1919};
2020
21- static int sched_bitmap_init (void )
21+ static int sched_bitmap_init (__unused struct thread_info * thread )
2222{
2323 INIT_BITMAP (sched_struct .active );
2424 INIT_BITMAP (sched_struct .expire );
Original file line number Diff line number Diff line change 77static LIST_HEAD (rr_runq );
88extern struct thread_info * thread_idle ;
99
10- int sched_rr_init (void )
10+ int sched_rr_init (struct thread_info * thread )
1111{
12+ sched_rr_enqueue (thread );
1213 return 0 ;
1314}
1415
You can’t perform that action at this time.
0 commit comments