2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
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"
20 #include <aros/debug.h>
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 */
42 /*****************************************************************************
45 #include <aros/inquire.h>
47 AROS_LH1(ULONG
, ArosInquireA
,
51 AROS_LHA(struct TagItem
*, taglist
, A0
),
55 struct ArosBase
*, ArosBase
, 5, Aros
)
58 This function is used to query system characteristics not easily
59 queried with another function.
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.
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.
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.
89 Given in the format: <d>.<m>.<y>
92 Configure time variant name.
94 AI_ArosArchitecture IPTR
95 Return the target architecture.
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.
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
121 ******************************************************************************/
131 if (!(UtilityBase
= TaggedOpenLibrary(TAGGEDOPEN_UTILITY
)))
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
));
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());
160 case AI_KickstartSize
:
161 SetData (tag
, ULONG
, kicksize());
164 case AI_KickstartVersion
:
165 SetData (tag
, UWORD
, *(UWORD
*)(kickbase() + LOC_MAJORV
));
168 case AI_KickstartRevision
:
169 SetData (tag
, UWORD
, *(UWORD
*)(kickbase() + LOC_MINORV
));
172 case AI_KickstartSize
:
173 SetData (tag
, ULONG
, 0);
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
);
186 case AI_ArosReleaseMajor
:
187 /* Update this whenever a new AROS is released */
188 SetData (tag
, IPTR
, AROS_VERSION_MAJOR
);
191 case AI_ArosReleaseMinor
:
192 /* Update this whenever a new AROS is released */
193 SetData (tag
, IPTR
, AROS_VERSION_MINOR
);
196 case AI_ArosReleaseDate
:
197 /* Update this whenever a new AROS is released */
198 SetData (tag
, IPTR
, AROS_RELEASE_DATE
);
201 case AI_ArosBuildDate
:
202 SetData (tag
, IPTR
, (IPTR
)__DATE__
);
206 SetData (tag
, IPTR
, (IPTR
) VARIANT
);
209 case AI_ArosABIMajor
:
210 SetData (tag
, IPTR
, AROS_ABI_VERSION_MAJOR
);
213 case AI_ArosArchitecture
:
214 #ifdef KrnGetSystemAttr
215 if (ArosBase
->aros_KernelBase
)
217 APTR KernelBase
= ArosBase
->aros_KernelBase
;
218 data
= KrnGetSystemAttr(KATTR_Architecture
);
221 data
= (IPTR
)AROS_ARCHITECTURE
;
223 SetData(tag
, IPTR
, data
);
227 SetData (tag
, IPTR
, 0);
235 CloseLibrary(UtilityBase
);
241 #if (AROS_FLAVOUR & AROS_FLAVOUR_NATIVE)
242 /* Native AROS support functions */
245 return *(ULONG
*)(ROM_END
- LOC_ROMSIZE
);
250 return (ROM_END
- kicksize());