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