arm32_machdep.c revision 1.2.2.7 1 1.2.2.7 jdolecek /* $NetBSD: arm32_machdep.c,v 1.2.2.7 2002/03/16 15:56:02 jdolecek Exp $ */
2 1.2.2.2 lukem
3 1.2.2.2 lukem /*
4 1.2.2.2 lukem * Copyright (c) 1994-1998 Mark Brinicombe.
5 1.2.2.2 lukem * Copyright (c) 1994 Brini.
6 1.2.2.2 lukem * All rights reserved.
7 1.2.2.2 lukem *
8 1.2.2.2 lukem * This code is derived from software written for Brini by Mark Brinicombe
9 1.2.2.2 lukem *
10 1.2.2.2 lukem * Redistribution and use in source and binary forms, with or without
11 1.2.2.2 lukem * modification, are permitted provided that the following conditions
12 1.2.2.2 lukem * are met:
13 1.2.2.2 lukem * 1. Redistributions of source code must retain the above copyright
14 1.2.2.2 lukem * notice, this list of conditions and the following disclaimer.
15 1.2.2.2 lukem * 2. Redistributions in binary form must reproduce the above copyright
16 1.2.2.2 lukem * notice, this list of conditions and the following disclaimer in the
17 1.2.2.2 lukem * documentation and/or other materials provided with the distribution.
18 1.2.2.2 lukem * 3. All advertising materials mentioning features or use of this software
19 1.2.2.2 lukem * must display the following acknowledgement:
20 1.2.2.2 lukem * This product includes software developed by Mark Brinicombe
21 1.2.2.2 lukem * for the NetBSD Project.
22 1.2.2.2 lukem * 4. The name of the company nor the name of the author may be used to
23 1.2.2.2 lukem * endorse or promote products derived from this software without specific
24 1.2.2.2 lukem * prior written permission.
25 1.2.2.2 lukem *
26 1.2.2.2 lukem * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
27 1.2.2.2 lukem * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28 1.2.2.2 lukem * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
29 1.2.2.2 lukem * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
30 1.2.2.2 lukem * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31 1.2.2.2 lukem * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32 1.2.2.2 lukem * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 1.2.2.2 lukem * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 1.2.2.2 lukem * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 1.2.2.2 lukem * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 1.2.2.2 lukem * SUCH DAMAGE.
37 1.2.2.2 lukem *
38 1.2.2.2 lukem * Machine dependant functions for kernel setup
39 1.2.2.2 lukem *
40 1.2.2.2 lukem * Created : 17/09/94
41 1.2.2.2 lukem * Updated : 18/04/01 updated for new wscons
42 1.2.2.2 lukem */
43 1.2.2.2 lukem
44 1.2.2.2 lukem #include "opt_md.h"
45 1.2.2.2 lukem #include "opt_pmap_debug.h"
46 1.2.2.2 lukem
47 1.2.2.2 lukem #include <sys/param.h>
48 1.2.2.2 lukem #include <sys/systm.h>
49 1.2.2.2 lukem #include <sys/reboot.h>
50 1.2.2.2 lukem #include <sys/proc.h>
51 1.2.2.2 lukem #include <sys/user.h>
52 1.2.2.2 lukem #include <sys/kernel.h>
53 1.2.2.2 lukem #include <sys/mbuf.h>
54 1.2.2.2 lukem #include <sys/mount.h>
55 1.2.2.2 lukem #include <sys/buf.h>
56 1.2.2.2 lukem #include <sys/msgbuf.h>
57 1.2.2.2 lukem #include <sys/device.h>
58 1.2.2.2 lukem #include <uvm/uvm_extern.h>
59 1.2.2.2 lukem #include <sys/sysctl.h>
60 1.2.2.2 lukem
61 1.2.2.2 lukem #include <dev/cons.h>
62 1.2.2.2 lukem
63 1.2.2.5 thorpej #include <arm/arm32/katelib.h>
64 1.2.2.5 thorpej #include <arm/arm32/machdep.h>
65 1.2.2.2 lukem #include <machine/bootconfig.h>
66 1.2.2.2 lukem
67 1.2.2.2 lukem #include "opt_ipkdb.h"
68 1.2.2.2 lukem #include "md.h"
69 1.2.2.2 lukem
70 1.2.2.2 lukem struct vm_map *exec_map = NULL;
71 1.2.2.2 lukem struct vm_map *mb_map = NULL;
72 1.2.2.2 lukem struct vm_map *phys_map = NULL;
73 1.2.2.2 lukem
74 1.2.2.2 lukem extern int physmem;
75 1.2.2.2 lukem
76 1.2.2.2 lukem #ifndef PMAP_STATIC_L1S
77 1.2.2.2 lukem extern int max_processes;
78 1.2.2.2 lukem #endif /* !PMAP_STATIC_L1S */
79 1.2.2.7 jdolecek #if NMD > 0 && defined(MEMORY_DISK_HOOKS) && !defined(MEMORY_DISK_SIZE)
80 1.2.2.2 lukem extern u_int memory_disc_size; /* Memory disc size */
81 1.2.2.7 jdolecek #endif /* NMD && MEMORY_DISK_HOOKS && !MEMORY_DISK_SIZE */
82 1.2.2.2 lukem
83 1.2.2.2 lukem pv_addr_t systempage;
84 1.2.2.2 lukem pv_addr_t kernelstack;
85 1.2.2.2 lukem
86 1.2.2.2 lukem /* the following is used externally (sysctl_hw) */
87 1.2.2.2 lukem char machine[] = MACHINE; /* from <machine/param.h> */
88 1.2.2.2 lukem char machine_arch[] = MACHINE_ARCH; /* from <machine/param.h> */
89 1.2.2.2 lukem
90 1.2.2.2 lukem /* Our exported CPU info; we can have only one. */
91 1.2.2.2 lukem struct cpu_info cpu_info_store;
92 1.2.2.2 lukem
93 1.2.2.2 lukem extern pt_entry_t msgbufpte;
94 1.2.2.2 lukem caddr_t msgbufaddr;
95 1.2.2.2 lukem extern paddr_t msgbufphys;
96 1.2.2.2 lukem
97 1.2.2.2 lukem int kernel_debug = 0;
98 1.2.2.2 lukem
99 1.2.2.2 lukem struct user *proc0paddr;
100 1.2.2.2 lukem
101 1.2.2.7 jdolecek /* exported variable to be filled in by the bootloaders */
102 1.2.2.2 lukem char *booted_kernel;
103 1.2.2.2 lukem
104 1.2.2.2 lukem
105 1.2.2.2 lukem /* Prototypes */
106 1.2.2.2 lukem
107 1.2.2.2 lukem u_long strtoul __P((const char *s, char **ptr, int base));
108 1.2.2.2 lukem void data_abort_handler __P((trapframe_t *frame));
109 1.2.2.2 lukem void prefetch_abort_handler __P((trapframe_t *frame));
110 1.2.2.2 lukem void zero_page_readonly __P((void));
111 1.2.2.2 lukem void zero_page_readwrite __P((void));
112 1.2.2.2 lukem extern void configure __P((void));
113 1.2.2.2 lukem
114 1.2.2.2 lukem /*
115 1.2.2.2 lukem * Debug function just to park the CPU
116 1.2.2.2 lukem */
117 1.2.2.2 lukem
118 1.2.2.2 lukem void
119 1.2.2.2 lukem halt()
120 1.2.2.2 lukem {
121 1.2.2.2 lukem while (1)
122 1.2.2.2 lukem cpu_sleep(0);
123 1.2.2.2 lukem }
124 1.2.2.2 lukem
125 1.2.2.2 lukem
126 1.2.2.2 lukem /* Sync the discs and unmount the filesystems */
127 1.2.2.2 lukem
128 1.2.2.2 lukem void
129 1.2.2.2 lukem bootsync(void)
130 1.2.2.2 lukem {
131 1.2.2.2 lukem static int bootsyncdone = 0;
132 1.2.2.2 lukem
133 1.2.2.2 lukem if (bootsyncdone) return;
134 1.2.2.2 lukem
135 1.2.2.2 lukem bootsyncdone = 1;
136 1.2.2.2 lukem
137 1.2.2.2 lukem /* Make sure we can still manage to do things */
138 1.2.2.2 lukem if (GetCPSR() & I32_bit) {
139 1.2.2.2 lukem /*
140 1.2.2.2 lukem * If we get here then boot has been called without RB_NOSYNC
141 1.2.2.2 lukem * and interrupts were disabled. This means the boot() call
142 1.2.2.2 lukem * did not come from a user process e.g. shutdown, but must
143 1.2.2.2 lukem * have come from somewhere in the kernel.
144 1.2.2.2 lukem */
145 1.2.2.2 lukem IRQenable;
146 1.2.2.2 lukem printf("Warning IRQ's disabled during boot()\n");
147 1.2.2.2 lukem }
148 1.2.2.2 lukem
149 1.2.2.2 lukem vfs_shutdown();
150 1.2.2.2 lukem }
151 1.2.2.2 lukem
152 1.2.2.2 lukem /*
153 1.2.2.2 lukem * void cpu_startup(void)
154 1.2.2.2 lukem *
155 1.2.2.2 lukem * Machine dependant startup code.
156 1.2.2.2 lukem *
157 1.2.2.2 lukem */
158 1.2.2.2 lukem
159 1.2.2.2 lukem void
160 1.2.2.2 lukem cpu_startup()
161 1.2.2.2 lukem {
162 1.2.2.2 lukem int loop;
163 1.2.2.2 lukem paddr_t minaddr;
164 1.2.2.2 lukem paddr_t maxaddr;
165 1.2.2.2 lukem caddr_t sysbase;
166 1.2.2.2 lukem caddr_t size;
167 1.2.2.2 lukem vsize_t bufsize;
168 1.2.2.2 lukem int base, residual;
169 1.2.2.2 lukem char pbuf[9];
170 1.2.2.2 lukem
171 1.2.2.2 lukem proc0paddr = (struct user *)kernelstack.pv_va;
172 1.2.2.2 lukem proc0.p_addr = proc0paddr;
173 1.2.2.2 lukem
174 1.2.2.2 lukem /* Set the cpu control register */
175 1.2.2.2 lukem cpu_setup(boot_args);
176 1.2.2.2 lukem
177 1.2.2.2 lukem /* All domains MUST be clients, permissions are VERY important */
178 1.2.2.2 lukem cpu_domains(DOMAIN_CLIENT);
179 1.2.2.2 lukem
180 1.2.2.2 lukem /* Lock down zero page */
181 1.2.2.2 lukem zero_page_readonly();
182 1.2.2.2 lukem
183 1.2.2.2 lukem /*
184 1.2.2.2 lukem * Give pmap a chance to set up a few more things now the vm
185 1.2.2.2 lukem * is initialised
186 1.2.2.2 lukem */
187 1.2.2.2 lukem pmap_postinit();
188 1.2.2.2 lukem
189 1.2.2.2 lukem /*
190 1.2.2.2 lukem * Initialize error message buffer (at end of core).
191 1.2.2.2 lukem */
192 1.2.2.2 lukem
193 1.2.2.2 lukem /* msgbufphys was setup during the secondary boot strap */
194 1.2.2.2 lukem for (loop = 0; loop < btoc(MSGBUFSIZE); ++loop)
195 1.2.2.3 thorpej pmap_kenter_pa((vaddr_t)msgbufaddr + loop * NBPG,
196 1.2.2.3 thorpej msgbufphys + loop * NBPG, VM_PROT_READ|VM_PROT_WRITE);
197 1.2.2.4 thorpej pmap_update(pmap_kernel());
198 1.2.2.2 lukem initmsgbuf(msgbufaddr, round_page(MSGBUFSIZE));
199 1.2.2.2 lukem
200 1.2.2.2 lukem /*
201 1.2.2.2 lukem * Identify ourselves for the msgbuf (everything printed earlier will
202 1.2.2.2 lukem * not be buffered).
203 1.2.2.2 lukem */
204 1.2.2.2 lukem printf(version);
205 1.2.2.2 lukem
206 1.2.2.2 lukem format_bytes(pbuf, sizeof(pbuf), arm_page_to_byte(physmem));
207 1.2.2.2 lukem printf("total memory = %s\n", pbuf);
208 1.2.2.2 lukem
209 1.2.2.2 lukem /*
210 1.2.2.2 lukem * Find out how much space we need, allocate it,
211 1.2.2.2 lukem * and then give everything true virtual addresses.
212 1.2.2.2 lukem */
213 1.2.2.2 lukem size = allocsys(NULL, NULL);
214 1.2.2.2 lukem sysbase = (caddr_t)uvm_km_zalloc(kernel_map, round_page((vaddr_t)size));
215 1.2.2.2 lukem if (sysbase == 0)
216 1.2.2.2 lukem panic(
217 1.2.2.2 lukem "cpu_startup: no room for system tables; %d bytes required",
218 1.2.2.2 lukem (u_int)size);
219 1.2.2.2 lukem if ((caddr_t)((allocsys(sysbase, NULL) - sysbase)) != size)
220 1.2.2.2 lukem panic("cpu_startup: system table size inconsistency");
221 1.2.2.2 lukem
222 1.2.2.2 lukem /*
223 1.2.2.2 lukem * Now allocate buffers proper. They are different than the above
224 1.2.2.2 lukem * in that they usually occupy more virtual memory than physical.
225 1.2.2.2 lukem */
226 1.2.2.2 lukem bufsize = MAXBSIZE * nbuf;
227 1.2.2.2 lukem if (uvm_map(kernel_map, (vaddr_t *)&buffers, round_page(bufsize),
228 1.2.2.2 lukem NULL, UVM_UNKNOWN_OFFSET, 0,
229 1.2.2.2 lukem UVM_MAPFLAG(UVM_PROT_NONE, UVM_PROT_NONE, UVM_INH_NONE,
230 1.2.2.2 lukem UVM_ADV_NORMAL, 0)) != 0)
231 1.2.2.2 lukem panic("cpu_startup: cannot allocate UVM space for buffers");
232 1.2.2.2 lukem minaddr = (vaddr_t)buffers;
233 1.2.2.2 lukem if ((bufpages / nbuf) >= btoc(MAXBSIZE)) {
234 1.2.2.2 lukem /* don't want to alloc more physical mem than needed */
235 1.2.2.2 lukem bufpages = btoc(MAXBSIZE) * nbuf;
236 1.2.2.2 lukem }
237 1.2.2.2 lukem
238 1.2.2.2 lukem base = bufpages / nbuf;
239 1.2.2.2 lukem residual = bufpages % nbuf;
240 1.2.2.2 lukem for (loop = 0; loop < nbuf; ++loop) {
241 1.2.2.2 lukem vsize_t curbufsize;
242 1.2.2.2 lukem vaddr_t curbuf;
243 1.2.2.2 lukem struct vm_page *pg;
244 1.2.2.2 lukem
245 1.2.2.3 thorpej /*
246 1.2.2.3 thorpej * Each buffer has MAXBSIZE bytes of VM space allocated. Of
247 1.2.2.3 thorpej * that MAXBSIZE space, we allocate and map (base+1) pages
248 1.2.2.3 thorpej * for the first "residual" buffers, and then we allocate
249 1.2.2.3 thorpej * "base" pages for the rest.
250 1.2.2.3 thorpej */
251 1.2.2.2 lukem curbuf = (vaddr_t) buffers + (loop * MAXBSIZE);
252 1.2.2.2 lukem curbufsize = NBPG * ((loop < residual) ? (base+1) : base);
253 1.2.2.2 lukem
254 1.2.2.2 lukem while (curbufsize) {
255 1.2.2.2 lukem pg = uvm_pagealloc(NULL, 0, NULL, 0);
256 1.2.2.2 lukem if (pg == NULL)
257 1.2.2.2 lukem panic("cpu_startup: not enough memory for buffer cache");
258 1.2.2.3 thorpej pmap_kenter_pa(curbuf, VM_PAGE_TO_PHYS(pg),
259 1.2.2.3 thorpej VM_PROT_READ|VM_PROT_WRITE);
260 1.2.2.2 lukem curbuf += PAGE_SIZE;
261 1.2.2.2 lukem curbufsize -= PAGE_SIZE;
262 1.2.2.2 lukem }
263 1.2.2.2 lukem }
264 1.2.2.4 thorpej pmap_update(pmap_kernel());
265 1.2.2.2 lukem
266 1.2.2.2 lukem /*
267 1.2.2.2 lukem * Allocate a submap for exec arguments. This map effectively
268 1.2.2.2 lukem * limits the number of processes exec'ing at any time.
269 1.2.2.2 lukem */
270 1.2.2.2 lukem exec_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
271 1.2.2.2 lukem 16*NCARGS, VM_MAP_PAGEABLE, FALSE, NULL);
272 1.2.2.2 lukem
273 1.2.2.2 lukem /*
274 1.2.2.2 lukem * Allocate a submap for physio
275 1.2.2.2 lukem */
276 1.2.2.2 lukem phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
277 1.2.2.2 lukem VM_PHYS_SIZE, 0, FALSE, NULL);
278 1.2.2.2 lukem
279 1.2.2.2 lukem /*
280 1.2.2.2 lukem * Finally, allocate mbuf cluster submap.
281 1.2.2.2 lukem */
282 1.2.2.2 lukem mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
283 1.2.2.2 lukem nmbclusters * mclbytes, VM_MAP_INTRSAFE,
284 1.2.2.2 lukem FALSE, NULL);
285 1.2.2.2 lukem
286 1.2.2.2 lukem format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
287 1.2.2.2 lukem printf("avail memory = %s\n", pbuf);
288 1.2.2.2 lukem format_bytes(pbuf, sizeof(pbuf), bufpages * NBPG);
289 1.2.2.2 lukem printf("using %d buffers containing %s of memory\n", nbuf, pbuf);
290 1.2.2.2 lukem
291 1.2.2.2 lukem /*
292 1.2.2.2 lukem * Set up buffers, so they can be used to read disk labels.
293 1.2.2.2 lukem */
294 1.2.2.2 lukem bufinit();
295 1.2.2.2 lukem
296 1.2.2.2 lukem curpcb = &proc0.p_addr->u_pcb;
297 1.2.2.2 lukem curpcb->pcb_flags = 0;
298 1.2.2.4 thorpej curpcb->pcb_un.un_32.pcb32_und_sp = (u_int)proc0.p_addr +
299 1.2.2.4 thorpej USPACE_UNDEF_STACK_TOP;
300 1.2.2.4 thorpej curpcb->pcb_un.un_32.pcb32_sp = (u_int)proc0.p_addr +
301 1.2.2.4 thorpej USPACE_SVC_STACK_TOP;
302 1.2.2.2 lukem (void) pmap_extract(pmap_kernel(), (vaddr_t)(pmap_kernel())->pm_pdir,
303 1.2.2.2 lukem (paddr_t *)&curpcb->pcb_pagedir);
304 1.2.2.2 lukem
305 1.2.2.4 thorpej curpcb->pcb_tf = (struct trapframe *)curpcb->pcb_un.un_32.pcb32_sp - 1;
306 1.2.2.2 lukem }
307 1.2.2.2 lukem
308 1.2.2.2 lukem /*
309 1.2.2.2 lukem * Modify the current mapping for zero page to make it read only
310 1.2.2.2 lukem *
311 1.2.2.2 lukem * This routine is only used until things start forking. Then new
312 1.2.2.2 lukem * system pages are mapped read only in pmap_enter().
313 1.2.2.2 lukem */
314 1.2.2.2 lukem
315 1.2.2.2 lukem void
316 1.2.2.2 lukem zero_page_readonly()
317 1.2.2.2 lukem {
318 1.2.2.2 lukem WriteWord(PROCESS_PAGE_TBLS_BASE + 0,
319 1.2.2.2 lukem L2_PTE((systempage.pv_pa & PG_FRAME), AP_KR));
320 1.2.2.2 lukem cpu_tlb_flushID_SE(0x00000000);
321 1.2.2.2 lukem }
322 1.2.2.2 lukem
323 1.2.2.2 lukem
324 1.2.2.2 lukem /*
325 1.2.2.2 lukem * Modify the current mapping for zero page to make it read/write
326 1.2.2.2 lukem *
327 1.2.2.2 lukem * This routine is only used until things start forking. Then system
328 1.2.2.2 lukem * pages belonging to user processes are never made writable.
329 1.2.2.2 lukem */
330 1.2.2.2 lukem
331 1.2.2.2 lukem void
332 1.2.2.2 lukem zero_page_readwrite()
333 1.2.2.2 lukem {
334 1.2.2.2 lukem WriteWord(PROCESS_PAGE_TBLS_BASE + 0,
335 1.2.2.2 lukem L2_PTE((systempage.pv_pa & PG_FRAME), AP_KRW));
336 1.2.2.2 lukem cpu_tlb_flushID_SE(0x00000000);
337 1.2.2.2 lukem }
338 1.2.2.2 lukem
339 1.2.2.2 lukem
340 1.2.2.2 lukem /*
341 1.2.2.2 lukem * machine dependent system variables.
342 1.2.2.2 lukem */
343 1.2.2.2 lukem
344 1.2.2.2 lukem int
345 1.2.2.2 lukem cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
346 1.2.2.2 lukem int *name;
347 1.2.2.2 lukem u_int namelen;
348 1.2.2.2 lukem void *oldp;
349 1.2.2.2 lukem size_t *oldlenp;
350 1.2.2.2 lukem void *newp;
351 1.2.2.2 lukem size_t newlen;
352 1.2.2.2 lukem struct proc *p;
353 1.2.2.2 lukem {
354 1.2.2.2 lukem /* all sysctl names at this level are terminal */
355 1.2.2.2 lukem if (namelen != 1)
356 1.2.2.2 lukem return (ENOTDIR); /* overloaded */
357 1.2.2.2 lukem
358 1.2.2.2 lukem switch (name[0]) {
359 1.2.2.2 lukem case CPU_DEBUG:
360 1.2.2.2 lukem return(sysctl_int(oldp, oldlenp, newp, newlen, &kernel_debug));
361 1.2.2.2 lukem
362 1.2.2.2 lukem case CPU_BOOTED_DEVICE:
363 1.2.2.2 lukem if (booted_device != NULL)
364 1.2.2.2 lukem return (sysctl_rdstring(oldp, oldlenp, newp,
365 1.2.2.2 lukem booted_device->dv_xname));
366 1.2.2.2 lukem return (EOPNOTSUPP);
367 1.2.2.2 lukem
368 1.2.2.2 lukem case CPU_CONSDEV: {
369 1.2.2.2 lukem dev_t consdev;
370 1.2.2.2 lukem if (cn_tab != NULL)
371 1.2.2.2 lukem consdev = cn_tab->cn_dev;
372 1.2.2.2 lukem else
373 1.2.2.2 lukem consdev = NODEV;
374 1.2.2.2 lukem return (sysctl_rdstruct(oldp, oldlenp, newp, &consdev,
375 1.2.2.2 lukem sizeof consdev));
376 1.2.2.2 lukem }
377 1.2.2.2 lukem case CPU_BOOTED_KERNEL: {
378 1.2.2.2 lukem if (booted_kernel != NULL && booted_kernel[0] != '\0')
379 1.2.2.2 lukem return sysctl_rdstring(oldp, oldlenp, newp,
380 1.2.2.2 lukem booted_kernel);
381 1.2.2.2 lukem return (EOPNOTSUPP);
382 1.2.2.2 lukem }
383 1.2.2.2 lukem
384 1.2.2.2 lukem default:
385 1.2.2.2 lukem return (EOPNOTSUPP);
386 1.2.2.2 lukem }
387 1.2.2.2 lukem /* NOTREACHED */
388 1.2.2.2 lukem }
389 1.2.2.2 lukem
390 1.2.2.2 lukem void
391 1.2.2.2 lukem parse_mi_bootargs(args)
392 1.2.2.2 lukem char *args;
393 1.2.2.2 lukem {
394 1.2.2.2 lukem int integer;
395 1.2.2.2 lukem
396 1.2.2.2 lukem if (get_bootconf_option(args, "single", BOOTOPT_TYPE_BOOLEAN, &integer)
397 1.2.2.2 lukem || get_bootconf_option(args, "-s", BOOTOPT_TYPE_BOOLEAN, &integer))
398 1.2.2.2 lukem if (integer)
399 1.2.2.2 lukem boothowto |= RB_SINGLE;
400 1.2.2.2 lukem if (get_bootconf_option(args, "kdb", BOOTOPT_TYPE_BOOLEAN, &integer)
401 1.2.2.2 lukem || get_bootconf_option(args, "-k", BOOTOPT_TYPE_BOOLEAN, &integer))
402 1.2.2.2 lukem if (integer)
403 1.2.2.2 lukem boothowto |= RB_KDB;
404 1.2.2.2 lukem if (get_bootconf_option(args, "ask", BOOTOPT_TYPE_BOOLEAN, &integer)
405 1.2.2.2 lukem || get_bootconf_option(args, "-a", BOOTOPT_TYPE_BOOLEAN, &integer))
406 1.2.2.2 lukem if (integer)
407 1.2.2.2 lukem boothowto |= RB_ASKNAME;
408 1.2.2.2 lukem
409 1.2.2.2 lukem #ifdef PMAP_DEBUG
410 1.2.2.2 lukem if (get_bootconf_option(args, "pmapdebug", BOOTOPT_TYPE_INT, &integer)) {
411 1.2.2.2 lukem pmap_debug_level = integer;
412 1.2.2.2 lukem pmap_debug(pmap_debug_level);
413 1.2.2.2 lukem }
414 1.2.2.2 lukem #endif /* PMAP_DEBUG */
415 1.2.2.2 lukem
416 1.2.2.2 lukem /* if (get_bootconf_option(args, "nbuf", BOOTOPT_TYPE_INT, &integer))
417 1.2.2.2 lukem bufpages = integer;*/
418 1.2.2.2 lukem
419 1.2.2.2 lukem #ifndef PMAP_STATIC_L1S
420 1.2.2.2 lukem if (get_bootconf_option(args, "maxproc", BOOTOPT_TYPE_INT, &integer)) {
421 1.2.2.2 lukem max_processes = integer;
422 1.2.2.2 lukem if (max_processes < 16)
423 1.2.2.2 lukem max_processes = 16;
424 1.2.2.2 lukem /* Limit is PDSIZE * (max_processes + 1) <= 4MB */
425 1.2.2.2 lukem if (max_processes > 255)
426 1.2.2.2 lukem max_processes = 255;
427 1.2.2.2 lukem }
428 1.2.2.2 lukem #endif /* !PMAP_STATUC_L1S */
429 1.2.2.7 jdolecek #if NMD > 0 && defined(MEMORY_DISK_HOOKS) && !defined(MEMORY_DISK_SIZE)
430 1.2.2.2 lukem if (get_bootconf_option(args, "memorydisc", BOOTOPT_TYPE_INT, &integer)
431 1.2.2.2 lukem || get_bootconf_option(args, "memorydisk", BOOTOPT_TYPE_INT, &integer)) {
432 1.2.2.2 lukem memory_disc_size = integer;
433 1.2.2.2 lukem memory_disc_size *= 1024;
434 1.2.2.2 lukem if (memory_disc_size < 32*1024)
435 1.2.2.2 lukem memory_disc_size = 32*1024;
436 1.2.2.2 lukem if (memory_disc_size > 2048*1024)
437 1.2.2.2 lukem memory_disc_size = 2048*1024;
438 1.2.2.2 lukem }
439 1.2.2.7 jdolecek #endif /* NMD && MEMORY_DISK_HOOKS && !MEMORY_DISK_SIZE */
440 1.2.2.2 lukem
441 1.2.2.2 lukem if (get_bootconf_option(args, "quiet", BOOTOPT_TYPE_BOOLEAN, &integer)
442 1.2.2.2 lukem || get_bootconf_option(args, "-q", BOOTOPT_TYPE_BOOLEAN, &integer))
443 1.2.2.2 lukem if (integer)
444 1.2.2.2 lukem boothowto |= AB_QUIET;
445 1.2.2.2 lukem if (get_bootconf_option(args, "verbose", BOOTOPT_TYPE_BOOLEAN, &integer)
446 1.2.2.2 lukem || get_bootconf_option(args, "-v", BOOTOPT_TYPE_BOOLEAN, &integer))
447 1.2.2.2 lukem if (integer)
448 1.2.2.2 lukem boothowto |= AB_VERBOSE;
449 1.2.2.2 lukem }
450 1.2.2.2 lukem
451 1.2.2.2 lukem /* End of machdep.c */
452