Print this page
10597 would like a way to set NMI behavior at boot
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/intel/sys/bootconf.h
+++ new/usr/src/uts/intel/sys/bootconf.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 * Copyright 2016 Nexenta Systems, Inc.
26 + * Copyright 2019, Joyent, Inc.
26 27 */
27 28
28 29 #ifndef _SYS_BOOTCONF_H
29 30 #define _SYS_BOOTCONF_H
30 31
31 32
32 33 /*
33 34 * Boot time configuration information objects
34 35 */
35 36
36 37 #include <sys/types.h>
37 38 #include <sys/bootregs.h> /* for struct bop_regs */
38 39 #include <sys/bootstat.h>
↓ open down ↓ |
3 lines elided |
↑ open up ↑ |
39 40 #include <sys/dirent.h> /* for struct dirent */
40 41 #include <sys/memlist.h>
41 42 #include <sys/obpdefs.h>
42 43 #include <sys/varargs.h>
43 44 #include <net/if.h> /* for IFNAMSIZ */
44 45
45 46 #ifdef __cplusplus
46 47 extern "C" {
47 48 #endif
48 49
50 +#define BP_MAX_STRLEN 32
51 +
49 52 /*
50 53 * Boot property names
51 54 */
52 55 #define BP_CPU_APICID_ARRAY "cpu_apicid_array"
53 56 #define BP_LGRP_SLIT_ENABLE "lgrp_slit_enable"
54 57 #define BP_LGRP_SRAT_ENABLE "lgrp_srat_enable"
55 58 #define BP_LGRP_MSCT_ENABLE "lgrp_msct_enable"
56 59 #define BP_LGRP_TOPO_LEVELS "lgrp_topo_levels"
57 60
58 61 /*
59 62 * masks to hand to bsys_alloc memory allocator
60 63 * XXX These names shouldn't really be srmmu derived.
61 64 */
62 65 #define BO_NO_ALIGN 0x00001000
63 66
64 67 /* flags for BOP_EALLOC */
65 68 #define BOPF_X86_ALLOC_CLIENT 0x001
66 69 #define BOPF_X86_ALLOC_REAL 0x002
67 70 #define BOPF_X86_ALLOC_IDMAP 0x003
68 71 #define BOPF_X86_ALLOC_PHYS 0x004
69 72
70 73 /* return values for the newer bootops */
71 74 #define BOOT_SUCCESS 0
72 75 #define BOOT_FAILURE (-1)
73 76
74 77 /* top of boot scratch memory: 15 MB; multiboot loads at 16 MB */
75 78 #define MAGIC_PHYS 0xF00000
76 79
77 80 /*
78 81 * We pass a ptr to the space that boot has been using
79 82 * for its memory lists.
80 83 */
81 84 struct bsys_mem {
82 85 struct memlist *physinstalled; /* amt of physmem installed */
83 86 struct memlist *rsvdmem; /* amt of bios reserved mem */
84 87 struct memlist *physavail; /* amt of physmem avail for use */
85 88 struct memlist *virtavail; /* amt of virtmem avail for use */
86 89 struct memlist *pcimem; /* amt of pcimem avail for use */
87 90 uint_t extent; /* number of bytes in the space */
88 91 };
89 92
90 93 /*
91 94 * Warning: Changing BO_VERSION blows compatibility between booters
92 95 * and older kernels. If you want to change the struct bootops,
93 96 * please consider adding new stuff to the end and using the
94 97 * "bootops-extensions" mechanism described below.
95 98 */
96 99 #define BO_VERSION 10 /* bootops interface revision # */
97 100
98 101 typedef struct bootops {
99 102 /*
100 103 * the ubiquitous version number
101 104 */
102 105 uint_t bsys_version;
103 106
104 107 /*
105 108 * the area containing boot's memlists
106 109 */
107 110 struct bsys_mem *boot_mem;
108 111
109 112 /*
110 113 * have boot allocate size bytes at virthint
111 114 */
112 115 caddr_t (*bsys_alloc)(struct bootops *, caddr_t virthint, size_t size,
113 116 int align);
114 117
115 118 /*
116 119 * free size bytes allocated at virt - put the
117 120 * address range back onto the avail lists.
118 121 */
119 122 void (*bsys_free)(struct bootops *, caddr_t virt, size_t size);
120 123
121 124 /*
122 125 * to find the size of the buffer to allocate
123 126 */
124 127 int (*bsys_getproplen)(struct bootops *, const char *);
125 128
126 129 /*
127 130 * get the value associated with this name
128 131 */
129 132 int (*bsys_getprop)(struct bootops *, const char *, void *);
130 133
131 134 /*
132 135 * get the name of the next property in succession
133 136 * from the standalone
134 137 */
135 138 char *(*bsys_nextprop)(struct bootops *, char *prevprop);
136 139
137 140 /*
138 141 * print formatted output
139 142 */
140 143 void (*bsys_printf)(void *, const char *, ...);
141 144
142 145 /*
143 146 * Do a real mode interrupt
144 147 */
145 148 void (*bsys_doint)(struct bootops *, int, struct bop_regs *);
146 149
147 150 /*
148 151 * Enhanced version of bsys_alloc().
149 152 */
150 153 caddr_t (*bsys_ealloc)(struct bootops *, caddr_t virthint, size_t size,
151 154 int align, int flags);
152 155
153 156 /* end of bootops which exist if (bootops-extensions >= 1) */
154 157 } bootops_t;
155 158
156 159 #define BOP_GETVERSION(bop) ((bop)->bsys_version)
157 160 #define BOP_ALLOC(bop, virthint, size, align) \
158 161 ((bop)->bsys_alloc)(bop, virthint, size, align)
159 162 #define BOP_FREE(bop, virt, size) ((bop)->bsys_free)(bop, virt, size)
160 163 #define BOP_GETPROPLEN(bop, name) ((bop)->bsys_getproplen)(bop, name)
161 164 #define BOP_GETPROP(bop, name, buf) ((bop)->bsys_getprop)(bop, name, buf)
162 165 #define BOP_NEXTPROP(bop, prev) ((bop)->bsys_nextprop)(bop, prev)
163 166 #define BOP_DOINT(bop, intnum, rp) ((bop)->bsys_doint)(bop, intnum, rp)
164 167 #define BOP_EALLOC(bop, virthint, size, align, flags)\
165 168 ((bop)->bsys_ealloc)(bop, virthint, size, align, flags)
166 169
167 170 #define BOP_PUTSARG(bop, msg, arg) ((bop)->bsys_printf)(bop, msg, arg)
168 171
169 172 #if defined(_KERNEL) && !defined(_BOOT)
170 173
171 174 /*
172 175 * Boot configuration information
173 176 */
174 177
175 178 #define BO_MAXFSNAME 16
176 179 #define BO_MAXOBJNAME 256
177 180
178 181 struct bootobj {
179 182 char bo_fstype[BO_MAXFSNAME]; /* vfs type name (e.g. nfs) */
180 183 char bo_name[BO_MAXOBJNAME]; /* name of object */
181 184 int bo_flags; /* flags, see below */
182 185 int bo_size; /* number of blocks */
183 186 struct vnode *bo_vp; /* vnode of object */
184 187 char bo_devname[BO_MAXOBJNAME];
185 188 char bo_ifname[BO_MAXOBJNAME];
186 189 int bo_ppa;
187 190 };
188 191
189 192 /*
190 193 * flags
191 194 */
192 195 #define BO_VALID 0x01 /* all information in object is valid */
193 196 #define BO_BUSY 0x02 /* object is busy */
194 197
195 198 extern struct bootobj rootfs;
196 199 extern struct bootobj swapfile;
197 200
198 201 extern char obp_bootpath[BO_MAXOBJNAME];
199 202
200 203 extern void *gfx_devinfo_list;
201 204
202 205 extern dev_t getrootdev(void);
203 206 extern void getfsname(char *, char *, size_t);
204 207 extern int loadrootmodules(void);
205 208
206 209 extern int strplumb(void);
207 210 extern int strplumb_load(void);
208 211 extern char *strplumb_get_netdev_path(void);
209 212
210 213 extern void consconfig(void);
211 214 extern void release_bootstrap(void);
212 215
213 216 extern void param_check(void);
214 217 extern int octet_to_hexascii(const void *, uint_t, char *, uint_t *);
215 218
216 219 extern int dhcpinit(void);
217 220
218 221 extern struct bootops *bootops;
219 222 extern int netboot;
220 223 extern int swaploaded;
221 224 extern int modrootloaded;
222 225 extern char kern_bootargs[];
223 226 extern char kern_bootfile[];
224 227 extern char *kobj_module_path;
225 228 extern char *default_path;
226 229 extern char *dhcack;
227 230 extern int dhcacklen;
228 231 extern char dhcifname[IFNAMSIZ];
229 232 extern char *netdev_path;
230 233
231 234 extern void bop_no_more_mem(void);
232 235
233 236 /*PRINTFLIKE2*/
234 237 extern void bop_printf(void *, const char *, ...)
235 238 __KPRINTFLIKE(2);
↓ open down ↓ |
177 lines elided |
↑ open up ↑ |
236 239 extern void vbop_printf(void *, const char *, va_list);
237 240
238 241 /*PRINTFLIKE1*/
239 242 extern void bop_panic(const char *, ...)
240 243 __KPRINTFLIKE(1) __NORETURN;
241 244 #pragma rarely_called(bop_panic)
242 245
243 246 extern void boot_prop_finish(void);
244 247
245 248 extern int bootprop_getval(const char *, u_longlong_t *);
249 +extern int bootprop_getstr(const char *, char *, size_t);
246 250
247 251 /*
248 252 * Back door to fakebop.c to get physical memory allocated.
249 253 * 64 bit data types are fixed for 32 bit PAE use.
250 254 */
251 255 extern paddr_t do_bop_phys_alloc(uint64_t, uint64_t);
252 256
253 257 extern int do_bsys_getproplen(bootops_t *, const char *);
254 258 extern int do_bsys_getprop(bootops_t *, const char *, void *);
255 259 extern int do_bsys_getproptype(bootops_t *, const char *);
256 260
257 261 #endif /* _KERNEL && !_BOOT */
258 262
259 263 #ifdef __cplusplus
260 264 }
261 265 #endif
262 266
263 267 #endif /* _SYS_BOOTCONF_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX