1 INTERFACE [sched_fixed_prio || sched_fp_wfq]:
5 #include "member_offs.h"
10 struct L4_sched_param_fixed_prio : public L4_sched_param
12 enum : Smword { Class = -1 };
20 friend class Jdb_thread_list;
22 friend struct Jdb_thread_list_policy;
25 typedef typename E::Fp_list List;
26 unsigned prio_highest;
31 { sc->_prio = Config::Kernel_prio; }
33 void enqueue(E *, bool);
35 E *next_to_run() const;
39 // ---------------------------------------------------------------------------
40 IMPLEMENTATION [sched_fixed_prio || sched_fp_wfq]:
45 #include "std_macros.h"
52 Ready_queue_fp<E>::next_to_run() const
53 { return prio_next[prio_highest].front(); }
56 * Enqueue context in ready-list.
61 Ready_queue_fp<E>::enqueue(E *i, bool is_current_sched)
63 assert_kdb(cpu_lock.test());
65 // Don't enqueue threads which are already enqueued
66 if (EXPECT_FALSE (i->in_ready_list()))
69 unsigned short prio = i->prio();
71 if (prio > prio_highest)
74 prio_next[prio].push(i, is_current_sched ? List::Front : List::Back);
78 * Remove context from ready-list.
80 IMPLEMENT inline NEEDS ["cpu_lock.h", "kdb_ke.h", "std_macros.h"]
83 Ready_queue_fp<E>::dequeue(E *i)
85 assert_kdb (cpu_lock.test());
87 // Don't dequeue threads which aren't enqueued
88 if (EXPECT_FALSE (!i->in_ready_list()))
91 unsigned short prio = i->prio();
93 prio_next[prio].remove(i);
95 while (prio_next[prio_highest].empty() && prio_highest)
103 Ready_queue_fp<E>::requeue(E *i)
105 if (!i->in_ready_list())
108 prio_next[i->prio()].rotate_to(*++List::iter(i));
112 PUBLIC template<typename E> inline
114 Ready_queue_fp<E>::deblock_refill(E *)