tools/adflib: build only host variant which is used by Sam440 target
[AROS.git] / workbench / network / stacks / AROSTCP / bsdsocket / kern / amiga_includes.h
blob089e5657a99cfcb609f725271df5f16f6d552a6a
1 /*
2 * Copyright (C) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
3 * Helsinki University of Technology, Finland.
4 * All rights reserved.
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,
19 * MA 02111-1307, USA.
23 #ifndef AMIGA_INCLUDES_H
24 #define AMIGA_INCLUDES_H
27 * Standard Amiga includes
29 #ifndef EXEC_TYPES_H
30 #include <exec/types.h>
31 #endif
33 #ifndef EXEC_LISTS_H
34 #include <exec/lists.h>
35 #endif
37 #ifndef EXEC_MEMORY_H
38 #include <exec/memory.h>
39 #endif
41 #ifndef EXEC_SEMAPHORES_H
42 #include <exec/semaphores.h>
43 #endif
45 #ifndef EXEC_LIBRARIES_H
46 #include <exec/libraries.h>
47 #endif
49 #ifndef EXEC_DEVICES_H
50 #include <exec/devices.h>
51 #endif
53 #ifndef EXEC_EXECBASE_H
54 #include <exec/execbase.h>
55 #endif
57 #ifndef DOS_DOS_H
58 #include <dos/dos.h>
59 #endif
61 #ifndef DOS_RDARGS_H
62 #include <dos/rdargs.h>
63 #endif
65 #ifndef SYS_CDEFS_H
66 #include <sys/cdefs.h>
67 #endif
69 #ifndef SYS_TYPES_H
70 #include <sys/types.h>
71 #endif
73 #if !defined(SYS_TIME_H)
74 #include <sys/time.h>
75 #endif
77 #ifndef PROTO_EXEC_H
78 #include <proto/exec.h>
79 #endif
81 #ifndef PROTO_DOS_H
82 #include <proto/dos.h>
83 #endif
85 #include <clib/alib_protos.h>
88 * for built in functions in SASC
90 #if __SASC
91 #define USE_BUILTIN_MATH
92 #ifndef _STRING_H
93 #include <string.h>
94 #endif
95 #else
97 #include <string.h>
99 #if 0 /* NC */
100 #define _SIZE_T_ unsigned int /* sizeof() */
102 #ifdef _SIZE_T_
103 typedef _SIZE_T_ size_t;
104 #undef _SIZE_T_
105 #endif
107 #ifndef NULL
108 #define NULL 0
109 #endif
111 #endif
112 #endif
114 extern struct ExecBase *SysBase;
116 * Amiga shared library prototypes
119 #if 0
120 #if __GNUC__
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>
128 #undef NewList
129 #undef AbortIO
130 #undef Forbid
131 #undef Remove
132 #endif
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>
141 #endif
143 static inline VOID
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)"
149 : /* no output */
150 : "r" (a6), "r" (a1)
151 : "a0","a1","d0","d1", "memory");
154 static inline VOID
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)"
160 : /* no output */
161 : "r" (a6), "r" (a1)
162 : "a0","a1","d0","d1", "memory");
165 static inline VOID
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;
176 static inline VOID
177 Forbid(void)
179 SysBase->TDNestCnt++;
182 #elif __SASC
184 #ifndef CLIB_EXEC_PROTOS_H
185 #include <clib/exec_protos.h>
186 #endif
187 #include <pragmas/exec_sysbase_pragmas.h>
188 #ifndef PROTO_TIMER_H
189 #include <proto/timer.h>
190 #endif
192 #pragma msg 93 ignore push
194 #if 0
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);
204 #undef DeviceBase
207 #endif
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);
217 #undef DeviceBase
220 #pragma msg 93 pop
222 #endif
223 #endif
226 #if 0 /* NC */
228 * common inlines for both compilers
231 static inline VOID
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;
238 #endif
241 * undef math log, because it conflicts with log() used for logging.
243 #undef log
245 #endif /* !AMIGA_INCLUDES_H */