bootinfo.h revision 1.8 1 1.8 nisimura /* $NetBSD: bootinfo.h,v 1.8 2011/01/11 06:57:35 nisimura Exp $ */
2 1.1 briggs
3 1.1 briggs /*
4 1.1 briggs * Copyright (c) 1997
5 1.1 briggs * Matthias Drochner. All rights reserved.
6 1.1 briggs *
7 1.1 briggs * Redistribution and use in source and binary forms, with or without
8 1.1 briggs * modification, are permitted provided that the following conditions
9 1.1 briggs * are met:
10 1.1 briggs * 1. Redistributions of source code must retain the above copyright
11 1.1 briggs * notice, this list of conditions and the following disclaimer.
12 1.1 briggs * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 briggs * notice, this list of conditions and the following disclaimer in the
14 1.1 briggs * documentation and/or other materials provided with the distribution.
15 1.1 briggs *
16 1.1 briggs * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 1.1 briggs * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 1.1 briggs * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 1.1 briggs * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 1.1 briggs * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 1.1 briggs * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 1.1 briggs * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 1.1 briggs * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 1.1 briggs * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 1.1 briggs * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 1.1 briggs *
27 1.1 briggs */
28 1.1 briggs
29 1.1 briggs #ifndef _MACHINE_BOOTINFO_H_
30 1.4 garbled #define _MACHINE_BOOTINFO_H_
31 1.4 garbled
32 1.4 garbled #define BOOTINFO_MAGIC 0xb007babe
33 1.1 briggs
34 1.1 briggs struct btinfo_common {
35 1.1 briggs int next; /* offset of next item, or zero */
36 1.1 briggs int type;
37 1.1 briggs };
38 1.1 briggs
39 1.4 garbled #define BTINFO_MAGIC 1
40 1.4 garbled #define BTINFO_MEMORY 2
41 1.4 garbled #define BTINFO_CONSOLE 3
42 1.4 garbled #define BTINFO_CLOCK 4
43 1.4 garbled #define BTINFO_BOOTPATH 5
44 1.4 garbled #define BTINFO_ROOTDEVICE 6
45 1.5 phx #define BTINFO_NET 7
46 1.7 phx #define BTINFO_PRODFAMILY 8
47 1.8 nisimura #define BTINFO_MODULELIST 9
48 1.4 garbled
49 1.4 garbled struct btinfo_magic {
50 1.4 garbled struct btinfo_common common;
51 1.4 garbled unsigned magic;
52 1.4 garbled };
53 1.1 briggs
54 1.1 briggs struct btinfo_memory {
55 1.1 briggs struct btinfo_common common;
56 1.1 briggs int memsize;
57 1.1 briggs };
58 1.1 briggs
59 1.1 briggs struct btinfo_console {
60 1.1 briggs struct btinfo_common common;
61 1.4 garbled char devname[8];
62 1.1 briggs int addr;
63 1.1 briggs int speed;
64 1.1 briggs };
65 1.1 briggs
66 1.1 briggs struct btinfo_clock {
67 1.1 briggs struct btinfo_common common;
68 1.1 briggs int ticks_per_sec;
69 1.1 briggs };
70 1.1 briggs
71 1.4 garbled struct btinfo_bootpath {
72 1.4 garbled struct btinfo_common common;
73 1.4 garbled char bootpath[80];
74 1.4 garbled };
75 1.4 garbled
76 1.4 garbled struct btinfo_rootdevice {
77 1.4 garbled struct btinfo_common common;
78 1.4 garbled char devname[16];
79 1.4 garbled unsigned cookie;
80 1.4 garbled };
81 1.4 garbled
82 1.5 phx struct btinfo_net {
83 1.5 phx struct btinfo_common common;
84 1.5 phx char devname[16];
85 1.6 phx unsigned cookie;
86 1.5 phx uint8_t mac_address[6];
87 1.5 phx };
88 1.5 phx
89 1.7 phx struct btinfo_prodfamily {
90 1.7 phx struct btinfo_common common;
91 1.7 phx char name[24];
92 1.7 phx };
93 1.7 phx
94 1.8 nisimura struct btinfo_modulelist {
95 1.8 nisimura struct btinfo_common common;
96 1.8 nisimura int num;
97 1.8 nisimura uint32_t endpa;
98 1.8 nisimura /* bi_modulelist_entry follows as an array */
99 1.8 nisimura };
100 1.8 nisimura
101 1.8 nisimura struct bi_modulelist_entry {
102 1.8 nisimura char kmod[80];
103 1.8 nisimura int type;
104 1.8 nisimura #define BI_MODULE_NONE 0x00
105 1.8 nisimura #define BI_MODULE_ELF 0x01
106 1.8 nisimura int len;
107 1.8 nisimura uint32_t base;
108 1.8 nisimura };
109 1.8 nisimura
110 1.4 garbled #define BOOTINFO_MAXSIZE 4096
111 1.4 garbled
112 1.1 briggs #ifdef _KERNEL
113 1.4 garbled void *lookup_bootinfo(int);
114 1.1 briggs #endif
115 1.1 briggs
116 1.1 briggs #endif /* _MACHINE_BOOTINFO_H_ */
117