Date: Wed, 31 Aug 2016 17:30:21 +0000 (UTC) From: Andrew Turner <andrew@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r305135 - in stable/11/sys/arm64: arm64 include Message-ID: <201608311730.u7VHUL4f024798@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: andrew Date: Wed Aug 31 17:30:21 2016 New Revision: 305135 URL: https://svnweb.freebsd.org/changeset/base/305135 Log: MFC 302789: Add memmmap on arm64 so we can mmap /dev/mem and /dev/kmem. Modified: stable/11/sys/arm64/arm64/mem.c stable/11/sys/arm64/include/memdev.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/mem.c ============================================================================== --- stable/11/sys/arm64/arm64/mem.c Wed Aug 31 16:56:54 2016 (r305134) +++ stable/11/sys/arm64/arm64/mem.c Wed Aug 31 17:30:21 2016 (r305135) @@ -114,3 +114,19 @@ memrw(struct cdev *dev, struct uio *uio, return (error); } +/* + * allow user processes to MMAP some memory sections + * instead of going through read/write + */ +/* ARGSUSED */ +int +memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot __unused, vm_memattr_t *memattr __unused) +{ + if (dev2unit(dev) == CDEV_MINOR_MEM) + *paddr = offset; + else if (dev2unit(dev) == CDEV_MINOR_KMEM) + *paddr = vtophys(offset); + /* else panic! */ + return (0); +} Modified: stable/11/sys/arm64/include/memdev.h ============================================================================== --- stable/11/sys/arm64/include/memdev.h Wed Aug 31 16:56:54 2016 (r305134) +++ stable/11/sys/arm64/include/memdev.h Wed Aug 31 17:30:21 2016 (r305135) @@ -35,6 +35,6 @@ d_open_t memopen; d_read_t memrw; #define memioctl (d_ioctl_t *)NULL -#define memmmap (d_mmap_t *)NULL +d_mmap_t memmmap; #endif /* _MACHINE_MEMDEV_H_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608311730.u7VHUL4f024798>