Updated PCI IDs to latest snapshot.
[tangerine.git] / rom / aros / arosinquirea.c
blobdf58cd8edb994a2776499ed1b5fc376b96a5dbef
1 /*
2 Copyright © 1995-2001, 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/libcall.h>
13 #include <proto/utility.h>
14 #include "aros_intern.h"
16 #define DEBUG 0
17 #include <aros/debug.h>
18 #undef kprintf
20 /* Kickstart ROM location offsets */
21 #define LOC_COOKIE 0x00
22 #define LOC_ADDRESS 0x04
23 #define LOC_MAJORV 0x0c
24 #define LOC_MINORV 0x0e
25 #define LOC_ROMSIZE 0x14 /* offset from end of ROM! */
26 #define ROM_END 0x1000000
28 #define AROS_VERSION_MAJOR 1
29 #define AROS_VERSION_MINOR 12
30 #define AROS_RELEASE_DATE 7560 /* in days since 1978-01-01 */
32 #if (AROS_FLAVOUR & AROS_FLAVOUR_NATIVE)
33 /* Native AROS support functions */
34 IPTR kicksize(void);
35 IPTR kickbase(void);
36 #endif
38 /*****************************************************************************
40 NAME */
41 #include <aros/inquire.h>
43 AROS_LH1(ULONG, ArosInquireA,
45 /* SYNOPSIS */
47 AROS_LHA(struct TagItem *, taglist, A0),
49 /* LOCATION */
51 struct ArosBase *, ArosBase, 5, Aros)
53 /* FUNCTION
54 This function is used to query system characteristics not easily
55 queried with another function.
57 INPUTS
58 tags -- taglist with appropriate queries. The tag's ti_Data field
59 should point to the location where the result of the query
60 is stored. Do not forget to clear the location before, as
61 queries not understood will be left untouched.
63 AI_KickstartBase APTR
64 AI_KickstartSize ULONG
65 AI_KickstartVersion UWORD
66 AI_KickstartRevision UWORD
67 Only support these tags if we are on the native machine. On other machines this
68 call will not touch the storage space. Set the storage space to 0 if you want to
69 see if this call touches it.
71 AI_ArosVersion IPTR
72 aros.library version masquerades as AROS version. This means
73 that all aros modules must have the same major version number.
75 AI_ArosReleaseMajor IPTR
76 Update this whenever a new AROS is released.
78 AI_ArosReleaseMinor IPTR
79 Update this whenever a new AROS is released.
81 AI_ArosReleaseDate IPTR
82 Update this whenever a new AROS is released.
84 AI_ArosBuildDate IPTR
85 Given in the format: <d>.<m>.<y>
87 AI_ArosVariant IPTR
88 Configure time variant name.
90 RESULT
91 All queries understood by this call will have appropriate values
92 assigned to the location a tag's ti_Data pointed to.
94 This function will (for now) always return 0.
96 NOTES
98 EXAMPLE
100 BUGS
102 SEE ALSO
103 aros/arosbase.h
105 INTERNALS
107 ******************************************************************************/
109 AROS_LIBFUNC_INIT
111 struct TagItem *tag;
112 ULONG ret = 0;
114 # define SetData(tag,type,value) \
115 D(bug(" Data was: %d\n", *((type *)(tag->ti_Data)))); \
116 (*((type *)(tag->ti_Data)) = value); \
117 D(bug(" Data is : %d\n", *((type *)(tag->ti_Data))))
119 D(bug("ArosInquireA(taglist=%p)\n", taglist));
121 while( (tag = NextTagItem((const struct TagItem**)&taglist)))
123 D(bug(" tag = 0x%lx data = 0x%lx\n", tag->ti_Tag, tag->ti_Data));
125 switch(tag->ti_Tag)
128 #if (AROS_FLAVOUR & AROS_FLAVOUR_NATIVE)
130 Only support these tags if we are on the native machine. On other
131 machines this call will not touch the storage space. Set the
132 storage space to 0 if you want to see if this call touches it.
135 case AI_KickstartBase:
136 SetData (tag, APTR, kickbase());
137 break;
139 case AI_KickstartSize:
140 SetData (tag, ULONG, kicksize());
141 break;
143 case AI_KickstartVersion:
144 SetData (tag, UWORD, *(UWORD *)(kickbase() + LOC_MAJORV));
145 break;
147 case AI_KickstartRevision:
148 SetData (tag, UWORD, *(UWORD *)(kickbase() + LOC_MINORV));
149 break;
150 #else
151 case AI_KickstartSize:
152 SetData (tag, ULONG, 0);
153 break;
155 #endif
157 case AI_ArosVersion:
159 aros.library version masquerades as AROS version. This means
160 that all aros modules must have the same major version number.
162 SetData (tag, IPTR, VERSION_NUMBER);
163 break;
165 case AI_ArosReleaseMajor:
166 /* Update this whenever a new AROS is released */
167 SetData (tag, IPTR, AROS_VERSION_MAJOR);
168 break;
170 case AI_ArosReleaseMinor:
171 /* Update this whenever a new AROS is released */
172 SetData (tag, IPTR, AROS_VERSION_MINOR);
173 break;
175 case AI_ArosReleaseDate:
176 /* Update this whenever a new AROS is released */
177 SetData (tag, IPTR, AROS_RELEASE_DATE);
178 break;
180 case AI_ArosBuildDate:
181 SetData (tag, IPTR, (IPTR)__DATE__);
183 break;
185 case AI_ArosVariant:
186 SetData (tag, IPTR, (IPTR) VARIANT);
187 break;
189 case AI_ArosArchitecture:
190 SetData (tag, IPTR, (IPTR) AROS_ARCHITECTURE);
191 break;
193 default:
194 SetData (tag, IPTR, 0);
195 break;
200 return ret;
201 AROS_LIBFUNC_EXIT
202 } /* ArosInquireA */
204 #if (AROS_FLAVOUR & AROS_FLAVOUR_NATIVE)
205 /* Native AROS support functions */
206 IPTR kicksize(void)
208 return *(ULONG *)(ROM_END - LOC_ROMSIZE);
211 IPTR kickbase(void)
213 return (ROM_END - kicksize());
215 #endif