xref: /haiku/src/system/kernel/scheduler/scheduler_modes.h (revision 1deede7388b04dbeec5af85cae7164735ea9e70d)
1 /*
2  * Copyright 2013, Paweł Dziepak, pdziepak@quarnos.org.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef KERNEL_SCHEDULER_MODES_H
6 #define KERNEL_SCHEDULER_MODES_H
7 
8 
9 #include <kscheduler.h>
10 #include <thread_types.h>
11 
12 
13 struct scheduler_mode_operations {
14 	const char*				name;
15 
16 	bigtime_t				base_quantum;
17 	bigtime_t				minimal_quantum;
18 	bigtime_t				quantum_multipliers[2];
19 
20 	bigtime_t				maximum_latency;
21 
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);
31 };
32 
33 extern struct scheduler_mode_operations gSchedulerLowLatencyMode;
34 extern struct scheduler_mode_operations gSchedulerPowerSavingMode;
35 
36 
37 namespace Scheduler {
38 
39 
40 extern scheduler_mode gCurrentModeID;
41 extern scheduler_mode_operations* gCurrentMode;
42 
43 
44 }
45 
46 
47 #endif	// KERNEL_SCHEDULER_MODES_H
48 
49