Add unmapiodev(vaddr_t, vsize_t) (to be used by bus_space_unmap)

This commit is contained in:
matt 2006-08-31 18:23:40 +00:00
parent 25159b5f42
commit 3d324b035e
1 changed files with 15 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: oea_machdep.c,v 1.26 2006/08/05 21:26:49 sanjayl Exp $ */
/* $NetBSD: oea_machdep.c,v 1.27 2006/08/31 18:23:40 matt Exp $ */
/*
* Copyright (C) 2002 Matt Thomas
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.26 2006/08/05 21:26:49 sanjayl Exp $");
__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.27 2006/08/31 18:23:40 matt Exp $");
#include "opt_compat_netbsd.h"
#include "opt_ddb.h"
@ -828,3 +828,16 @@ mapiodev(paddr_t pa, psize_t len)
pmap_update(pmap_kernel());
return (void *)(va + off);
}
void
unmapiodev(vaddr_t va, vsize_t len)
{
paddr_t faddr;
faddr = trunc_page(va);
len = round_page(va - faddr + len);
pmap_kremove(faddr, len);
pmap_update(pmap_kernel());
uvm_km_free(kernel_map, faddr, len, UVM_KMF_VAONLY);
}