Xenomai  3.0.8
calibration.h
1 /*
2  * Copyright (C) 2001,2002,2003,2004,2005 Philippe Gerum <rpm@xenomai.org>.
3  *
4  * 64-bit PowerPC adoption
5  * copyright (C) 2005 Taneli Vähäkangas and Heikki Lindholm
6  *
7  * Xenomai is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * Xenomai is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with Xenomai; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20  * 02111-1307, USA.
21  */
22 #ifndef _COBALT_POWERPC_ASM_CALIBRATION_H
23 #define _COBALT_POWERPC_ASM_CALIBRATION_H
24 
25 static inline void xnarch_get_latencies(struct xnclock_gravity *p)
26 {
27 #if CONFIG_XENO_OPT_TIMING_SCHEDLAT != 0
28 #define __sched_latency CONFIG_XENO_OPT_TIMING_SCHEDLAT
29 #elif defined(CONFIG_PPC_PASEMI)
30 #define __sched_latency 1000
31 #elif defined(CONFIG_WALNUT)
32 #define __sched_latency 11000
33 #elif defined(CONFIG_YOSEMITE)
34 #define __sched_latency 2000
35 #elif defined(CONFIG_BUBINGA)
36 #define __sched_latency 8000
37 #elif defined(CONFIG_SYCAMORE)
38 #define __sched_latency 8000
39 #elif defined(CONFIG_SEQUOIA)
40 #define __sched_latency 3000
41 #elif defined(CONFIG_LWMON5)
42 #define __sched_latency 2800
43 #elif defined(CONFIG_OCOTEA)
44 #define __sched_latency 2700
45 #elif defined(CONFIG_BAMBOO)
46 #define __sched_latency 4000
47 #elif defined(CONFIG_TAISHAN)
48 #define __sched_latency 1800
49 #elif defined(CONFIG_RAINIER)
50 #define __sched_latency 2300
51 #elif defined(CONFIG_YUCCA)
52 #define __sched_latency 2780
53 #elif defined(CONFIG_YELLOWSTONE)
54 #define __sched_latency 2700
55 #elif defined(CONFIG_YOSEMITE)
56 #define __sched_latency 2500
57 #elif defined(CONFIG_MPC8349_ITX)
58 #define __sched_latency 2500
59 #elif defined(CONFIG_MPC836x_MDS)
60 #define __sched_latency 2900
61 #elif defined(CONFIG_MPC5121_ADS)
62 #define __sched_latency 4000
63 #elif defined(CONFIG_MPC8272_ADS)
64 #define __sched_latency 5500
65 #elif defined(CONFIG_MPC85xx_RDB)
66 #define __sched_latency 2000
67 #elif defined(CONFIG_MVME7100)
68 #define __sched_latency 1500
69 #elif defined(CONFIG_TQM8548)
70 #define __sched_latency 500
71 #elif defined(CONFIG_TQM8560)
72 #define __sched_latency 1000
73 #elif defined(CONFIG_TQM8555)
74 #define __sched_latency 2000
75 #elif defined(CONFIG_KUP4K)
76 #define __sched_latency 22000
77 #elif defined(CONFIG_P1022_DS)
78 #define __sched_latency 3000
79 /*
80  * Check for the most generic configs at the bottom of this list, so
81  * that the most specific choices available are picked first.
82  */
83 #elif defined(CONFIG_CORENET_GENERIC)
84 #define __sched_latency 2800
85 #elif defined(CONFIG_MPC85xx) || defined(CONFIG_PPC_85xx)
86 #define __sched_latency 1000
87 #elif defined(CONFIG_405GPR)
88 #define __sched_latency 9000
89 #elif defined(CONFIG_PPC_MPC52xx)
90 #define __sched_latency 4500
91 #elif defined(CONFIG_PPC_8xx)
92 #define __sched_latency 25000
93 #endif
94 
95 #ifndef __sched_latency
96 /* Platform is unknown: pick a default value. */
97 #ifdef CONFIG_PPC64
98 #define __sched_latency 1000
99 #else
100 #define __sched_latency 4000
101 #endif
102 #endif
103  p->user = xnclock_ns_to_ticks(&nkclock, __sched_latency);
104  p->kernel = xnclock_ns_to_ticks(&nkclock, CONFIG_XENO_OPT_TIMING_KSCHEDLAT);
105  p->irq = xnclock_ns_to_ticks(&nkclock, CONFIG_XENO_OPT_TIMING_IRQLAT);
106 }
107 
108 #undef __sched_latency
109 
110 #endif /* !_COBALT_POWERPC_ASM_CALIBRATION_H */