This source file includes following definitions.
- nice_to_rlimit
- rlimit_to_nice
1
2 #ifndef _LINUX_SCHED_PRIO_H
3 #define _LINUX_SCHED_PRIO_H
4
5 #define MAX_NICE 19
6 #define MIN_NICE -20
7 #define NICE_WIDTH (MAX_NICE - MIN_NICE + 1)
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #define MAX_USER_RT_PRIO 100
23 #define MAX_RT_PRIO MAX_USER_RT_PRIO
24
25 #define MAX_PRIO (MAX_RT_PRIO + NICE_WIDTH)
26 #define DEFAULT_PRIO (MAX_RT_PRIO + NICE_WIDTH / 2)
27
28
29
30
31
32
33 #define NICE_TO_PRIO(nice) ((nice) + DEFAULT_PRIO)
34 #define PRIO_TO_NICE(prio) ((prio) - DEFAULT_PRIO)
35
36
37
38
39
40
41 #define USER_PRIO(p) ((p)-MAX_RT_PRIO)
42 #define TASK_USER_PRIO(p) USER_PRIO((p)->static_prio)
43 #define MAX_USER_PRIO (USER_PRIO(MAX_PRIO))
44
45
46
47
48 static inline long nice_to_rlimit(long nice)
49 {
50 return (MAX_NICE - nice + 1);
51 }
52
53
54
55
56 static inline long rlimit_to_nice(long prio)
57 {
58 return (MAX_NICE - prio + 1);
59 }
60
61 #endif