• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

include/posix/sched.h

00001 /*
00002  * Copyright (C) 2005 Philippe Gerum <rpm@xenomai.org>.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License as
00006  * published by the Free Software Foundation; either version 2 of the
00007  * License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018 
00019 #ifndef _XENO_POSIX_SCHED_H
00020 #define _XENO_POSIX_SCHED_H
00021 
00022 #if defined(__KERNEL__) || defined(__XENO_SIM__)
00023 
00024 #include <nucleus/xenomai.h>
00025 
00026 #ifdef __KERNEL__
00027 #include <linux/sched.h>
00028 #endif /* __KERNEL__ */
00029 
00030 #ifdef __XENO_SIM__
00031 #include <posix_overrides.h>
00032 #define SCHED_FIFO      1
00033 #define SCHED_RR        2
00034 #endif /* __XENO_SIM__ */
00035 
00036 #define SCHED_OTHER 0
00037 
00038 struct timespec;
00039 
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043 
00044 int sched_yield(void);
00045 
00046 int sched_get_priority_min(int policy);
00047 
00048 int sched_get_priority_max(int policy);
00049 
00050 int sched_rr_get_interval(int pid, struct timespec *interval);
00051 
00052 #ifdef __cplusplus
00053 }
00054 #endif
00055 
00056 #else /* !(__KERNEL__ || __XENO_SIM__) */
00057 
00058 #include_next <sched.h>
00059 
00060 int __real_sched_yield(void);
00061 
00062 #endif /* !(__KERNEL__ || __XENO_SIM__) */
00063 
00064 #ifndef __sched_extensions_defined
00065 #define __sched_extensions_defined
00066 
00067 #ifndef SCHED_SPORADIC
00068 #define SCHED_SPORADIC          10
00069 #define sched_ss_low_priority   ss.__sched_low_priority
00070 #define sched_ss_repl_period    ss.__sched_repl_period
00071 #define sched_ss_init_budget    ss.__sched_init_budget
00072 #define sched_ss_max_repl       ss.__sched_max_repl
00073 #endif  /* !SCHED_SPORADIC */
00074 
00075 struct __sched_ss_param {
00076         int __sched_low_priority;
00077         struct timespec __sched_repl_period;
00078         struct timespec __sched_init_budget;
00079         int __sched_max_repl;
00080 };
00081 
00082 struct sched_param_ex {
00083         int sched_priority;
00084         struct __sched_ss_param ss;
00085 };
00086 
00087 #endif /* __sched_extensions_defined */
00088 
00089 #endif /* SCHED_H */

Generated on Tue Jul 10 2012 20:41:22 for Xenomai API by  doxygen 1.7.1