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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [net/] [lwip_tcpip/] [current/] [src/] [netif/] [ppp/] [timesys.h] - Blame information for rev 865

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
/**
2
 * @file
3
 * System time and timeout system
4
 *
5
 */
6
 
7
/*
8
 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
9
 * All rights reserved.
10
 *
11
 * Redistribution and use in source and binary forms, with or without
12
 * modification, are permitted provided that the following conditions
13
 * are met:
14
 * 1. Redistributions of source code must retain the above copyright
15
 *    notice, this list of conditions and the following disclaimer.
16
 * 2. Redistributions in binary form must reproduce the above copyright
17
 *    notice, this list of conditions and the following disclaimer in the
18
 *    documentation and/or other materials provided with the distribution.
19
 * 3. Neither the name of the Institute nor the names of its contributors
20
 *    may be used to endorse or promote products derived from this software
21
 *    without specific prior written permission.
22
 *
23
 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
24
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
27
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33
 * SUCH DAMAGE.
34
 *
35
 * Author: Simon Kallweit <simon.kallweit(at)intefo.ch>
36
 */
37
 
38
#ifndef TIMESYS_H
39
#define TIMESYS_H
40
 
41
#include "lwip/sys.h"
42
#include "lwip/err.h"
43
 
44
typedef void (*ppp_timeout_handler_t)(void *arg);
45
 
46
#define TIMEOUT(f, a, t)    ppp_timeout(f, a, t)
47
#define UNTIMEOUT(f, a)     ppp_untimeout(f, a)
48
 
49
/**
50
 * Initialize the timesys.
51
 * @return Returns ERR_OK if successful.
52
 */
53
err_t ppp_timesys_init(void);
54
 
55
/**
56
 * Reset the timesys. Removes all timeouts from the list.
57
 */
58
void ppp_timesys_reset(void);
59
 
60
/**
61
 * Update the timesys.
62
 * @param delta Update interval in milliseconds.
63
 */
64
void ppp_timesys_update(u32_t delta);
65
 
66
/**
67
 * Returns the current time.
68
 * @return Returns the time in jiffies.
69
 */
70
u32_t ppp_jiffies(void);
71
 
72
/**
73
 * Setup a timeout.
74
 * @param handler Timeout handler callback
75
 * @param arg Timeout handler argument
76
 * @param timeout Timeout in seconds
77
 */
78
void ppp_timeout(ppp_timeout_handler_t handler, void *arg, int timeout);
79
 
80
/**
81
 * Clear a timeout.
82
 * @param handler Timeout handler callback
83
 * @param arg Timeout handler argument
84
 */
85
void ppp_untimeout(ppp_timeout_handler_t handler, void *arg);
86
 
87
#endif /* TIMESYS_H */

powered by: WebSVN 2.1.0

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