Call OwnBlitter() only if both blitter queues are empty.
[AROS.git] / rom / aros / arosinquirea.c
blobd4f3021bf570b24370b45d8f685e02b2ea2f0bf7
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
9 #include <aros/config.h>
10 #include <exec/types.h>
11 #include <utility/tagitem.h>
12 #include <aros/kernel.h>
13 #include <aros/libcall.h>
14 #include <proto/kernel.h>
15 #include <proto/utility.h>
17 #include "aros_intern.h"
19 #define DEBUG 0
20 #include <aros/debug.h>
21 #undef kprintf
23 /* Kickstart ROM location offsets */
24 #define LOC_COOKIE 0x00
25 #define LOC_ADDRESS 0x04
26 #define LOC_MAJORV 0x0c
27 #define LOC_MINORV 0x0e
28 #define LOC_ROMSIZE 0x14 /* offset from end of ROM! */
29 #define ROM_END 0x1000000
31 #define AROS_VERSION_MAJOR 1
32 #define AROS_VERSION_MINOR 12
33 #define AROS_ABI_VERSION_MAJOR -1 /* Change only value, name is used in external script */
34 #define AROS_RELEASE_DATE 7560 /* in days since 1978-01-01 */
36 #if (AROS_FLAVOUR & AROS_FLAVOUR_NATIVE)
37 /* Native AROS support functions */
38 IPTR kicksize(void);
39 IPTR kickbase(void);
40 #endif
42 /*****************************************************************************
44 NAME */
45 #include <aros/inquire.h>
47 AROS_LH1(ULONG, ArosInquireA,
49 /* SYNOPSIS */
51 AROS_LHA(struct TagItem *, taglist, A0),
53 /* LOCATION */
55 struct ArosBase *, ArosBase, 5, Aros)
57 /* FUNCTION
58 This function is used to query system characteristics not easily
59 queried with another function.
61 INPUTS
62 tags -- taglist with appropriate queries. The tag's ti_Data field
63 should point to the location where the result of the query
64 is stored. Do not forget to clear the location before, as
65 queries not understood will be left untouched.
67 AI_KickstartBase APTR
68 AI_KickstartSize ULONG
69 AI_KickstartVersion UWORD
70 AI_KickstartRevision UWORD
71 Only support these tags if we are on the native machine. On other machines this
72 call will not touch the storage space. Set the storage space to 0 if you want to
73 see if this call touches it.
75 AI_ArosVersion IPTR
76 aros.library version masquerades as AROS version. This means
77 that all aros modules must have the same major version number.
79 AI_ArosReleaseMajor IPTR
80 Update this whenever a new AROS is released.
82 AI_ArosReleaseMinor IPTR
83 Update this whenever a new AROS is released.
85 AI_ArosReleaseDate IPTR
86 Update this whenever a new AROS is released.
88 AI_ArosBuildDate IPTR
89 Given in the format: <d>.<m>.<y>
91 AI_ArosVariant IPTR
92 Configure time variant name.
94 AI_ArosArchitecture IPTR
95 Return the target architecture.
97 AI_ArosABIMajor IPTR
98 Update this whenever a new ABI is introduced in AROS. Special value of
99 -1 means that the ABI is under development and subject to change.
102 RESULT
103 All queries understood by this call will have appropriate values
104 assigned to the location a tag's ti_Data pointed to.
106 This function will return 0 on success, or the index of the
107 first tag that could not be processed. (Ie 1 for Tag[0], 2 for
108 Tag[1], etc)
110 NOTES
112 EXAMPLE
114 BUGS
116 SEE ALSO
117 aros/arosbase.h
119 INTERNALS
121 ******************************************************************************/
123 AROS_LIBFUNC_INIT
125 APTR UtilityBase;
126 struct TagItem *tag;
127 ULONG ret = 0;
128 int i = 0;
129 IPTR data = 0;
131 if (!(UtilityBase = TaggedOpenLibrary(TAGGEDOPEN_UTILITY)))
132 return 1;
134 # define SetData(tag,type,value) \
135 D(bug(" Data was: %d\n", *((type *)(tag->ti_Data)))); \
136 (*((type *)(tag->ti_Data)) = value); \
137 D(bug(" Data is : %d\n", *((type *)(tag->ti_Data))))
139 D(bug("ArosInquireA(taglist=%p)\n", taglist));
141 while( (tag = NextTagItem((const struct TagItem**)&taglist)))
143 D(bug(" tag[%d] = 0x%lx data = 0x%lx\n", i, tag->ti_Tag, tag->ti_Data));
144 i++;
146 switch(tag->ti_Tag)
149 #if (AROS_FLAVOUR & AROS_FLAVOUR_NATIVE)
151 Only support these tags if we are on the native machine. On other
152 machines this call will not touch the storage space. Set the
153 storage space to 0 if you want to see if this call touches it.
156 case AI_KickstartBase:
157 SetData (tag, APTR, kickbase());
158 break;
160 case AI_KickstartSize:
161 SetData (tag, ULONG, kicksize());
162 break;
164 case AI_KickstartVersion:
165 SetData (tag, UWORD, *(UWORD *)(kickbase() + LOC_MAJORV));
166 break;
168 case AI_KickstartRevision:
169 SetData (tag, UWORD, *(UWORD *)(kickbase() + LOC_MINORV));
170 break;
171 #else
172 case AI_KickstartSize:
173 SetData (tag, ULONG, 0);
174 break;
176 #endif
178 case AI_ArosVersion:
180 aros.library version masquerades as AROS version. This means
181 that all aros modules must have the same major version number.
183 SetData (tag, IPTR, VERSION_NUMBER);
184 break;
186 case AI_ArosReleaseMajor:
187 /* Update this whenever a new AROS is released */
188 SetData (tag, IPTR, AROS_VERSION_MAJOR);
189 break;
191 case AI_ArosReleaseMinor:
192 /* Update this whenever a new AROS is released */
193 SetData (tag, IPTR, AROS_VERSION_MINOR);
194 break;
196 case AI_ArosReleaseDate:
197 /* Update this whenever a new AROS is released */
198 SetData (tag, IPTR, AROS_RELEASE_DATE);
199 break;
201 case AI_ArosBuildDate:
202 SetData (tag, IPTR, (IPTR)__DATE__);
203 break;
205 case AI_ArosVariant:
206 SetData (tag, IPTR, (IPTR) VARIANT);
207 break;
209 case AI_ArosABIMajor:
210 SetData (tag, IPTR, AROS_ABI_VERSION_MAJOR);
211 break;
213 case AI_ArosArchitecture:
214 #ifdef KrnGetSystemAttr
215 if (ArosBase->aros_KernelBase)
217 APTR KernelBase = ArosBase->aros_KernelBase;
218 data = KrnGetSystemAttr(KATTR_Architecture);
220 #else
221 data = (IPTR)AROS_ARCHITECTURE;
222 #endif
223 SetData(tag, IPTR, data);
224 break;
226 default:
227 SetData (tag, IPTR, 0);
228 if (ret == 0)
229 ret = i;
230 break;
235 CloseLibrary(UtilityBase);
237 return ret;
238 AROS_LIBFUNC_EXIT
239 } /* ArosInquireA */
241 #if (AROS_FLAVOUR & AROS_FLAVOUR_NATIVE)
242 /* Native AROS support functions */
243 IPTR kicksize(void)
245 return *(ULONG *)(ROM_END - LOC_ROMSIZE);
248 IPTR kickbase(void)
250 return (ROM_END - kicksize());
252 #endif