arcbios.h revision 1.2.8.2 1 1.2.8.2 nathanw /* $NetBSD: arcbios.h,v 1.2.8.2 2002/01/08 00:29:20 nathanw Exp $ */
2 1.2.8.2 nathanw
3 1.2.8.2 nathanw /*-
4 1.2.8.2 nathanw * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 1.2.8.2 nathanw * All rights reserved.
6 1.2.8.2 nathanw *
7 1.2.8.2 nathanw * This code is derived from software contributed to The NetBSD Foundation
8 1.2.8.2 nathanw * by Jason R. Thorpe.
9 1.2.8.2 nathanw *
10 1.2.8.2 nathanw * Redistribution and use in source and binary forms, with or without
11 1.2.8.2 nathanw * modification, are permitted provided that the following conditions
12 1.2.8.2 nathanw * are met:
13 1.2.8.2 nathanw * 1. Redistributions of source code must retain the above copyright
14 1.2.8.2 nathanw * notice, this list of conditions and the following disclaimer.
15 1.2.8.2 nathanw * 2. Redistributions in binary form must reproduce the above copyright
16 1.2.8.2 nathanw * notice, this list of conditions and the following disclaimer in the
17 1.2.8.2 nathanw * documentation and/or other materials provided with the distribution.
18 1.2.8.2 nathanw * 3. All advertising materials mentioning features or use of this software
19 1.2.8.2 nathanw * must display the following acknowledgement:
20 1.2.8.2 nathanw * This product includes software developed by the NetBSD
21 1.2.8.2 nathanw * Foundation, Inc. and its contributors.
22 1.2.8.2 nathanw * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.2.8.2 nathanw * contributors may be used to endorse or promote products derived
24 1.2.8.2 nathanw * from this software without specific prior written permission.
25 1.2.8.2 nathanw *
26 1.2.8.2 nathanw * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.2.8.2 nathanw * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.2.8.2 nathanw * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.2.8.2 nathanw * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.2.8.2 nathanw * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.2.8.2 nathanw * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.2.8.2 nathanw * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.2.8.2 nathanw * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.2.8.2 nathanw * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.2.8.2 nathanw * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.2.8.2 nathanw * POSSIBILITY OF SUCH DAMAGE.
37 1.2.8.2 nathanw */
38 1.2.8.2 nathanw
39 1.2.8.2 nathanw /*
40 1.2.8.2 nathanw * The ARC BIOS (which is similar, but not 100% compatible with SGI ARCS)
41 1.2.8.2 nathanw * specification can be found at:
42 1.2.8.2 nathanw *
43 1.2.8.2 nathanw * http://www.microsoft.com/hwdev/download/respec/riscspec.zip
44 1.2.8.2 nathanw */
45 1.2.8.2 nathanw
46 1.2.8.2 nathanw #define ARCBIOS_STDIN 0
47 1.2.8.2 nathanw #define ARCBIOS_STDOUT 1
48 1.2.8.2 nathanw
49 1.2.8.2 nathanw #define ARCBIOS_PAGESIZE 4096
50 1.2.8.2 nathanw
51 1.2.8.2 nathanw /* ARC BIOS status codes. */
52 1.2.8.2 nathanw #define ARCBIOS_ESUCCESS 0 /* Success */
53 1.2.8.2 nathanw #define ARCBIOS_E2BIG 1 /* argument list too long */
54 1.2.8.2 nathanw #define ARCBIOS_EACCES 2 /* permission denied */
55 1.2.8.2 nathanw #define ARCBIOS_EAGAIN 3 /* resource temporarily unavailable */
56 1.2.8.2 nathanw #define ARCBIOS_EBADF 4 /* bad file number */
57 1.2.8.2 nathanw #define ARCBIOS_EBUSY 5 /* device or resource busy */
58 1.2.8.2 nathanw #define ARCBIOS_EFAULT 6 /* bad address */
59 1.2.8.2 nathanw #define ARCBIOS_EINVAL 7 /* invalid argument */
60 1.2.8.2 nathanw #define ARCBIOS_EIO 8 /* I/O error */
61 1.2.8.2 nathanw #define ARCBIOS_EISDIR 9 /* is a directory */
62 1.2.8.2 nathanw #define ARCBIOS_EMFILE 10 /* too many open files */
63 1.2.8.2 nathanw #define ARCBIOS_EMLINK 11 /* too many links */
64 1.2.8.2 nathanw #define ARCBIOS_ENAMETOOLONG 12 /* file name too long */
65 1.2.8.2 nathanw #define ARCBIOS_ENODEV 13 /* no such device */
66 1.2.8.2 nathanw #define ARCBIOS_ENOENT 14 /* no such file or directory */
67 1.2.8.2 nathanw #define ARCBIOS_ENOEXEC 15 /* exec format error */
68 1.2.8.2 nathanw #define ARCBIOS_ENOMEM 16 /* out of memory */
69 1.2.8.2 nathanw #define ARCBIOS_ENOSPC 17 /* no space left on device */
70 1.2.8.2 nathanw #define ARCBIOS_ENOTDIR 18 /* not a directory */
71 1.2.8.2 nathanw #define ARCBIOS_ENOTTY 19 /* not a typewriter */
72 1.2.8.2 nathanw #define ARCBIOS_ENXIO 20 /* media not loaded */
73 1.2.8.2 nathanw #define ARCBIOS_EROFS 21 /* read-only file system */
74 1.2.8.2 nathanw #if defined(sgimips)
75 1.2.8.2 nathanw #define ARCBIOS_EADDRNOTAVAIL 31 /* address not available */
76 1.2.8.2 nathanw #define ARCBIOS_ETIMEDOUT 32 /* operation timed out */
77 1.2.8.2 nathanw #define ARCBIOS_ECONNABORTED 33 /* connection aborted */
78 1.2.8.2 nathanw #define ARCBIOS_ENOCONNECT 34 /* not connected */
79 1.2.8.2 nathanw #endif /* sgimips */
80 1.2.8.2 nathanw
81 1.2.8.2 nathanw /*
82 1.2.8.2 nathanw * 4.2.2: System Parameter Block
83 1.2.8.2 nathanw */
84 1.2.8.2 nathanw struct arcbios_spb {
85 1.2.8.2 nathanw uint32_t SPBSignature;
86 1.2.8.2 nathanw uint32_t SPBLength;
87 1.2.8.2 nathanw uint16_t Version;
88 1.2.8.2 nathanw uint16_t Revision;
89 1.2.8.2 nathanw void *RestartBlock;
90 1.2.8.2 nathanw void *DebugBlock;
91 1.2.8.2 nathanw void *GEVector;
92 1.2.8.2 nathanw void *UTLBMissVector;
93 1.2.8.2 nathanw uint32_t FirmwareVectorLength;
94 1.2.8.2 nathanw void *FirmwareVector;
95 1.2.8.2 nathanw uint32_t PrivateVectorLength;
96 1.2.8.2 nathanw void *PrivateVector;
97 1.2.8.2 nathanw uint32_t AdapterCount;
98 1.2.8.2 nathanw uint32_t AdapterType;
99 1.2.8.2 nathanw uint32_t AdapterVectorLength;
100 1.2.8.2 nathanw void *AdapterVector;
101 1.2.8.2 nathanw };
102 1.2.8.2 nathanw
103 1.2.8.2 nathanw #define ARCBIOS_SPB_SIGNATURE 0x53435241 /* A R C S */
104 1.2.8.2 nathanw #define ARCBIOS_SPB_SIGNATURE_1 0x41524353 /* S C R A */
105 1.2.8.2 nathanw
106 1.2.8.2 nathanw /*
107 1.2.8.2 nathanw * 4.2.5: System Configuration Data
108 1.2.8.2 nathanw */
109 1.2.8.2 nathanw struct arcbios_component {
110 1.2.8.2 nathanw uint32_t Class;
111 1.2.8.2 nathanw uint32_t Type;
112 1.2.8.2 nathanw uint32_t Flags;
113 1.2.8.2 nathanw uint16_t Version;
114 1.2.8.2 nathanw uint16_t Revision;
115 1.2.8.2 nathanw uint32_t Key;
116 1.2.8.2 nathanw uint32_t AffinityMask;
117 1.2.8.2 nathanw uint32_t ConfigurationDataSize;
118 1.2.8.2 nathanw uint32_t IdentifierLength;
119 1.2.8.2 nathanw char *Identifier;
120 1.2.8.2 nathanw };
121 1.2.8.2 nathanw
122 1.2.8.2 nathanw /*
123 1.2.8.2 nathanw * SGI ARCS likes to be `special', so it moved some of the class/type
124 1.2.8.2 nathanw * numbers around from the ARC standard definitions.
125 1.2.8.2 nathanw */
126 1.2.8.2 nathanw #if defined(sgimips)
127 1.2.8.2 nathanw /* Component Class */
128 1.2.8.2 nathanw #define COMPONENT_CLASS_SystemClass 0
129 1.2.8.2 nathanw #define COMPONENT_CLASS_ProcessorClass 1
130 1.2.8.2 nathanw #define COMPONENT_CLASS_CacheClass 2
131 1.2.8.2 nathanw #define COMPONENT_CLASS_MemoryClass 3
132 1.2.8.2 nathanw #define COMPONENT_CLASS_AdapterClass 4
133 1.2.8.2 nathanw #define COMPONENT_CLASS_ControllerClass 5
134 1.2.8.2 nathanw #define COMPONENT_CLASS_PeripheralClass 6
135 1.2.8.2 nathanw #else
136 1.2.8.2 nathanw /* Component Class */
137 1.2.8.2 nathanw #define COMPONENT_CLASS_SystemClass 0
138 1.2.8.2 nathanw #define COMPONENT_CLASS_ProcessorClass 1
139 1.2.8.2 nathanw #define COMPONENT_CLASS_CacheClass 2
140 1.2.8.2 nathanw #define COMPONENT_CLASS_AdapterClass 3
141 1.2.8.2 nathanw #define COMPONENT_CLASS_ControllerClass 4
142 1.2.8.2 nathanw #define COMPONENT_CLASS_PeripheralClass 5
143 1.2.8.2 nathanw #define COMPONENT_CLASS_MemoryClass 6
144 1.2.8.2 nathanw #endif
145 1.2.8.2 nathanw
146 1.2.8.2 nathanw /* Component Types */
147 1.2.8.2 nathanw #if defined(sgimips)
148 1.2.8.2 nathanw /* System Class */
149 1.2.8.2 nathanw #define COMPONENT_TYPE_ARC 0
150 1.2.8.2 nathanw
151 1.2.8.2 nathanw /* Processor Class */
152 1.2.8.2 nathanw #define COMPONENT_TYPE_CPU 1
153 1.2.8.2 nathanw #define COMPONENT_TYPE_FPU 2
154 1.2.8.2 nathanw
155 1.2.8.2 nathanw /* Cache Class */
156 1.2.8.2 nathanw #define COMPONENT_TYPE_PrimaryICache 3
157 1.2.8.2 nathanw #define COMPONENT_TYPE_PrimaryDCache 4
158 1.2.8.2 nathanw #define COMPONENT_TYPE_SecondaryICache 5
159 1.2.8.2 nathanw #define COMPONENT_TYPE_SecondaryDCache 6
160 1.2.8.2 nathanw #define COMPONENT_TYPE_SecondaryCache 7
161 1.2.8.2 nathanw
162 1.2.8.2 nathanw /* Memory Class */
163 1.2.8.2 nathanw #define COMPONENT_TYPE_MemoryUnit 8
164 1.2.8.2 nathanw
165 1.2.8.2 nathanw /* Adapter Class */
166 1.2.8.2 nathanw #define COMPONENT_TYPE_EISAAdapter 9
167 1.2.8.2 nathanw #define COMPONENT_TYPE_TCAdapter 10
168 1.2.8.2 nathanw #define COMPONENT_TYPE_SCSIAdapter 11
169 1.2.8.2 nathanw #define COMPONENT_TYPE_DTIAdapter 12
170 1.2.8.2 nathanw #define COMPONENT_TYPE_MultiFunctionAdapter 13
171 1.2.8.2 nathanw
172 1.2.8.2 nathanw /* Controller Class */
173 1.2.8.2 nathanw #define COMPONENT_TYPE_DiskController 14
174 1.2.8.2 nathanw #define COMPONENT_TYPE_TapeController 15
175 1.2.8.2 nathanw #define COMPONENT_TYPE_CDROMController 16
176 1.2.8.2 nathanw #define COMPONENT_TYPE_WORMController 17
177 1.2.8.2 nathanw #define COMPONENT_TYPE_SerialController 18
178 1.2.8.2 nathanw #define COMPONENT_TYPE_NetworkController 19
179 1.2.8.2 nathanw #define COMPONENT_TYPE_DisplayController 20
180 1.2.8.2 nathanw #define COMPONENT_TYPE_ParallelController 21
181 1.2.8.2 nathanw #define COMPONENT_TYPE_PointerController 22
182 1.2.8.2 nathanw #define COMPONENT_TYPE_KeyboardController 23
183 1.2.8.2 nathanw #define COMPONENT_TYPE_AudioController 24
184 1.2.8.2 nathanw #define COMPONENT_TYPE_OtherController 25
185 1.2.8.2 nathanw
186 1.2.8.2 nathanw /* Peripheral Class */
187 1.2.8.2 nathanw #define COMPONENT_TYPE_DiskPeripheral 26
188 1.2.8.2 nathanw #define COMPONENT_TYPE_FloppyDiskPeripheral 27
189 1.2.8.2 nathanw #define COMPONENT_TYPE_TapePeripheral 28
190 1.2.8.2 nathanw #define COMPONENT_TYPE_ModemPeripheral 29
191 1.2.8.2 nathanw #define COMPONENT_TYPE_MonitorPeripheral 30
192 1.2.8.2 nathanw #define COMPONENT_TYPE_PrinterPeripheral 31
193 1.2.8.2 nathanw #define COMPONENT_TYPE_PointerPeripheral 32
194 1.2.8.2 nathanw #define COMPONENT_TYPE_KeyboardPeripheral 33
195 1.2.8.2 nathanw #define COMPONENT_TYPE_TerminalPeripheral 34
196 1.2.8.2 nathanw #define COMPONENT_TYPE_LinePeripheral 35
197 1.2.8.2 nathanw #define COMPONENT_TYPE_NetworkPeripheral 36
198 1.2.8.2 nathanw #define COMPONENT_TYPE_OtherPeripheral 37
199 1.2.8.2 nathanw #else /* not sgimips */
200 1.2.8.2 nathanw /* System Class */
201 1.2.8.2 nathanw #define COMPONENT_TYPE_ARC 0
202 1.2.8.2 nathanw
203 1.2.8.2 nathanw /* Processor Class */
204 1.2.8.2 nathanw #define COMPONENT_TYPE_CPU 1
205 1.2.8.2 nathanw #define COMPONENT_TYPE_FPU 2
206 1.2.8.2 nathanw
207 1.2.8.2 nathanw /* Cache Class */
208 1.2.8.2 nathanw #define COMPONENT_TYPE_PrimaryICache 3
209 1.2.8.2 nathanw #define COMPONENT_TYPE_PrimaryDCache 4
210 1.2.8.2 nathanw #define COMPONENT_TYPE_SecondaryICache 5
211 1.2.8.2 nathanw #define COMPONENT_TYPE_SecondaryDCache 6
212 1.2.8.2 nathanw #define COMPONENT_TYPE_SecondaryCache 7
213 1.2.8.2 nathanw
214 1.2.8.2 nathanw /* Adapter Class */
215 1.2.8.2 nathanw #define COMPONENT_TYPE_EISAAdapter 8
216 1.2.8.2 nathanw #define COMPONENT_TYPE_TCAdapter 9
217 1.2.8.2 nathanw #define COMPONENT_TYPE_SCSIAdapter 10
218 1.2.8.2 nathanw #define COMPONENT_TYPE_DTIAdapter 11
219 1.2.8.2 nathanw #define COMPONENT_TYPE_MultiFunctionAdapter 12
220 1.2.8.2 nathanw
221 1.2.8.2 nathanw /* Controller Class */
222 1.2.8.2 nathanw #define COMPONENT_TYPE_DiskController 13
223 1.2.8.2 nathanw #define COMPONENT_TYPE_TapeController 14
224 1.2.8.2 nathanw #define COMPONENT_TYPE_CDROMController 15
225 1.2.8.2 nathanw #define COMPONENT_TYPE_WORMController 16
226 1.2.8.2 nathanw #define COMPONENT_TYPE_SerialController 17
227 1.2.8.2 nathanw #define COMPONENT_TYPE_NetworkController 18
228 1.2.8.2 nathanw #define COMPONENT_TYPE_DisplayController 19
229 1.2.8.2 nathanw #define COMPONENT_TYPE_ParallelController 20
230 1.2.8.2 nathanw #define COMPONENT_TYPE_PointerController 21
231 1.2.8.2 nathanw #define COMPONENT_TYPE_KeyboardController 22
232 1.2.8.2 nathanw #define COMPONENT_TYPE_AudioController 23
233 1.2.8.2 nathanw #define COMPONENT_TYPE_OtherController 24
234 1.2.8.2 nathanw
235 1.2.8.2 nathanw /* Peripheral Class */
236 1.2.8.2 nathanw #define COMPONENT_TYPE_DiskPeripheral 25
237 1.2.8.2 nathanw #define COMPONENT_TYPE_FloppyDiskPeripheral 26
238 1.2.8.2 nathanw #define COMPONENT_TYPE_TapePeripheral 27
239 1.2.8.2 nathanw #define COMPONENT_TYPE_ModemPeripheral 28
240 1.2.8.2 nathanw #define COMPONENT_TYPE_MonitorPeripheral 29
241 1.2.8.2 nathanw #define COMPONENT_TYPE_PrinterPeripheral 30
242 1.2.8.2 nathanw #define COMPONENT_TYPE_PointerPeripheral 31
243 1.2.8.2 nathanw #define COMPONENT_TYPE_KeyboardPeripheral 32
244 1.2.8.2 nathanw #define COMPONENT_TYPE_TerminalPeripheral 33
245 1.2.8.2 nathanw #define COMPONENT_TYPE_OtherPeripheral 34
246 1.2.8.2 nathanw #define COMPONENT_TYPE_LinePeripheral 35
247 1.2.8.2 nathanw #define COMPONENT_TYPE_NetworkPeripheral 36
248 1.2.8.2 nathanw
249 1.2.8.2 nathanw /* Memory Class */
250 1.2.8.2 nathanw #define COMPONENT_TYPE_MemoryUnit 37
251 1.2.8.2 nathanw #endif
252 1.2.8.2 nathanw
253 1.2.8.2 nathanw /* Component flags */
254 1.2.8.2 nathanw #define COMPONENT_FLAG_Failed 1
255 1.2.8.2 nathanw #define COMPONENT_FLAG_ReadOnly 2
256 1.2.8.2 nathanw #define COMPONENT_FLAG_Removable 4
257 1.2.8.2 nathanw #define COMPONENT_FLAG_ConsoleIn 8
258 1.2.8.2 nathanw #define COMPONENT_FLAG_ConsoleOut 16
259 1.2.8.2 nathanw #define COMPONENT_FLAG_Input 32
260 1.2.8.2 nathanw #define COMPONENT_FLAG_Output 64
261 1.2.8.2 nathanw
262 1.2.8.2 nathanw /* Key for Cache: */
263 1.2.8.2 nathanw #define COMPONENT_KEY_Cache_CacheSize(x) \
264 1.2.8.2 nathanw (ARCBIOS_PAGESIZE << ((x) & 0xffff))
265 1.2.8.2 nathanw #define COMPONENT_KEY_Cache_LineSize(x) \
266 1.2.8.2 nathanw (1U << (((x) >> 16) & 0xff))
267 1.2.8.2 nathanw #define COMPONENT_KEY_Cache_RefillSize(x) \
268 1.2.8.2 nathanw (((x) >> 24) & 0xff)
269 1.2.8.2 nathanw
270 1.2.8.2 nathanw /*
271 1.2.8.2 nathanw * ARC system ID
272 1.2.8.2 nathanw */
273 1.2.8.2 nathanw #define ARCBIOS_SYSID_FIELDLEN 8
274 1.2.8.2 nathanw struct arcbios_sysid {
275 1.2.8.2 nathanw char VendorId[ARCBIOS_SYSID_FIELDLEN];
276 1.2.8.2 nathanw char ProductId[ARCBIOS_SYSID_FIELDLEN];
277 1.2.8.2 nathanw };
278 1.2.8.2 nathanw
279 1.2.8.2 nathanw /*
280 1.2.8.2 nathanw * ARC memory descriptor
281 1.2.8.2 nathanw */
282 1.2.8.2 nathanw struct arcbios_mem {
283 1.2.8.2 nathanw uint32_t Type;
284 1.2.8.2 nathanw uint32_t BasePage;
285 1.2.8.2 nathanw uint32_t PageCount;
286 1.2.8.2 nathanw };
287 1.2.8.2 nathanw
288 1.2.8.2 nathanw #if defined(sgimips)
289 1.2.8.2 nathanw #define ARCBIOS_MEM_ExecptionBlock 0
290 1.2.8.2 nathanw #define ARCBIOS_MEM_SystemParameterBlock 1
291 1.2.8.2 nathanw #define ARCBIOS_MEM_FreeContiguous 2
292 1.2.8.2 nathanw #define ARCBIOS_MEM_FreeMemory 3
293 1.2.8.2 nathanw #define ARCBIOS_MEM_BadMemory 4
294 1.2.8.2 nathanw #define ARCBIOS_MEM_LoadedProgram 5
295 1.2.8.2 nathanw #define ARCBIOS_MEM_FirmwareTemporary 6
296 1.2.8.2 nathanw #define ARCBIOS_MEM_FirmwarePermanent 7
297 1.2.8.2 nathanw #elif defined(arc)
298 1.2.8.2 nathanw #define ARCBIOS_MEM_ExceptionBlock 0
299 1.2.8.2 nathanw #define ARCBIOS_MEM_SystemParameterBlock 1
300 1.2.8.2 nathanw #define ARCBIOS_MEM_FreeMemory 2
301 1.2.8.2 nathanw #define ARCBIOS_MEM_BadMemory 3
302 1.2.8.2 nathanw #define ARCBIOS_MEM_LoadedProgram 4
303 1.2.8.2 nathanw #define ARCBIOS_MEM_FirmwareTemporary 5
304 1.2.8.2 nathanw #define ARCBIOS_MEM_FirmwarePermanent 6
305 1.2.8.2 nathanw #define ARCBIOS_MEM_FreeContiguous 7
306 1.2.8.2 nathanw #endif
307 1.2.8.2 nathanw
308 1.2.8.2 nathanw /*
309 1.2.8.2 nathanw * ARC display status
310 1.2.8.2 nathanw */
311 1.2.8.2 nathanw struct arcbios_dsp_stat {
312 1.2.8.2 nathanw uint16_t CursorXPosition;
313 1.2.8.2 nathanw uint16_t CursorYPosition;
314 1.2.8.2 nathanw uint16_t CursorMaxXPosition;
315 1.2.8.2 nathanw uint16_t CursorMaxYPosition;
316 1.2.8.2 nathanw uint8_t ForegroundColor;
317 1.2.8.2 nathanw uint8_t BackgroundColor;
318 1.2.8.2 nathanw uint8_t HighIntensity;
319 1.2.8.2 nathanw uint8_t Underscored;
320 1.2.8.2 nathanw uint8_t ReverseVideo;
321 1.2.8.2 nathanw };
322 1.2.8.2 nathanw
323 1.2.8.2 nathanw /*
324 1.2.8.2 nathanw * ARC firmware vector
325 1.2.8.2 nathanw */
326 1.2.8.2 nathanw struct arcbios_fv {
327 1.2.8.2 nathanw uint32_t (*Load)(
328 1.2.8.2 nathanw char *, /* image to load */
329 1.2.8.2 nathanw uint32_t, /* top address */
330 1.2.8.2 nathanw uint32_t, /* entry address */
331 1.2.8.2 nathanw uint32_t *); /* low address */
332 1.2.8.2 nathanw
333 1.2.8.2 nathanw uint32_t (*Invoke)(
334 1.2.8.2 nathanw uint32_t, /* entry address */
335 1.2.8.2 nathanw uint32_t, /* stack address */
336 1.2.8.2 nathanw uint32_t, /* argc */
337 1.2.8.2 nathanw char **, /* argv */
338 1.2.8.2 nathanw char **); /* envp */
339 1.2.8.2 nathanw
340 1.2.8.2 nathanw uint32_t (*Execute)(
341 1.2.8.2 nathanw char *, /* image path */
342 1.2.8.2 nathanw uint32_t, /* argc */
343 1.2.8.2 nathanw char **, /* argv */
344 1.2.8.2 nathanw char **); /* envp */
345 1.2.8.2 nathanw
346 1.2.8.2 nathanw void (*Halt)(void)
347 1.2.8.2 nathanw __attribute__((__noreturn__));
348 1.2.8.2 nathanw
349 1.2.8.2 nathanw void (*PowerDown)(void)
350 1.2.8.2 nathanw __attribute__((__noreturn__));
351 1.2.8.2 nathanw
352 1.2.8.2 nathanw void (*Restart)(void)
353 1.2.8.2 nathanw __attribute__((__noreturn__));
354 1.2.8.2 nathanw
355 1.2.8.2 nathanw void (*Reboot)(void)
356 1.2.8.2 nathanw __attribute__((__noreturn__));
357 1.2.8.2 nathanw
358 1.2.8.2 nathanw void (*EnterInteractiveMode)(void)
359 1.2.8.2 nathanw __attribute__((__noreturn__));
360 1.2.8.2 nathanw #if defined(sgimips)
361 1.2.8.2 nathanw void *reserved0;
362 1.2.8.2 nathanw #else
363 1.2.8.2 nathanw void (*ReturnFromMain)(void)
364 1.2.8.2 nathanw __attribute__((__noreturn__));
365 1.2.8.2 nathanw #endif
366 1.2.8.2 nathanw void *(*GetPeer)(
367 1.2.8.2 nathanw void *); /* component */
368 1.2.8.2 nathanw
369 1.2.8.2 nathanw void *(*GetChild)(
370 1.2.8.2 nathanw void *); /* component */
371 1.2.8.2 nathanw
372 1.2.8.2 nathanw void *(*GetParent)(
373 1.2.8.2 nathanw void *); /* component */
374 1.2.8.2 nathanw
375 1.2.8.2 nathanw uint32_t (*GetConfigurationData)(
376 1.2.8.2 nathanw void *, /* configuration data */
377 1.2.8.2 nathanw void *); /* component */
378 1.2.8.2 nathanw
379 1.2.8.2 nathanw void *(*AddChild)(
380 1.2.8.2 nathanw void *, /* component */
381 1.2.8.2 nathanw void *); /* new component */
382 1.2.8.2 nathanw
383 1.2.8.2 nathanw uint32_t (*DeleteComponent)(
384 1.2.8.2 nathanw void *); /* component */
385 1.2.8.2 nathanw
386 1.2.8.2 nathanw uint32_t (*GetComponent)(
387 1.2.8.2 nathanw char *); /* path */
388 1.2.8.2 nathanw
389 1.2.8.2 nathanw uint32_t (*SaveConfiguration)(void);
390 1.2.8.2 nathanw
391 1.2.8.2 nathanw void *(*GetSystemId)(void);
392 1.2.8.2 nathanw
393 1.2.8.2 nathanw void *(*GetMemoryDescriptor)(
394 1.2.8.2 nathanw void *); /* memory descriptor */
395 1.2.8.2 nathanw #if defined(sgimips)
396 1.2.8.2 nathanw void *reserved1;
397 1.2.8.2 nathanw #else
398 1.2.8.2 nathanw void (*Signal)(
399 1.2.8.2 nathanw uint32_t, /* signal number */
400 1.2.8.2 nathanw void *); /* handler */
401 1.2.8.2 nathanw #endif
402 1.2.8.2 nathanw void *(*GetTime)(void);
403 1.2.8.2 nathanw
404 1.2.8.2 nathanw uint32_t (*GetRelativeTime)(void);
405 1.2.8.2 nathanw
406 1.2.8.2 nathanw uint32_t (*GetDirectoryEntry)(
407 1.2.8.2 nathanw uint32_t, /* file ID */
408 1.2.8.2 nathanw void *, /* directory entry */
409 1.2.8.2 nathanw uint32_t, /* length */
410 1.2.8.2 nathanw uint32_t *); /* count */
411 1.2.8.2 nathanw
412 1.2.8.2 nathanw uint32_t (*Open)(
413 1.2.8.2 nathanw char *, /* path */
414 1.2.8.2 nathanw uint32_t, /* open mode */
415 1.2.8.2 nathanw uint32_t *); /* file ID */
416 1.2.8.2 nathanw
417 1.2.8.2 nathanw uint32_t (*Close)(
418 1.2.8.2 nathanw uint32_t); /* file ID */
419 1.2.8.2 nathanw
420 1.2.8.2 nathanw uint32_t (*Read)(
421 1.2.8.2 nathanw uint32_t, /* file ID */
422 1.2.8.2 nathanw void *, /* buffer */
423 1.2.8.2 nathanw uint32_t, /* length */
424 1.2.8.2 nathanw uint32_t *); /* count */
425 1.2.8.2 nathanw
426 1.2.8.2 nathanw uint32_t (*GetReadStatus)(
427 1.2.8.2 nathanw uint32_t); /* file ID */
428 1.2.8.2 nathanw
429 1.2.8.2 nathanw uint32_t (*Write)(
430 1.2.8.2 nathanw uint32_t, /* file ID */
431 1.2.8.2 nathanw void *, /* buffer */
432 1.2.8.2 nathanw uint32_t, /* length */
433 1.2.8.2 nathanw uint32_t *); /* count */
434 1.2.8.2 nathanw
435 1.2.8.2 nathanw uint32_t (*Seek)(
436 1.2.8.2 nathanw uint32_t, /* file ID */
437 1.2.8.2 nathanw int64_t *, /* offset */
438 1.2.8.2 nathanw uint32_t); /* whence */
439 1.2.8.2 nathanw
440 1.2.8.2 nathanw uint32_t (*Mount)(
441 1.2.8.2 nathanw char *, /* path */
442 1.2.8.2 nathanw uint32_t); /* operation */
443 1.2.8.2 nathanw
444 1.2.8.2 nathanw char *(*GetEnvironmentVariable)(
445 1.2.8.2 nathanw char *); /* variable */
446 1.2.8.2 nathanw
447 1.2.8.2 nathanw uint32_t (*SetEnvironmentVariable)(
448 1.2.8.2 nathanw char *, /* variable */
449 1.2.8.2 nathanw char *); /* contents */
450 1.2.8.2 nathanw
451 1.2.8.2 nathanw uint32_t (*GetFileInformation)(
452 1.2.8.2 nathanw uint32_t, /* file ID */
453 1.2.8.2 nathanw void *); /* XXX */
454 1.2.8.2 nathanw
455 1.2.8.2 nathanw uint32_t (*SetFileInformation)(
456 1.2.8.2 nathanw uint32_t, /* file ID */
457 1.2.8.2 nathanw uint32_t, /* XXX */
458 1.2.8.2 nathanw uint32_t); /* XXX */
459 1.2.8.2 nathanw
460 1.2.8.2 nathanw void (*FlushAllCaches)(void);
461 1.2.8.2 nathanw #if !defined(sgimips)
462 1.2.8.2 nathanw uint32_t (*TestUnicode)(
463 1.2.8.2 nathanw uint32_t, /* file ID */
464 1.2.8.2 nathanw uint16_t); /* unicode character */
465 1.2.8.2 nathanw
466 1.2.8.2 nathanw void *(*GetDisplayStatus)(
467 1.2.8.2 nathanw uint32_t); /* file ID */
468 1.2.8.2 nathanw #endif
469 1.2.8.2 nathanw };
470