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