1/*
2 * Copyright 2013, Pawe�� Dziepak, pdziepak@quarnos.org.
3 * Copyright 2011, Ingo Weinhold, ingo_weinhold@gmx.de.
4 * Distributed under the terms of the MIT License.
5 */
6#ifndef KERNEL_SCHEDULER_COMMON_H
7#define KERNEL_SCHEDULER_COMMON_H
8
9
10#include <algorithm>
11
12#include <debug.h>
13#include <kscheduler.h>
14#include <load_tracking.h>
15#include <smp.h>
16#include <thread.h>
17#include <user_debugger.h>
18#include <util/MinMaxHeap.h>
19
20#include "RunQueue.h"
21
22
23//#define TRACE_SCHEDULER
24#ifdef TRACE_SCHEDULER
25#	define TRACE(...) dprintf_no_syslog(__VA_ARGS__)
26#else
27#	define TRACE(...) do { } while (false)
28#endif
29
30
31namespace Scheduler {
32
33
34class CPUEntry;
35class CoreEntry;
36
37const int kLowLoad = kMaxLoad * 20 / 100;
38const int kTargetLoad = kMaxLoad * 55 / 100;
39const int kHighLoad = kMaxLoad * 70 / 100;
40const int kMediumLoad = (kHighLoad + kTargetLoad) / 2;
41const int kVeryHighLoad = (kMaxLoad + kHighLoad) / 2;
42
43const int kLoadDifference = kMaxLoad * 20 / 100;
44
45extern bool gSingleCore;
46extern bool gTrackCoreLoad;
47extern bool gTrackCPULoad;
48
49
50void init_debug_commands();
51
52
53}	// namespace Scheduler
54
55
56#endif	// KERNEL_SCHEDULER_COMMON_H
57
58