vfs: check userland buffers before reading them.
[haiku.git] / src / system / kernel / scheduler / scheduler_common.h
blobdc2e5f31ccc5488defed52f8efbdf0830970c10f
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
10 #include <algorithm>
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>
20 #include "RunQueue.h"
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
31 namespace Scheduler {
34 class CPUEntry;
35 class CoreEntry;
37 const int kLowLoad = kMaxLoad * 20 / 100;
38 const int kTargetLoad = kMaxLoad * 55 / 100;
39 const int kHighLoad = kMaxLoad * 70 / 100;
40 const int kMediumLoad = (kHighLoad + kTargetLoad) / 2;
41 const int kVeryHighLoad = (kMaxLoad + kHighLoad) / 2;
43 const int kLoadDifference = kMaxLoad * 20 / 100;
45 extern bool gSingleCore;
46 extern bool gTrackCoreLoad;
47 extern bool gTrackCPULoad;
50 void init_debug_commands();
53 } // namespace Scheduler
56 #endif // KERNEL_SCHEDULER_COMMON_H