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,
23 #ifndef AMIGA_INCLUDES_H
24 #define AMIGA_INCLUDES_H
27 * Standard Amiga includes
30 #include <exec/types.h>
34 #include <exec/lists.h>
38 #include <exec/memory.h>
41 #ifndef EXEC_SEMAPHORES_H
42 #include <exec/semaphores.h>
45 #ifndef EXEC_LIBRARIES_H
46 #include <exec/libraries.h>
49 #ifndef EXEC_DEVICES_H
50 #include <exec/devices.h>
53 #ifndef EXEC_EXECBASE_H
54 #include <exec/execbase.h>
62 #include <dos/rdargs.h>
66 #include <sys/cdefs.h>
70 #include <sys/types.h>
73 #if !defined(SYS_TIME_H)
78 #include <proto/exec.h>
82 #include <proto/dos.h>
85 #include <clib/alib_protos.h>
88 * for built in functions in SASC
91 #define USE_BUILTIN_MATH
100 #define _SIZE_T_ unsigned int /* sizeof() */
103 typedef _SIZE_T_
size_t;
114 extern struct ExecBase
*SysBase
;
116 * Amiga shared library prototypes
122 #ifndef _INLINE_EXEC_H
123 #define Remove garbageRemove /* we have inline version */
124 #define Forbid garbageForbid /* we have inline version */
125 #define AbortIO garbageAbortIO /* we have inline version */
126 #define NewList garbageNewList /* conflicts with amiga.lib */
127 #include <inline/exec.h>
134 #ifndef _INLINE_TIMER_H
136 * predefine TimerBase to Library to follow SASC convention.
138 #define BASE_EXT_DECL extern struct Library * TimerBase;
139 #define BASE_NAME (struct Device *)TimerBase
140 #include <inline/timer.h>
144 BeginIO(register struct IORequest
*ioRequest
)
146 register struct IORequest
*a1
__asm("a1") = ioRequest
;
147 register struct Device
*a6
__asm("a6") = ioRequest
->io_Device
;
148 __asm
__volatile ("jsr a6@(-0x1e)"
151 : "a0","a1","d0","d1", "memory");
155 AbortIO(register struct IORequest
*ioRequest
)
157 register struct IORequest
*a1
__asm("a1") = ioRequest
;
158 register struct Device
*a6
__asm("a6") = ioRequest
->io_Device
;
159 __asm
__volatile ("jsr a6@(-0x24)"
162 : "a0","a1","d0","d1", "memory");
166 Remove(register struct Node
*node
)
168 register struct Node
*node2
;
170 node2
= node
->ln_Succ
;
171 node
= node
->ln_Pred
;
172 node
->ln_Succ
= node2
;
173 node2
->ln_Pred
= node
;
179 SysBase
->TDNestCnt
++;
184 #ifndef CLIB_EXEC_PROTOS_H
185 #include <clib/exec_protos.h>
187 #include <pragmas/exec_sysbase_pragmas.h>
188 #ifndef PROTO_TIMER_H
189 #include <proto/timer.h>
192 #pragma msg 93 ignore push
196 extern VOID
pragmaed_AbortIO(struct IORequest
*);
197 #pragma libcall DeviceBase pragmaed_AbortIO 24 901
199 static inline __asm VOID
200 AbortIO(register __a1
struct IORequest
*ioRequest
)
202 #define DeviceBase ioRequest->io_Device
203 pragmaed_AbortIO(ioRequest
);
209 extern VOID
pragmaed_BeginIO(struct IORequest
*);
210 #pragma libcall DeviceBase pragmaed_BeginIO 1E 901
212 static inline __asm VOID
213 BeginIO(register __a1
struct IORequest
*ioRequest
)
215 #define DeviceBase ioRequest->io_Device
216 pragmaed_BeginIO(ioRequest
);
228 * common inlines for both compilers
232 NewList(register struct List
*list
)
234 list
->lh_Head
= (struct Node
*)&list
->lh_Tail
;
235 list
->lh_Tail
= NULL
;
236 list
->lh_TailPred
= (struct Node
*)list
;
241 * undef math log, because it conflicts with log() used for logging.
245 #endif /* !AMIGA_INCLUDES_H */