2 Copyright © 1995-2014, 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 /* Amiga hardware support functions */
42 /*****************************************************************************
45 #include <aros/inquire.h>
47 AROS_LH1(ULONG
, ArosInquireA
,
50 AROS_LHA(struct TagItem
*, taglist
, A0
),
53 struct ArosBase
*, ArosBase
, 5, Aros
)
56 This function is used to query system characteristics not easily
57 queried with another function. All queries understood by this call
58 will have appropriate values assigned to the location the query tag's
59 ti_Data field points to.
62 tags - a tag list with appropriate queries. Each tag's ti_Data field
63 should point to the location where the result of the query
64 is to be stored. Do not forget to clear the location before, as
65 queries not understood will be left untouched.
69 AI_KickstartSize ULONG
70 AI_KickstartVersion UWORD
71 AI_KickstartRevision UWORD
72 Only support these tags if we are on the native machine. On other
73 machines this call will not touch the storage space. Set the
74 storage space to 0 beforehand if you want to see if this call
78 aros.library version masquerades as AROS version. This means
79 that all AROS modules must have the same major version number.
81 AI_ArosReleaseMajor IPTR
82 Update this whenever a new AROS is released.
84 AI_ArosReleaseMinor IPTR
85 Update this whenever a new AROS is released.
87 AI_ArosReleaseDate IPTR
88 Update this whenever a new AROS is released.
91 Given in the format: <d>.<m>.<y>
96 AI_ArosArchitecture IPTR
97 Return the target architecture.
100 Update this whenever a new ABI is introduced in AROS. Special
101 value of -1 means that the ABI is under development and subject
105 index - the index of the first tag that could not be processed, plus
106 one (e.g. 1 for taglist[0], 2 for taglist[1] etc.). Zero if all
120 ******************************************************************************/
130 if (!(UtilityBase
= TaggedOpenLibrary(TAGGEDOPEN_UTILITY
)))
133 # define SetData(tag,type,value) \
134 D(bug(" Data was: %d\n", *((type *)(tag->ti_Data)))); \
135 (*((type *)(tag->ti_Data)) = value); \
136 D(bug(" Data is : %d\n", *((type *)(tag->ti_Data))))
138 D(bug("ArosInquireA(taglist=%p)\n", taglist
));
140 while( (tag
= NextTagItem(&taglist
)))
142 D(bug(" tag[%d] = 0x%lx data = 0x%lx\n", i
, tag
->ti_Tag
, tag
->ti_Data
));
148 #if (AROS_FLAVOUR & AROS_FLAVOUR_NATIVE)
150 Only support these tags if we are on the native machine. On other
151 machines this call will not touch the storage space. Set the
152 storage space to 0 if you want to see if this call touches it.
155 case AI_KickstartBase
:
156 SetData (tag
, APTR
, kickbase());
159 case AI_KickstartSize
:
160 SetData (tag
, ULONG
, kicksize());
163 case AI_KickstartVersion
:
164 SetData (tag
, UWORD
, *(UWORD
*)(kickbase() + LOC_MAJORV
));
167 case AI_KickstartRevision
:
168 SetData (tag
, UWORD
, *(UWORD
*)(kickbase() + LOC_MINORV
));
171 case AI_KickstartSize
:
172 SetData (tag
, ULONG
, 0);
179 aros.library version masquerades as AROS version. This means
180 that all aros modules must have the same major version number.
182 SetData (tag
, IPTR
, VERSION_NUMBER
);
185 case AI_ArosReleaseMajor
:
186 /* Update this whenever a new AROS is released */
187 SetData (tag
, IPTR
, AROS_VERSION_MAJOR
);
190 case AI_ArosReleaseMinor
:
191 /* Update this whenever a new AROS is released */
192 SetData (tag
, IPTR
, AROS_VERSION_MINOR
);
195 case AI_ArosReleaseDate
:
196 /* Update this whenever a new AROS is released */
197 SetData (tag
, IPTR
, AROS_RELEASE_DATE
);
200 case AI_ArosBuildDate
:
201 SetData (tag
, IPTR
, (IPTR
)__DATE__
);
205 * Reserved for distribution maintainers.
206 * DO NOT set this to configure-time variant name. That name is used to identify
207 * sub-architecture name, and changing it may break compatibility between
208 * different AROS modules, especially on hosted. Full complete platform name
209 * (including variant, if appropriate) is available via KATTR_Architecture
210 * kernel's attribute.
211 * Add one more configure option, or, better, provide some another way
212 * (env variable, whatever).
216 SetData (tag
, IPTR
, (IPTR
) VARIANT
);
218 SetData (tag
, IPTR
, (IPTR
) NULL
);
223 case AI_ArosABIMajor
:
224 SetData (tag
, IPTR
, AROS_ABI_VERSION_MAJOR
);
227 case AI_ArosArchitecture
:
228 #ifdef KrnGetSystemAttr
229 if (ArosBase
->aros_KernelBase
)
231 APTR KernelBase
= ArosBase
->aros_KernelBase
;
232 data
= KrnGetSystemAttr(KATTR_Architecture
);
236 * This is a legacy hack for old PPC-native kernel.resource implementations.
237 * Please do not support this. aros.library is a part of base kickstart, and
238 * it is platform-independent. Consequently, it should not include any hardcoded
239 * references to platform name. Platform name is specified by kernel.resource.
240 * See boot/modular_kickstart.txt for more info.
242 data
= (IPTR
)AROS_ARCHITECTURE
;
244 SetData(tag
, IPTR
, data
);
255 CloseLibrary(UtilityBase
);
261 #if (AROS_FLAVOUR & AROS_FLAVOUR_NATIVE)
262 /* Native AROS support functions */
265 return *(ULONG
*)(ROM_END
- LOC_ROMSIZE
);
270 return (ROM_END
- kicksize());