2 * Copyright 2013, Paweł Dziepak, pdziepak@quarnos.org.
3 * Distributed under the terms of the MIT License.
5 #ifndef KERNEL_SCHEDULER_MODES_H
6 #define KERNEL_SCHEDULER_MODES_H
9 #include <kscheduler.h>
10 #include <thread_types.h>
13 struct scheduler_mode_operations
{
16 bigtime_t base_quantum
;
17 bigtime_t minimal_quantum
;
18 bigtime_t quantum_multipliers
[2];
20 bigtime_t maximum_latency
;
22 void (*switch_to_mode
)();
23 void (*set_cpu_enabled
)(int32 cpu
, bool enabled
);
24 bool (*has_cache_expired
)(
25 const Scheduler::ThreadData
* threadData
);
26 Scheduler::CoreEntry
* (*choose_core
)(
27 const Scheduler::ThreadData
* threadData
);
28 Scheduler::CoreEntry
* (*rebalance
)(
29 const Scheduler::ThreadData
* threadData
);
30 void (*rebalance_irqs
)(bool idle
);
33 extern struct scheduler_mode_operations gSchedulerLowLatencyMode
;
34 extern struct scheduler_mode_operations gSchedulerPowerSavingMode
;
40 extern scheduler_mode gCurrentModeID
;
41 extern scheduler_mode_operations
* gCurrentMode
;
47 #endif // KERNEL_SCHEDULER_MODES_H