added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / rom / aros / arosinquirea.c
blob08808f077fac0c0a0705d065d7107925e07ce882
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>
86 AI_ArosVariant IPTR
87 Configure time variant name.
89 RESULT
90 All queries understood by this call will have appropriate values
91 assigned to the location a tag's ti_Data pointed to.
93 This function will (for now) always return 0.
95 NOTES
97 EXAMPLE
99 BUGS
101 SEE ALSO
102 aros/arosbase.h
104 INTERNALS
106 ******************************************************************************/
108 AROS_LIBFUNC_INIT
110 struct TagItem *tag;
111 ULONG ret = 0;
113 # define SetData(tag,type,value) \
114 D(bug(" Data was: %d\n", *((type *)(tag->ti_Data)))); \
115 (*((type *)(tag->ti_Data)) = value); \
116 D(bug(" Data is : %d\n", *((type *)(tag->ti_Data))))
118 D(bug("ArosInquireA(taglist=%p)\n", taglist));
120 while( (tag = NextTagItem((const struct TagItem**)&taglist)))
122 D(bug(" tag = 0x%lx data = 0x%lx\n", tag->ti_Tag, tag->ti_Data));
124 switch(tag->ti_Tag)
127 #if (AROS_FLAVOUR & AROS_FLAVOUR_NATIVE)
129 Only support these tags if we are on the native machine. On other
130 machines this call will not touch the storage space. Set the
131 storage space to 0 if you want to see if this call touches it.
134 case AI_KickstartBase:
135 SetData (tag, APTR, kickbase());
136 break;
138 case AI_KickstartSize:
139 SetData (tag, ULONG, kicksize());
140 break;
142 case AI_KickstartVersion:
143 SetData (tag, UWORD, *(UWORD *)(kickbase() + LOC_MAJORV));
144 break;
146 case AI_KickstartRevision:
147 SetData (tag, UWORD, *(UWORD *)(kickbase() + LOC_MINORV));
148 break;
149 #else
150 case AI_KickstartSize:
151 SetData (tag, ULONG, 0);
152 break;
154 #endif
156 case AI_ArosVersion:
158 aros.library version masquerades as AROS version. This means
159 that all aros modules must have the same major version number.
161 SetData (tag, IPTR, VERSION_NUMBER);
162 break;
164 case AI_ArosReleaseMajor:
165 /* Update this whenever a new AROS is released */
166 SetData (tag, IPTR, AROS_VERSION_MAJOR);
167 break;
169 case AI_ArosReleaseMinor:
170 /* Update this whenever a new AROS is released */
171 SetData (tag, IPTR, AROS_VERSION_MINOR);
172 break;
174 case AI_ArosReleaseDate:
175 /* Update this whenever a new AROS is released */
176 SetData (tag, IPTR, AROS_RELEASE_DATE);
177 break;
179 case AI_ArosBuildDate:
180 SetData (tag, IPTR, (IPTR)__DATE__);
182 break;
184 case AI_ArosVariant:
185 SetData (tag, IPTR, (IPTR) VARIANT);
186 break;
188 default:
189 SetData (tag, IPTR, 0);
190 break;
195 return ret;
196 AROS_LIBFUNC_EXIT
197 } /* ArosInquireA */
199 #if (AROS_FLAVOUR & AROS_FLAVOUR_NATIVE)
200 /* Native AROS support functions */
201 IPTR kicksize(void)
203 return *(ULONG *)(ROM_END - LOC_ROMSIZE);
206 IPTR kickbase(void)
208 return (ROM_END - kicksize());
210 #endif