OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [conts/] [posix/] [libposix/] [include/] [posix/] [sched.h] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
/* Definitions for POSIX 1003.1b-1993 (aka POSIX.4) scheduling interface.
2
   Copyright (C) 1996,1997,1999,2001-2003,2004 Free Software Foundation, Inc.
3
   This file is part of the GNU C Library.
4
 
5
   The GNU C Library is free software; you can redistribute it and/or
6
   modify it under the terms of the GNU Lesser General Public
7
   License as published by the Free Software Foundation; either
8
   version 2.1 of the License, or (at your option) any later version.
9
 
10
   The GNU C Library is distributed in the hope that it will be useful,
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
   Lesser General Public License for more details.
14
 
15
   You should have received a copy of the GNU Lesser General Public
16
   License along with the GNU C Library; if not, write to the Free
17
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18
   02111-1307 USA.  */
19
 
20
#ifndef _SCHED_H
21
#define _SCHED_H        1
22
 
23
#include <features.h>
24
 
25
/* Get type definitions.  */
26
#include <bits/types.h>
27
 
28
#define __need_timespec
29
#include <time.h>
30
 
31
/* Get system specific constant and data structure definitions.  */
32
#include <bits/sched.h>
33
/* Define the real names for the elements of `struct sched_param'.  */
34
#define sched_priority  __sched_priority
35
 
36
 
37
__BEGIN_DECLS
38
 
39
/* Set scheduling parameters for a process.  */
40
extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param)
41
     __THROW;
42
 
43
/* Retrieve scheduling parameters for a particular process.  */
44
extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __THROW;
45
 
46
/* Set scheduling algorithm and/or parameters for a process.  */
47
extern int sched_setscheduler (__pid_t __pid, int __policy,
48
                               __const struct sched_param *__param) __THROW;
49
 
50
/* Retrieve scheduling algorithm for a particular purpose.  */
51
extern int sched_getscheduler (__pid_t __pid) __THROW;
52
 
53
/* Yield the processor.  */
54
extern int sched_yield (void) __THROW;
55
 
56
/* Get maximum priority value for a scheduler.  */
57
extern int sched_get_priority_max (int __algorithm) __THROW;
58
 
59
/* Get minimum priority value for a scheduler.  */
60
extern int sched_get_priority_min (int __algorithm) __THROW;
61
 
62
/* Get the SCHED_RR interval for the named process.  */
63
extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW;
64
 
65
 
66
#ifdef __USE_GNU
67
/* Access macros for `cpu_set'.  */
68
#define CPU_SETSIZE __CPU_SETSIZE
69
#define CPU_SET(cpu, cpusetp)   __CPU_SET (cpu, cpusetp)
70
#define CPU_CLR(cpu, cpusetp)   __CPU_CLR (cpu, cpusetp)
71
#define CPU_ISSET(cpu, cpusetp) __CPU_ISSET (cpu, cpusetp)
72
#define CPU_ZERO(cpusetp)       __CPU_ZERO (cpusetp)
73
 
74
 
75
/* Set the CPU affinity for a task */
76
extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize,
77
                              __const cpu_set_t *__cpuset) __THROW;
78
 
79
/* Get the CPU affinity for a task */
80
extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize,
81
                              cpu_set_t *__cpuset) __THROW;
82
#endif
83
 
84
__END_DECLS
85
 
86
#endif /* sched.h */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.