bootconfig.h revision 1.1 1 /* $NetBSD: bootconfig.h,v 1.1 2004/10/13 23:28:35 gavan Exp $ */
2
3 /*
4 * Copyright (c) 2002 Reinoud Zandijk.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of the company nor the name of the author may be used to
16 * endorse or promote products derived from this software without specific
17 * prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
20 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 * boot configuration structures
32 *
33 */
34
35
36 /* get some spare blocks ;) */
37 #define DRAM_BLOCKS 32
38 #define VRAM_BLOCKS 16
39
40 #define PHYSMEM_TYPE_GENERIC 0
41 #define PHYSMEM_TYPE_PROCESSOR_ONLY 1
42
43
44 typedef struct {
45 u_int address;
46 u_int pages;
47 u_int flags;
48 } phys_mem;
49
50
51 struct bootconfig {
52 u_int magic;
53 u_int version; /* version 2+ */
54
55 u_char machine_id[4]; /* unique machine Id */
56 char kernelname[80];
57 char args[512]; /* 512 bytes is better than 4096 */
58
59 u_int kernvirtualbase; /* not used now */
60 u_int kernphysicalbase; /* not used now */
61 u_int kernsize;
62 u_int scratchvirtualbase; /* not used now */
63 u_int scratchphysicalbase; /* not used now */
64 u_int scratchsize; /* not used now */
65
66 u_int ksym_start;
67 u_int ksym_end;
68
69 u_int MDFvirtualbase; /* not used yet */
70 u_int MDFphysicalbase; /* not used yet */
71 u_int MDFsize; /* not used yet */
72
73 u_int display_phys;
74 u_int display_start;
75 u_int display_size;
76 u_int width;
77 u_int height;
78 u_int log2_bpp;
79 u_int framerate;
80
81 char reserved[512]; /* future expansion */
82
83 u_int pagesize;
84 u_int drampages;
85 u_int vrampages;
86 u_int dramblocks;
87 u_int vramblocks;
88
89 phys_mem dram[DRAM_BLOCKS];
90 phys_mem vram[VRAM_BLOCKS];
91
92 };
93
94
95 #define BOOTCONFIG_MAGIC 0x43112233
96 #define BOOTCONFIG_VERSION 0x2
97
98 extern struct bootconfig bootconfig;
99
100
101 #ifdef _KERNEL
102 #define BOOTOPT_TYPE_BOOLEAN 0
103 #define BOOTOPT_TYPE_STRING 1
104 #define BOOTOPT_TYPE_INT 2
105 #define BOOTOPT_TYPE_BININT 3
106 #define BOOTOPT_TYPE_HEXINT 4
107 #define BOOTOPT_TYPE_MASK 7
108
109 int get_bootconf_option (char *string, char *option, int type, void *result);
110
111 extern char *boot_args;
112 extern char *boot_file;
113 #endif /* _KERNEL */
114
115
116 /* End of bootconfig.h */
117