Xenomai  3.0.8
sched-weak.h
1 /*
2  * Copyright (C) 2013 Philippe Gerum <rpm@xenomai.org>.
3  *
4  * Xenomai is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published
6  * by the Free Software Foundation; either version 2 of the License,
7  * or (at your option) any later version.
8  *
9  * Xenomai is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Xenomai; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17  * 02111-1307, USA.
18  */
19 #ifndef _COBALT_KERNEL_SCHED_WEAK_H
20 #define _COBALT_KERNEL_SCHED_WEAK_H
21 
22 #ifndef _COBALT_KERNEL_SCHED_H
23 #error "please don't include cobalt/kernel/sched-weak.h directly"
24 #endif
25 
31 #ifdef CONFIG_XENO_OPT_SCHED_WEAK
32 
33 #define XNSCHED_WEAK_MIN_PRIO 0
34 #define XNSCHED_WEAK_MAX_PRIO 99
35 #define XNSCHED_WEAK_NR_PRIO \
36  (XNSCHED_WEAK_MAX_PRIO - XNSCHED_WEAK_MIN_PRIO + 1)
37 
38 #if XNSCHED_WEAK_NR_PRIO > XNSCHED_CLASS_WEIGHT_FACTOR || \
39  (defined(CONFIG_XENO_OPT_SCALABLE_SCHED) && \
40  XNSCHED_WEAK_NR_PRIO > XNSCHED_MLQ_LEVELS)
41 #error "WEAK class has too many priority levels"
42 #endif
43 
44 extern struct xnsched_class xnsched_class_weak;
45 
46 struct xnsched_weak {
47  xnsched_queue_t runnable;
48 };
49 
50 static inline int xnsched_weak_init_thread(struct xnthread *thread)
51 {
52  return 0;
53 }
54 
55 #endif /* CONFIG_XENO_OPT_SCHED_WEAK */
56 
59 #endif /* !_COBALT_KERNEL_SCHED_WEAK_H */