2 * Copyright (c) 2014 Andrew Turner
3 * Copyright (c) 2015-2017 Ruslan Bukin <br@bsdpad.com>
6 * Portions of this software were developed by SRI International and the
7 * University of Cambridge Computer Laboratory under DARPA/AFRL contract
8 * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme.
10 * Portions of this software were developed by the University of Cambridge
11 * Computer Laboratory as part of the CTSRD Project, with support from the
12 * UK Higher Education Innovation Fund (HEIF).
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 #include "opt_platform.h"
38 #include <sys/cdefs.h>
39 __FBSDID("$FreeBSD$");
41 #include <sys/param.h>
42 #include <sys/systm.h>
47 #include <sys/devmap.h>
49 #include <sys/imgact.h>
51 #include <sys/kernel.h>
53 #include <sys/limits.h>
54 #include <sys/linker.h>
55 #include <sys/msgbuf.h>
57 #include <sys/physmem.h>
59 #include <sys/ptrace.h>
60 #include <sys/reboot.h>
61 #include <sys/rwlock.h>
62 #include <sys/sched.h>
63 #include <sys/signalvar.h>
64 #include <sys/syscallsubr.h>
65 #include <sys/sysent.h>
66 #include <sys/sysproto.h>
67 #include <sys/tslog.h>
68 #include <sys/ucontext.h>
69 #include <sys/vmmeter.h>
72 #include <vm/vm_param.h>
73 #include <vm/vm_kern.h>
74 #include <vm/vm_object.h>
75 #include <vm/vm_page.h>
76 #include <vm/vm_phys.h>
78 #include <vm/vm_map.h>
79 #include <vm/vm_pager.h>
81 #include <machine/cpu.h>
82 #include <machine/intr.h>
83 #include <machine/kdb.h>
84 #include <machine/machdep.h>
85 #include <machine/metadata.h>
86 #include <machine/pcb.h>
87 #include <machine/reg.h>
88 #include <machine/riscvreg.h>
89 #include <machine/sbi.h>
90 #include <machine/trap.h>
91 #include <machine/vmparam.h>
94 #include <machine/fpe.h>
98 #include <contrib/libfdt/libfdt.h>
99 #include <dev/fdt/fdt_common.h>
100 #include <dev/ofw/openfirm.h>
103 static void get_fpcontext(struct thread *td, mcontext_t *mcp);
104 static void set_fpcontext(struct thread *td, mcontext_t *mcp);
106 struct pcpu __pcpu[MAXCPU];
108 static struct trapframe proc0_tf;
113 #define DTB_SIZE_MAX (1024 * 1024)
115 vm_paddr_t physmap[PHYS_AVAIL_ENTRIES];
118 struct kva_md_info kmi;
120 int64_t dcache_line_size; /* The minimum D cache line size */
121 int64_t icache_line_size; /* The minimum I cache line size */
122 int64_t idcache_line_size; /* The minimum cache line size */
124 uint32_t boot_hart; /* The hart we booted on. */
130 cpu_startup(void *dummy)
136 printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)realmem),
137 ptoa((uintmax_t)realmem) / (1024 * 1024));
140 * Display any holes after the first chunk of extended memory.
145 printf("Physical memory chunk(s):\n");
146 for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) {
149 size = phys_avail[indx + 1] - phys_avail[indx];
151 "0x%016jx - 0x%016jx, %ju bytes (%ju pages)\n",
152 (uintmax_t)phys_avail[indx],
153 (uintmax_t)phys_avail[indx + 1] - 1,
154 (uintmax_t)size, (uintmax_t)size / PAGE_SIZE);
158 vm_ksubmap_init(&kmi);
160 printf("avail memory = %ju (%ju MB)\n",
161 ptoa((uintmax_t)vm_free_count()),
162 ptoa((uintmax_t)vm_free_count()) / (1024 * 1024));
164 devmap_print_table();
167 vm_pager_bufferinit();
170 SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL);
173 cpu_idle_wakeup(int cpu)
180 fill_regs(struct thread *td, struct reg *regs)
182 struct trapframe *frame;
184 frame = td->td_frame;
185 regs->sepc = frame->tf_sepc;
186 regs->sstatus = frame->tf_sstatus;
187 regs->ra = frame->tf_ra;
188 regs->sp = frame->tf_sp;
189 regs->gp = frame->tf_gp;
190 regs->tp = frame->tf_tp;
192 memcpy(regs->t, frame->tf_t, sizeof(regs->t));
193 memcpy(regs->s, frame->tf_s, sizeof(regs->s));
194 memcpy(regs->a, frame->tf_a, sizeof(regs->a));
200 set_regs(struct thread *td, struct reg *regs)
202 struct trapframe *frame;
204 frame = td->td_frame;
205 frame->tf_sepc = regs->sepc;
206 frame->tf_ra = regs->ra;
207 frame->tf_sp = regs->sp;
208 frame->tf_gp = regs->gp;
209 frame->tf_tp = regs->tp;
211 memcpy(frame->tf_t, regs->t, sizeof(frame->tf_t));
212 memcpy(frame->tf_s, regs->s, sizeof(frame->tf_s));
213 memcpy(frame->tf_a, regs->a, sizeof(frame->tf_a));
219 fill_fpregs(struct thread *td, struct fpreg *regs)
226 if ((pcb->pcb_fpflags & PCB_FP_STARTED) != 0) {
228 * If we have just been running FPE instructions we will
229 * need to save the state to memcpy it below.
234 memcpy(regs->fp_x, pcb->pcb_x, sizeof(regs->fp_x));
235 regs->fp_fcsr = pcb->pcb_fcsr;
238 memset(regs, 0, sizeof(*regs));
244 set_fpregs(struct thread *td, struct fpreg *regs)
247 struct trapframe *frame;
250 frame = td->td_frame;
253 memcpy(pcb->pcb_x, regs->fp_x, sizeof(regs->fp_x));
254 pcb->pcb_fcsr = regs->fp_fcsr;
255 pcb->pcb_fpflags |= PCB_FP_STARTED;
256 frame->tf_sstatus &= ~SSTATUS_FS_MASK;
257 frame->tf_sstatus |= SSTATUS_FS_CLEAN;
264 fill_dbregs(struct thread *td, struct dbreg *regs)
267 panic("fill_dbregs");
271 set_dbregs(struct thread *td, struct dbreg *regs)
278 ptrace_set_pc(struct thread *td, u_long addr)
281 td->td_frame->tf_sepc = addr;
286 ptrace_single_step(struct thread *td)
294 ptrace_clear_single_step(struct thread *td)
302 exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack)
304 struct trapframe *tf;
310 memset(tf, 0, sizeof(struct trapframe));
313 tf->tf_sp = STACKALIGN(stack);
314 tf->tf_ra = imgp->entry_addr;
315 tf->tf_sepc = imgp->entry_addr;
317 pcb->pcb_fpflags &= ~PCB_FP_STARTED;
320 /* Sanity check these are the same size, they will be memcpy'd to and fro */
321 CTASSERT(sizeof(((struct trapframe *)0)->tf_a) ==
322 sizeof((struct gpregs *)0)->gp_a);
323 CTASSERT(sizeof(((struct trapframe *)0)->tf_s) ==
324 sizeof((struct gpregs *)0)->gp_s);
325 CTASSERT(sizeof(((struct trapframe *)0)->tf_t) ==
326 sizeof((struct gpregs *)0)->gp_t);
327 CTASSERT(sizeof(((struct trapframe *)0)->tf_a) ==
328 sizeof((struct reg *)0)->a);
329 CTASSERT(sizeof(((struct trapframe *)0)->tf_s) ==
330 sizeof((struct reg *)0)->s);
331 CTASSERT(sizeof(((struct trapframe *)0)->tf_t) ==
332 sizeof((struct reg *)0)->t);
334 /* Support for FDT configurations only. */
338 get_mcontext(struct thread *td, mcontext_t *mcp, int clear_ret)
340 struct trapframe *tf = td->td_frame;
342 memcpy(mcp->mc_gpregs.gp_t, tf->tf_t, sizeof(mcp->mc_gpregs.gp_t));
343 memcpy(mcp->mc_gpregs.gp_s, tf->tf_s, sizeof(mcp->mc_gpregs.gp_s));
344 memcpy(mcp->mc_gpregs.gp_a, tf->tf_a, sizeof(mcp->mc_gpregs.gp_a));
346 if (clear_ret & GET_MC_CLEAR_RET) {
347 mcp->mc_gpregs.gp_a[0] = 0;
348 mcp->mc_gpregs.gp_t[0] = 0; /* clear syscall error */
351 mcp->mc_gpregs.gp_ra = tf->tf_ra;
352 mcp->mc_gpregs.gp_sp = tf->tf_sp;
353 mcp->mc_gpregs.gp_gp = tf->tf_gp;
354 mcp->mc_gpregs.gp_tp = tf->tf_tp;
355 mcp->mc_gpregs.gp_sepc = tf->tf_sepc;
356 mcp->mc_gpregs.gp_sstatus = tf->tf_sstatus;
357 get_fpcontext(td, mcp);
363 set_mcontext(struct thread *td, mcontext_t *mcp)
365 struct trapframe *tf;
370 * Permit changes to the USTATUS bits of SSTATUS.
372 * Ignore writes to read-only bits (SD, XS).
374 * Ignore writes to the FS field as set_fpcontext() will set
377 if (((mcp->mc_gpregs.gp_sstatus ^ tf->tf_sstatus) &
378 ~(SSTATUS_SD | SSTATUS_XS_MASK | SSTATUS_FS_MASK | SSTATUS_UPIE |
382 memcpy(tf->tf_t, mcp->mc_gpregs.gp_t, sizeof(tf->tf_t));
383 memcpy(tf->tf_s, mcp->mc_gpregs.gp_s, sizeof(tf->tf_s));
384 memcpy(tf->tf_a, mcp->mc_gpregs.gp_a, sizeof(tf->tf_a));
386 tf->tf_ra = mcp->mc_gpregs.gp_ra;
387 tf->tf_sp = mcp->mc_gpregs.gp_sp;
388 tf->tf_gp = mcp->mc_gpregs.gp_gp;
389 tf->tf_sepc = mcp->mc_gpregs.gp_sepc;
390 tf->tf_sstatus = mcp->mc_gpregs.gp_sstatus;
391 set_fpcontext(td, mcp);
397 get_fpcontext(struct thread *td, mcontext_t *mcp)
404 curpcb = curthread->td_pcb;
406 KASSERT(td->td_pcb == curpcb, ("Invalid fpe pcb"));
408 if ((curpcb->pcb_fpflags & PCB_FP_STARTED) != 0) {
410 * If we have just been running FPE instructions we will
411 * need to save the state to memcpy it below.
415 KASSERT((curpcb->pcb_fpflags & ~PCB_FP_USERMASK) == 0,
416 ("Non-userspace FPE flags set in get_fpcontext"));
417 memcpy(mcp->mc_fpregs.fp_x, curpcb->pcb_x,
418 sizeof(mcp->mc_fpregs));
419 mcp->mc_fpregs.fp_fcsr = curpcb->pcb_fcsr;
420 mcp->mc_fpregs.fp_flags = curpcb->pcb_fpflags;
421 mcp->mc_flags |= _MC_FP_VALID;
429 set_fpcontext(struct thread *td, mcontext_t *mcp)
435 td->td_frame->tf_sstatus &= ~SSTATUS_FS_MASK;
436 td->td_frame->tf_sstatus |= SSTATUS_FS_OFF;
441 if ((mcp->mc_flags & _MC_FP_VALID) != 0) {
442 curpcb = curthread->td_pcb;
443 /* FPE usage is enabled, override registers. */
444 memcpy(curpcb->pcb_x, mcp->mc_fpregs.fp_x,
445 sizeof(mcp->mc_fpregs));
446 curpcb->pcb_fcsr = mcp->mc_fpregs.fp_fcsr;
447 curpcb->pcb_fpflags = mcp->mc_fpregs.fp_flags & PCB_FP_USERMASK;
448 td->td_frame->tf_sstatus |= SSTATUS_FS_CLEAN;
462 if (!sched_runnable())
477 __asm __volatile("wfi");
481 * Flush the D-cache for non-DMA I/O so that the I-cache can
482 * be made coherent later.
485 cpu_flush_dcache(void *ptr, size_t len)
491 /* Get current clock frequency for the given CPU ID. */
493 cpu_est_clockrate(int cpu_id, uint64_t *rate)
496 panic("cpu_est_clockrate");
500 cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size)
511 if (td->td_md.md_spinlock_count == 0) {
512 reg = intr_disable();
513 td->td_md.md_spinlock_count = 1;
514 td->td_md.md_saved_sstatus_ie = reg;
517 td->td_md.md_spinlock_count++;
524 register_t sstatus_ie;
527 sstatus_ie = td->td_md.md_saved_sstatus_ie;
528 td->td_md.md_spinlock_count--;
529 if (td->td_md.md_spinlock_count == 0) {
531 intr_restore(sstatus_ie);
535 #ifndef _SYS_SYSPROTO_H_
536 struct sigreturn_args {
542 sys_sigreturn(struct thread *td, struct sigreturn_args *uap)
547 if (copyin(uap->sigcntxp, &uc, sizeof(uc)))
550 error = set_mcontext(td, &uc.uc_mcontext);
554 /* Restore signal mask. */
555 kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0);
557 return (EJUSTRETURN);
561 * Construct a PCB from a trapframe. This is called from kdb_trap() where
562 * we want to start a backtrace from the function that caused us to enter
563 * the debugger. We have the context in the trapframe, but base the trace
564 * on the PCB. The PCB doesn't have to be perfect, as long as it contains
565 * enough for a backtrace.
568 makectx(struct trapframe *tf, struct pcb *pcb)
571 memcpy(pcb->pcb_s, tf->tf_s, sizeof(tf->tf_s));
573 pcb->pcb_ra = tf->tf_sepc;
574 pcb->pcb_sp = tf->tf_sp;
575 pcb->pcb_gp = tf->tf_gp;
576 pcb->pcb_tp = tf->tf_tp;
580 sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
582 struct sigframe *fp, frame;
583 struct sysentvec *sysent;
584 struct trapframe *tf;
593 PROC_LOCK_ASSERT(p, MA_OWNED);
595 sig = ksi->ksi_signo;
597 mtx_assert(&psp->ps_mtx, MA_OWNED);
600 onstack = sigonstack(tf->tf_sp);
602 CTR4(KTR_SIG, "sendsig: td=%p (%s) catcher=%p sig=%d", td, p->p_comm,
605 /* Allocate and validate space for the signal handler context. */
606 if ((td->td_pflags & TDP_ALTSTACK) != 0 && !onstack &&
607 SIGISMEMBER(psp->ps_sigonstack, sig)) {
608 fp = (struct sigframe *)((uintptr_t)td->td_sigstk.ss_sp +
609 td->td_sigstk.ss_size);
611 fp = (struct sigframe *)td->td_frame->tf_sp;
614 /* Make room, keeping the stack aligned */
616 fp = (struct sigframe *)STACKALIGN(fp);
618 /* Fill in the frame to copy out */
619 bzero(&frame, sizeof(frame));
620 get_mcontext(td, &frame.sf_uc.uc_mcontext, 0);
621 frame.sf_si = ksi->ksi_info;
622 frame.sf_uc.uc_sigmask = *mask;
623 frame.sf_uc.uc_stack = td->td_sigstk;
624 frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) != 0 ?
625 (onstack ? SS_ONSTACK : 0) : SS_DISABLE;
626 mtx_unlock(&psp->ps_mtx);
627 PROC_UNLOCK(td->td_proc);
629 /* Copy the sigframe out to the user's stack. */
630 if (copyout(&frame, fp, sizeof(*fp)) != 0) {
631 /* Process has trashed its stack. Kill it. */
632 CTR2(KTR_SIG, "sendsig: sigexit td=%p fp=%p", td, fp);
638 tf->tf_a[1] = (register_t)&fp->sf_si;
639 tf->tf_a[2] = (register_t)&fp->sf_uc;
641 tf->tf_sepc = (register_t)catcher;
642 tf->tf_sp = (register_t)fp;
644 sysent = p->p_sysent;
645 if (sysent->sv_sigcode_base != 0)
646 tf->tf_ra = (register_t)sysent->sv_sigcode_base;
648 tf->tf_ra = (register_t)(sysent->sv_psstrings -
649 *(sysent->sv_szsigcode));
651 CTR3(KTR_SIG, "sendsig: return td=%p pc=%#x sp=%#x", td, tf->tf_sepc,
655 mtx_lock(&psp->ps_mtx);
659 init_proc0(vm_offset_t kstack)
665 proc_linkup0(&proc0, &thread0);
666 thread0.td_kstack = kstack;
667 thread0.td_kstack_pages = KSTACK_PAGES;
668 thread0.td_pcb = (struct pcb *)(thread0.td_kstack +
669 thread0.td_kstack_pages * PAGE_SIZE) - 1;
670 thread0.td_pcb->pcb_fpflags = 0;
671 thread0.td_frame = &proc0_tf;
672 pcpup->pc_curpcb = thread0.td_pcb;
677 try_load_dtb(caddr_t kmdp)
681 dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t);
683 #if defined(FDT_DTB_STATIC)
685 * In case the device tree blob was not retrieved (from metadata) try
686 * to use the statically embedded one.
688 if (dtbp == (vm_offset_t)NULL)
689 dtbp = (vm_offset_t)&fdt_static_dtb;
692 if (dtbp == (vm_offset_t)NULL) {
693 printf("ERROR loading DTB\n");
697 if (OF_install(OFW_FDT, 0) == FALSE)
698 panic("Cannot install FDT");
700 if (OF_init((void *)dtbp) != 0)
701 panic("OF_init failed with the found device tree");
711 dcache_line_size = 0;
712 icache_line_size = 0;
713 idcache_line_size = 0;
717 * Fake up a boot descriptor table.
718 * RISCVTODO: This needs to be done via loader (when it's available).
721 fake_preload_metadata(struct riscv_bootparams *rvbp)
723 static uint32_t fake_preload[35];
725 vm_offset_t zstart = 0, zend = 0;
727 vm_offset_t lastaddr;
733 fake_preload[i++] = MODINFO_NAME;
734 fake_preload[i++] = strlen("kernel") + 1;
735 strcpy((char*)&fake_preload[i++], "kernel");
737 fake_preload[i++] = MODINFO_TYPE;
738 fake_preload[i++] = strlen("elf64 kernel") + 1;
739 strcpy((char*)&fake_preload[i++], "elf64 kernel");
741 fake_preload[i++] = MODINFO_ADDR;
742 fake_preload[i++] = sizeof(vm_offset_t);
743 *(vm_offset_t *)&fake_preload[i++] =
744 (vm_offset_t)(KERNBASE + KERNENTRY);
746 fake_preload[i++] = MODINFO_SIZE;
747 fake_preload[i++] = sizeof(vm_offset_t);
748 fake_preload[i++] = (vm_offset_t)&end -
749 (vm_offset_t)(KERNBASE + KERNENTRY);
754 if (*(uint32_t *)KERNVIRTADDR == MAGIC_TRAMP_NUMBER) {
755 fake_preload[i++] = MODINFO_METADATA|MODINFOMD_SSYM;
756 fake_preload[i++] = sizeof(vm_offset_t);
757 fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 4);
758 fake_preload[i++] = MODINFO_METADATA|MODINFOMD_ESYM;
759 fake_preload[i++] = sizeof(vm_offset_t);
760 fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 8);
761 lastaddr = *(uint32_t *)(KERNVIRTADDR + 8);
763 zstart = *(uint32_t *)(KERNVIRTADDR + 4);
764 db_fetch_ksymtab(zstart, zend);
768 lastaddr = (vm_offset_t)&end;
770 /* Copy the DTB to KVA space. */
771 lastaddr = roundup(lastaddr, sizeof(int));
772 fake_preload[i++] = MODINFO_METADATA | MODINFOMD_DTBP;
773 fake_preload[i++] = sizeof(vm_offset_t);
774 *(vm_offset_t *)&fake_preload[i] = (vm_offset_t)lastaddr;
775 i += sizeof(vm_offset_t) / sizeof(uint32_t);
776 dtb_size = fdt_totalsize(rvbp->dtbp_virt);
777 memmove((void *)lastaddr, (const void *)rvbp->dtbp_virt, dtb_size);
778 lastaddr = roundup(lastaddr + dtb_size, sizeof(int));
780 fake_preload[i++] = 0;
782 preload_metadata = (void *)fake_preload;
784 KASSERT(i < nitems(fake_preload), ("Too many fake_preload items"));
790 initriscv(struct riscv_bootparams *rvbp)
792 struct mem_region mem_regions[FDT_MEM_REGIONS];
795 vm_offset_t lastaddr;
799 TSRAW(&thread0, TS_ENTER, __func__, NULL);
801 /* Set the pcpu data, this is needed by pmap_bootstrap */
803 pcpu_init(pcpup, 0, sizeof(struct pcpu));
804 pcpup->pc_hart = boot_hart;
806 /* Set the pcpu pointer */
807 __asm __volatile("mv tp, %0" :: "r"(pcpup));
809 PCPU_SET(curthread, &thread0);
811 /* Initialize SBI interface. */
814 /* Set the module data location */
815 lastaddr = fake_preload_metadata(rvbp);
817 /* Find the kernel address */
818 kmdp = preload_search_by_type("elf kernel");
820 kmdp = preload_search_by_type("elf64 kernel");
822 boothowto = RB_VERBOSE | RB_SINGLE;
823 boothowto = RB_VERBOSE;
830 /* Grab physical memory regions information from device tree. */
831 if (fdt_get_mem_regions(mem_regions, &mem_regions_sz, NULL) != 0) {
832 panic("Cannot get physical memory regions");
834 physmem_hardware_regions(mem_regions, mem_regions_sz);
837 /* Do basic tuning, hz etc */
842 /* Bootstrap enough of pmap to enter the kernel proper */
843 kernlen = (lastaddr - KERNBASE);
844 pmap_bootstrap(rvbp->kern_l1pt, mem_regions[0].mr_start, kernlen);
846 physmem_init_kernel_globals();
848 /* Establish static device mappings */
849 devmap_bootstrap(0, NULL);
853 init_proc0(rvbp->kern_stack);
855 msgbufinit(msgbufp, msgbufsize);
857 init_param2(physmem);
860 if (boothowto & RB_VERBOSE)
861 physmem_print_tables();
870 bzero(void *buf, size_t len)