Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


added new copyright and license
[palacios.git] / palacios / include / uip / clock.h
1 /**
2  * \defgroup clock Clock interface
3  *
4  * The clock interface is the interface between the \ref timer "timer library"
5  * and the platform specific clock functionality. The clock
6  * interface must be implemented for each platform that uses the \ref
7  * timer "timer library".
8  *
9  * The clock interface does only one this: it measures time. The clock
10  * interface provides a macro, CLOCK_SECOND, which corresponds to one
11  * second of system time.
12  *
13  * \sa \ref timer "Timer library"
14  *
15  * @{
16  */
17
18 /*
19  * Copyright (c) 2004, Swedish Institute of Computer Science.
20  * All rights reserved.
21  *
22  * Redistribution and use in source and binary forms, with or without
23  * modification, are permitted provided that the following conditions
24  * are met:
25  * 1. Redistributions of source code must retain the above copyright
26  *    notice, this list of conditions and the following disclaimer.
27  * 2. Redistributions in binary form must reproduce the above copyright
28  *    notice, this list of conditions and the following disclaimer in the
29  *    documentation and/or other materials provided with the distribution.
30  * 3. Neither the name of the Institute nor the names of its contributors
31  *    may be used to endorse or promote products derived from this software
32  *    without specific prior written permission.
33  *
34  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
35  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
36  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
37  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
38  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
39  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
40  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
41  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
42  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
43  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
44  * SUCH DAMAGE.
45  *
46  * This file is part of the uIP TCP/IP stack
47  *
48  * Author: Adam Dunkels <adam@sics.se>
49  *
50  * $Id: clock.h,v 1.3 2008/08/28 19:43:32 andrewlxia Exp $
51  */
52 #ifndef __CLOCK_H__
53 #define __CLOCK_H__
54
55 #include <geekos/ktypes.h>
56 #include <geekos/timer.h>
57
58 #define CLOCK_CONF_SECOND 1000
59
60 typedef ulong_t clock_time_t;
61
62
63
64 /**
65  * Initialize the clock library.
66  *
67  * This function initializes the clock library and should be called
68  * from the main() function of the system.
69  *
70  */
71 //void clock_init(void);
72
73 /**
74  * Get the current clock time.
75  *
76  * This function returns the current system clock time.
77  *
78  * \return The current clock time, measured in system ticks.
79  */
80  
81  
82 //defined in the geekos/timer.c
83 extern clock_time_t clock_time(void);
84
85 /**
86  * A second, measured in system clock time.
87  *
88  * \hideinitializer
89  */
90 #ifdef CLOCK_CONF_SECOND
91 #define CLOCK_SECOND CLOCK_CONF_SECOND
92 #else
93 #define CLOCK_SECOND (clock_time_t)32
94 #endif
95
96 #endif /* __CLOCK_H__ */
97
98 /** @} */