From: kettenis Date: Sat, 17 Feb 2018 22:33:00 +0000 (+0000) Subject: Rename memhook to vmmap to match other archs. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=46b65aa75cff41c4d7eb2ba4a16424ede73adea2;p=openbsd Rename memhook to vmmap to match other archs. ok millert@ --- diff --git a/sys/arch/arm64/arm64/mem.c b/sys/arch/arm64/arm64/mem.c index 5b2cb6b3a7c..a64e9f1ab69 100644 --- a/sys/arch/arm64/arm64/mem.c +++ b/sys/arch/arm64/arm64/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.3 2017/12/14 03:30:43 guenther Exp $ */ +/* $OpenBSD: mem.c,v 1.4 2018/02/17 22:33:00 kettenis Exp $ */ /* $NetBSD: mem.c,v 1.11 2003/10/16 12:02:58 jdolecek Exp $ */ /* @@ -89,7 +89,6 @@ #include -extern char *memhook; /* poor name! */ caddr_t zeropage; /* open counter for aperture */ @@ -150,13 +149,13 @@ mmrw(dev_t dev, struct uio *uio, int flags) struct iovec *iov; int error = 0; vm_prot_t prot; + extern caddr_t vmmap; if (minor(dev) == 0) { /* lock against other uses of shared vmmap */ error = rw_enter(&physlock, RW_WRITE | RW_INTR); if (error) return (error); - } while (uio->uio_resid > 0 && error == 0) { iov = uio->uio_iov; @@ -173,14 +172,14 @@ mmrw(dev_t dev, struct uio *uio, int flags) v = uio->uio_offset; prot = uio->uio_rw == UIO_READ ? PROT_READ : PROT_WRITE; - pmap_enter(pmap_kernel(), (vaddr_t)memhook, + pmap_enter(pmap_kernel(), (vaddr_t)vmmap, trunc_page(v), prot, prot|PMAP_WIRED); pmap_update(pmap_kernel()); o = uio->uio_offset & PGOFSET; c = ulmin(uio->uio_resid, PAGE_SIZE - o); - error = uiomove((caddr_t)memhook + o, c, uio); - pmap_remove(pmap_kernel(), (vaddr_t)memhook, - (vaddr_t)memhook + PAGE_SIZE); + error = uiomove((caddr_t)vmmap + o, c, uio); + pmap_remove(pmap_kernel(), (vaddr_t)vmmap, + (vaddr_t)vmmap + PAGE_SIZE); pmap_update(pmap_kernel()); break; diff --git a/sys/arch/arm64/arm64/pmap.c b/sys/arch/arm64/arm64/pmap.c index 97223f6b025..1bb539fa871 100644 --- a/sys/arch/arm64/arm64/pmap.c +++ b/sys/arch/arm64/arm64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.47 2018/01/31 23:23:16 kettenis Exp $ */ +/* $OpenBSD: pmap.c,v 1.48 2018/02/17 22:33:00 kettenis Exp $ */ /* * Copyright (c) 2008-2009,2014-2016 Dale Rahn * @@ -139,7 +139,7 @@ vaddr_t pmap_map_stolen(vaddr_t); void pmap_physload_avail(void); extern caddr_t msgbufaddr; -char *memhook; +vaddr_t vmmap; vaddr_t zero_page; vaddr_t copy_src_page; vaddr_t copy_dst_page; @@ -1216,7 +1216,7 @@ pmap_bootstrap(long kvo, paddr_t lpt1, long kernelstart, long kernelend, curcpu()->ci_curpm = pmap_kernel(); - memhook = (char *)vstart; + vmmap = vstart; vstart += PAGE_SIZE; return vstart;