If using arm32_kvminit, don't bother mapping msgbuf since it's already mapped.

This commit is contained in:
matt 2014-04-05 22:36:18 +00:00
parent fd55cfd5f8
commit 5c076ee208
2 changed files with 13 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: arm32_kvminit.c,v 1.26 2014/04/01 05:37:35 skrll Exp $ */
/* $NetBSD: arm32_kvminit.c,v 1.27 2014/04/05 22:36:18 matt Exp $ */
/*
* Copyright (c) 2002, 2003, 2005 Genetec Corporation. All rights reserved.
@ -122,7 +122,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.26 2014/04/01 05:37:35 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.27 2014/04/05 22:36:18 matt Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -144,6 +144,7 @@ __KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.26 2014/04/01 05:37:35 skrll Exp
struct bootmem_info bootmem_info;
extern void *msgbufaddr;
paddr_t msgbufphys;
paddr_t physical_start;
paddr_t physical_end;
@ -549,6 +550,7 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_base, vaddr_t vectors, vaddr_t iovbase,
VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE, false);
add_pages(bmi, &msgbuf);
msgbufphys = msgbuf.pv_pa;
msgbufaddr = (void *)msgbuf.pv_va;
if (map_vectors_p) {
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: arm32_machdep.c,v 1.102 2014/03/28 21:39:09 matt Exp $ */
/* $NetBSD: arm32_machdep.c,v 1.103 2014/04/05 22:36:18 matt Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.102 2014/03/28 21:39:09 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.103 2014/04/05 22:36:18 matt Exp $");
#include "opt_modular.h"
#include "opt_md.h"
@ -257,7 +257,6 @@ cpu_startup(void)
{
vaddr_t minaddr;
vaddr_t maxaddr;
u_int loop;
char pbuf[9];
/*
@ -284,10 +283,13 @@ cpu_startup(void)
*/
/* msgbufphys was setup during the secondary boot strap */
for (loop = 0; loop < btoc(MSGBUFSIZE); ++loop)
pmap_kenter_pa((vaddr_t)msgbufaddr + loop * PAGE_SIZE,
msgbufphys + loop * PAGE_SIZE,
VM_PROT_READ|VM_PROT_WRITE, 0);
if (!pmap_extract(pmap_kernel(), (vaddr_t)msgbufaddr, NULL)) {
for (u_int loop = 0; loop < btoc(MSGBUFSIZE); ++loop) {
pmap_kenter_pa((vaddr_t)msgbufaddr + loop * PAGE_SIZE,
msgbufphys + loop * PAGE_SIZE,
VM_PROT_READ|VM_PROT_WRITE, 0);
}
}
pmap_update(pmap_kernel());
initmsgbuf(msgbufaddr, round_page(MSGBUFSIZE));