comparison packages/isoinfra/current/include/sched.h @ 115:6ed91473a1cd ecos-sw-2000-08-21

Merge from eCos master repository on 2000-08-21-22:40:54-BST
author jlarmour
date Fri, 25 Aug 2000 17:32:38 +0000
parents
children e0c0827131d1
comparison
equal deleted inserted replaced
114:5ad2b71d525e 115:6ed91473a1cd
1 #ifndef CYGONCE_ISO_SCHED_H
2 #define CYGONCE_ISO_SCHED_H
3 /*========================================================================
4 //
5 // sched.h
6 //
7 // POSIX scheduler functions
8 //
9 //========================================================================
10 //####COPYRIGHTBEGIN####
11 //
12 // -------------------------------------------
13 // The contents of this file are subject to the Red Hat eCos Public License
14 // Version 1.1 (the "License"); you may not use this file except in
15 // compliance with the License. You may obtain a copy of the License at
16 // http://www.redhat.com/
17 //
18 // Software distributed under the License is distributed on an "AS IS"
19 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
20 // License for the specific language governing rights and limitations under
21 // the License.
22 //
23 // The Original Code is eCos - Embedded Configurable Operating System,
24 // released September 30, 1998.
25 //
26 // The Initial Developer of the Original Code is Red Hat.
27 // Portions created by Red Hat are
28 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
29 // All Rights Reserved.
30 // -------------------------------------------
31 //
32 //####COPYRIGHTEND####
33 //========================================================================
34 //#####DESCRIPTIONBEGIN####
35 //
36 // Author(s): jlarmour
37 // Contributors:
38 // Date: 2000-04-14
39 // Purpose: This file provides the scheduler macros, types and functions
40 // required by POSIX 1003.1.
41 // Description: The real contents of this file get set from the
42 // configuration (set by the implementation)
43 // Usage: #include <sched.h>
44 //
45 //####DESCRIPTIONEND####
46 //
47 //======================================================================
48 */
49
50 /* CONFIGURATION */
51
52 #include <pkgconf/isoinfra.h> /* Configuration header */
53
54 /* INCLUDES */
55
56 #include <time.h>
57
58 #if CYGINT_ISO_SCHED_IMPL
59 # ifdef CYGBLD_ISO_SCHED_IMPL_HEADER
60 # include CYGBLD_ISO_SCHED_IMPL_HEADER
61 # else
62
63 //-----------------------------------------------------------------------------
64 // Scheduling Policys
65
66 #define SCHED_OTHER 1
67 #define SCHED_FIFO 2
68 #define SCHED_RR 3
69
70 //-----------------------------------------------------------------------------
71 //Process scheduling functions.
72
73 #ifdef __cplusplus
74 extern "C" {
75 #endif
76
77 // Set scheduling parameters for given process.
78 extern int sched_setparam (pid_t pid, const struct sched_param *param);
79
80 // Get scheduling parameters for given process.
81 extern int sched_getparam (pid_t pid, struct sched_param *param);
82
83 // Set scheduling policy and/or parameters for given process.
84 extern int sched_setscheduler (pid_t pid,
85 int policy,
86 const struct sched_param *param);
87
88 // Get scheduling policy for given process.
89 extern int sched_getscheduler (pid_t pid);
90
91 // Force current thread to relinquish the processor.
92 extern int sched_yield (void);
93
94 //-----------------------------------------------------------------------------
95 // Scheduler parameter limits.
96
97 // Get maximum priority value for a policy.
98 extern int sched_get_priority_max (int policy);
99
100 // Get minimum priority value for a policy.
101 extern int sched_get_priority_min (int policy);
102
103 // Get the SCHED_RR interval for the given process.
104 extern int sched_rr_get_interval (pid_t pid, struct timespec *t);
105
106 #ifdef __cplusplus
107 } /* extern "C" */
108 #endif
109
110 #endif
111
112 #endif /* if CYGINT_ISO_SCHED_IMPL */
113
114 #endif /* CYGONCE_ISO_SCHED_H multiple inclusion protection */
115
116 /* EOF sched.h */