Subversion Repositories shark

Rev

Rev 1618 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Paolo Gai           <pj@gandalf.sssup.it>
10
 *   Massimiliano Giorgi <massy@gandalf.sssup.it>
11
 *   Luca Abeni          <luca@gandalf.sssup.it>
12
 *   (see the web pages for full authors list)
13
 *
14
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
15
 *
16
 * http://www.sssup.it
17
 * http://retis.sssup.it
18
 * http://shark.sssup.it
19
 */
20
 
21
/**
22
 ------------
763 anton 23
 CVS :        $Id: time.h,v 1.2 2004-06-21 16:50:37 anton Exp $
2 pj 24
 
25
 File:        $File$
763 anton 26
 Revision:    $Revision: 1.2 $
27
 Last update: $Date: 2004-06-21 16:50:37 $
2 pj 28
 ------------
29
 
30
 time.h
31
 
32
**/
33
 
34
/*
35
 * Copyright (C) 2000 Paolo Gai
36
 *
37
 * This program is free software; you can redistribute it and/or modify
38
 * it under the terms of the GNU General Public License as published by
39
 * the Free Software Foundation; either version 2 of the License, or
40
 * (at your option) any later version.
41
 *
42
 * This program is distributed in the hope that it will be useful,
43
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
44
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
45
 * GNU General Public License for more details.
46
 *
47
 * You should have received a copy of the GNU General Public License
48
 * along with this program; if not, write to the Free Software
49
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
50
 *
51
 */
52
 
53
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
54
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
55
 
56
#ifndef __include_time_h_
57
#define __include_time_h_
58
 
59
#ifdef __cplusplus
60
extern "C" {
61
#endif
62
 
63
/* timespec defined in ll/sys/ll/time.h */
1621 fabio 64
#include <arch/time.h>
2 pj 65
#include <signal.h>
66
 
67
 
68
#include <sys/htypes.h>
69
 
70
// never used, required by posix
71
#define CLK_TCK 100
72
 
73
__DJ_clock_t
74
#undef __DJ_clock_t
75
#define __DJ_clock_t
76
 
77
__DJ_clockid_t
78
#undef __DJ_clockid_t
79
#define __DJ_clockid_t
80
 
81
__DJ_time_t
82
#undef __DJ_time_t
83
#define __DJ_time_t
84
 
85
__DJ_timer_t
86
#undef __DJ_timer_t
87
#define __DJ_timer_t
88
 
89
struct itimerspec {
90
  struct timespec it_interval;
91
  struct timespec it_value;
92
};
93
 
94
/*Note that the CLOCK_REALTIME doesn't start from the epoch!!!*/
95
#define CLOCK_REALTIME 0
96
 
97
#define TIMER_ABSTIME 1
98
 
99
int clock_settime(clockid_t clock_id, const struct timespec *tp);
100
int clock_gettime(clockid_t clock_id, struct timespec *tp);
101
int clock_getres(clockid_t clock_id, struct timespec *res);
102
 
103
int timer_create(clockid_t clock_id, struct sigevent *evp, timer_t *timerid);
104
int timer_delete(timer_t timerid);
105
int timer_settime(timer_t timerid, int flags, const struct itimerspec *value,
106
                  struct itimerspec *ovalue);
107
int timer_gettime(timer_t timerid, struct itimerspec *value);
108
int timer_getoverrun(timer_t timerid);
109
 
110
// look at nanoslp.c
111
int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
763 anton 112
unsigned int sleep(unsigned int seconds);
113
unsigned int usleep(unsigned int usec);
2 pj 114
 
115
void TIMER_register_module();
116
 
117
 
118
#ifdef __cplusplus
119
}
120
#endif
121
 
122
#endif /* !__dj_include_time_h_ */