2 * Copyright (C) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
3 * Helsinki University of Technology, Finland.
5 * Copyright (C) 2005 Neil Cafferkey
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
27 #include <sys/types.h>
31 #include <exec/types.h>
38 #if !defined(AMIGA_INCLUDES_H) && defined(DEBUG)
39 #include <kern/amiga_includes.h> /* for the inline spl_n() */
42 #include <proto/exec.h>
44 extern BOOL
sleep_init(void);
45 extern void tsleep_send_timeout(struct SocketBase
*, const struct timeval
*);
46 extern void tsleep_abort_timeout(struct SocketBase
*, const struct timeval
*);
47 extern void tsleep_enter(struct SocketBase
*, caddr_t
, const char *);
48 extern int tsleep_main(struct SocketBase
*, ULONG blockmask
);
49 extern int tsleep(struct SocketBase
*, caddr_t
, const char *,const struct timeval
*);
50 extern void wakeup(caddr_t
);
53 * Spl-levels used in this implementation
56 #define SPLSOFTCLOCK 1
61 * Spl-function prototypes and definitions.
63 * spl_t is the return type of the spl_n(). It should be used when defining
64 * storage to store the return value, using int may be little slower :-)
67 extern BOOL
spl_init(void);
69 /*#ifdef DEBUG*/ /* NC */
74 extern spl_t
spl_n(spl_t newlevel
);
76 #define spl0() spl_n(SPL0)
77 #define splsoftclock() spl_n(SPLSOFTCLOCK)
78 #define splnet() spl_n(SPLNET)
79 #define splimp() spl_n(SPLIMP)
80 #define splx(s) spl_n(s)
84 typedef BYTE spl_t
; /* the type of SysBase->TDNestCnt */
86 extern struct ExecBase
* SysBase
;
88 extern spl_t spl_level
;
95 old_level
= spl_level
;
96 if(spl_level
== SPL0
&& new_level
> SPL0
)
98 spl_level
= new_level
;
99 if(old_level
> SPL0
&& new_level
== SPL0
)
105 #define spl0() splx(SPL0)
106 #define splsoftclock() splx(SPLSOFTCLOCK)
107 #define splnet() splx(SPLNET)
108 #define splimp() splx(SPLIMP)
112 #endif /* !SYS_SYNCH_H */