bootconfig.h revision 1.3 1 /* $NetBSD: bootconfig.h,v 1.3 2002/02/11 18:47:37 reinoud Exp $ */
2
3 /*
4 * Copyright (c) 2002 Reinoud Zandijk.
5 * Copyright (c) 1994 Mark Brinicombe.
6 * Copyright (c) 1994 Brini.
7 * All rights reserved.
8 *
9 * This code is derived from software written for Brini by Mark Brinicombe
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgement:
21 * This product includes software developed by Mark Brinicombe
22 * for the NetBSD Project.
23 * 4. The name of the company nor the name of the author may be used to
24 * endorse or promote products derived from this software without specific
25 * prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
28 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
29 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
30 * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
31 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
32 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
33 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 * boot configuration structures
40 *
41 */
42
43 #if defined(_KERNEL)
44
45
46 /* get some spare blocks ;) */
47 #define DRAM_BLOCKS 32
48 #define VRAM_BLOCKS 16
49
50
51 typedef struct {
52 u_int address;
53 u_int pages;
54 u_int flags;
55 } phys_mem;
56
57
58 typedef struct _BootConfig {
59 u_int magic;
60 u_int version; /* version 2+ */
61
62 u_char machine_id[4];
63 char kernelname[80];
64 char args[512]; /* 512 bytes is better than 4096 */
65
66 u_int kernvirtualbase; /* not used now */
67 u_int kernphysicalbase; /* not used now */
68 u_int kernsize;
69 u_int scratchvirtualbase;
70 u_int scratchphysicalbase;
71 u_int scratchsize;
72
73 u_int ksym_start;
74 u_int ksym_end;
75
76 u_int MDFvirtualbase; /* not used yet */
77 u_int MDFphysicalbase; /* not used yet */
78 u_int MDFsize; /* not used yet */
79
80 u_int display_phys;
81 u_int display_start;
82 u_int display_size;
83 u_int width;
84 u_int height;
85 u_int log2_bpp;
86 u_int framerate;
87
88 char reserved[512]; /* future expansion */
89
90 u_int pagesize;
91 u_int drampages;
92 u_int vrampages;
93 u_int dramblocks;
94 u_int vramblocks;
95
96 phys_mem dram[DRAM_BLOCKS];
97 phys_mem vram[VRAM_BLOCKS];
98
99 } BootConfig;
100
101
102 /************ compat stuff ************/
103
104 typedef struct {
105 u_int address;
106 u_int pages;
107 } phys_mem_v1;
108
109
110 typedef struct {
111 u_int kernvirtualbase;
112 u_int kernphysicalbase;
113 u_int kernsize;
114 u_int argvirtualbase;
115 u_int argphysicalbase;
116 u_int argsize;
117 u_int scratchvirtualbase;
118 u_int scratchphysicalbase;
119 u_int scratchsize;
120
121 u_int display_start;
122 u_int display_size;
123 u_int width;
124 u_int height;
125 u_int log2_bpp;
126
127 phys_mem_v1 dram[4];
128 phys_mem_v1 vram[1];
129
130 u_int dramblocks;
131 u_int vramblocks;
132 u_int pagesize;
133 u_int drampages;
134 u_int vrampages;
135
136 char kernelname[80];
137
138 u_int framerate;
139 u_char machine_id[4];
140 u_int magic;
141 u_int display_phys;
142 } BootConfig_v1;
143
144 /************ end compat stuff ***********/
145
146 #define BOOTCONFIG_MAGIC 0x43112233
147 #define BOOTCONFIG_VERSION 0x2
148
149 extern BootConfig bootconfig;
150 #endif /* _KERNEL */
151
152
153 #ifdef _KERNEL
154 #define BOOTOPT_TYPE_BOOLEAN 0
155 #define BOOTOPT_TYPE_STRING 1
156 #define BOOTOPT_TYPE_INT 2
157 #define BOOTOPT_TYPE_BININT 3
158 #define BOOTOPT_TYPE_HEXINT 4
159 #define BOOTOPT_TYPE_MASK 7
160
161 int get_bootconf_option __P((char *string, char *option, int type, void *result));
162
163 extern char *boot_args;
164 extern char *boot_file;
165 #endif /* _KERNEL */
166
167
168 /* End of bootconfig.h */
169