sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
timeouts.h
Go to the documentation of this file.
1
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 modification,
12 * are permitted provided that the following conditions are met:
13 *
14 * 1. Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright notice,
17 * this list of conditions and the following disclaimer in the documentation
18 * and/or other materials provided with the distribution.
19 * 3. The name of the author may not be used to endorse or promote products
20 * derived from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
23 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
25 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
27 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
30 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
31 * OF SUCH DAMAGE.
32 *
33 * This file is part of the lwIP TCP/IP stack.
34 *
35 * Author: Adam Dunkels <adam@sics.se>
36 * Simon Goldschmidt
37 *
38 */
39#ifndef LWIP_HDR_TIMEOUTS_H
40#define LWIP_HDR_TIMEOUTS_H
41
42#include "lwip/opt.h"
43#include "lwip/err.h"
44#if !NO_SYS
45#include "lwip/sys.h"
46#endif
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
52#ifndef LWIP_DEBUG_TIMERNAMES
53#ifdef LWIP_DEBUG
54#define LWIP_DEBUG_TIMERNAMES SYS_DEBUG
55#else /* LWIP_DEBUG */
56#define LWIP_DEBUG_TIMERNAMES 0
57#endif /* LWIP_DEBUG*/
58#endif
59
63#define SYS_TIMEOUTS_SLEEPTIME_INFINITE 0xFFFFFFFF
64
67typedef void (* lwip_cyclic_timer_handler)(void);
68
72 u32_t interval_ms;
74#if LWIP_DEBUG_TIMERNAMES
75 const char* handler_name;
76#endif /* LWIP_DEBUG_TIMERNAMES */
77};
78
81extern const struct lwip_cyclic_timer lwip_cyclic_timers[];
83extern const int lwip_num_cyclic_timers;
84
85#if LWIP_TIMERS
86
92typedef void (* sys_timeout_handler)(void *arg);
93
94struct sys_timeo {
95 struct sys_timeo *next;
96 u32_t time;
97 sys_timeout_handler h;
98 void *arg;
99#if LWIP_DEBUG_TIMERNAMES
100 const char* handler_name;
101#endif /* LWIP_DEBUG_TIMERNAMES */
102};
103
104void sys_timeouts_init(void);
105
106#if LWIP_DEBUG_TIMERNAMES
107void sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name);
108#define sys_timeout(msecs, handler, arg) sys_timeout_debug(msecs, handler, arg, #handler)
109#else /* LWIP_DEBUG_TIMERNAMES */
110void sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg);
111#endif /* LWIP_DEBUG_TIMERNAMES */
112
113void sys_untimeout(sys_timeout_handler handler, void *arg);
114void sys_restart_timeouts(void);
115void sys_check_timeouts(void);
116u32_t sys_timeouts_sleeptime(void);
117
118#if LWIP_TESTMODE
119struct sys_timeo** sys_timeouts_get_next_timeout(void);
120void lwip_cyclic_timer(void *arg);
121#endif
122
123#endif /* LWIP_TIMERS */
124
125#ifdef __cplusplus
126}
127#endif
128
129#endif /* LWIP_HDR_TIMEOUTS_H */
void(*) lwip_cyclic_timer_handler(void)
Definition timeouts.h:67
const int lwip_num_cyclic_timers
Definition timeouts.c:117
const struct lwip_cyclic_timer lwip_cyclic_timers[]
Definition timeouts.c:77