include/nucleus/core.h

00001 /*
00002  * Copyright (C) 2001-2007 Philippe Gerum <rpm@xenomai.org>.
00003  *
00004  * Xenomai is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published
00006  * by the Free Software Foundation; either version 2 of the License,
00007  * or (at your option) any later version.
00008  *
00009  * Xenomai is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with Xenomai; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00017  * 02111-1307, USA.
00018  *
00019  * Core pod definitions. The core pod supports all APIs. Core APIs,
00020  * namely POSIX, native and RTDM, only use a sub-range of the
00021  * available priority levels of the core pod, in order to have them
00022  * exhibit a 1:1 mapping with Linux's SCHED_FIFO ascending priority
00023  * scale [1..99]. Non-core APIs which exhibit inverted priority scales
00024  * (e.g. VxWorks, VRTX), should normalize the priority values
00025  * internally when calling the priority-sensitive services of the
00026  * nucleus, so that they fit in the available range provided by the
00027  * latter.
00028  */
00029 
00030 #ifndef _XENO_NUCLEUS_CORE_H
00031 #define _XENO_NUCLEUS_CORE_H
00032 
00033 /* Visible priority range supported by the core pod. */
00034 #define XNCORE_MIN_PRIO     0
00035 #define XNCORE_MAX_PRIO     257
00036 /* Idle priority of the root thread scheduled within the core pod. */
00037 #define XNCORE_IDLE_PRIO    -1
00038 
00039 /* Total number of priority levels (including the hidden root one) */
00040 #define XNCORE_NR_PRIO      (XNCORE_MAX_PRIO - XNCORE_IDLE_PRIO + 1)
00041 
00042 /* Priority sub-range used by core APIs. */
00043 #define XNCORE_LOW_PRIO     0
00044 #define XNCORE_HIGH_PRIO    99
00045 
00046 /* Priority of IRQ servers in user-space. */
00047 #define XNCORE_IRQ_PRIO     XNCORE_MAX_PRIO
00048 
00049 #define XNCORE_PAGE_SIZE                512 /* A reasonable value for the xnheap page size */
00050 #define XNCORE_PAGE_MASK                (~(XNCORE_PAGE_SIZE-1))
00051 #define XNCORE_PAGE_ALIGN(addr) (((addr)+XNCORE_PAGE_SIZE-1)&XNCORE_PAGE_MASK)
00052 
00053 #endif /* !_XENO_NUCLEUS_CORE_H */

Generated on Mon Mar 24 18:02:40 2008 for Xenomai API by  doxygen 1.5.3