Add memmmap on arm64 so we can mmap /dev/mem and /dev/kmem.
Obtained from: ABT Systems Ltd MFC after: 1 week Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
126c1b40bc
commit
8c24a12208
@ -114,3 +114,19 @@ memrw(struct cdev *dev, struct uio *uio, int flags)
|
||||
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);
|
||||
}
|
||||
|
@ -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_ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user