/* mmap: only for xsd_kva */ paddr_t xenevtmmap(dev_t dev, off_t off, int prot) { if (minor(dev) == DEV_XSD) { /* only one page, so off is always 0 */ if (off != 0) return -1; return x86_btop( xpmap_mtop((paddr_t)xen_start_info.store_mfn << PAGE_SHIFT)); } return -1; }
paddr_t mmmmap(dev_t dev, off_t off, int prot) { /* * /dev/mem is the only one that makes sense through this * interface. For /dev/kmem any physaddr we return here * could be transient and hence incorrect or invalid at * a later time. /dev/null just doesn't make any sense * and /dev/zero is a hack that is handled via the default * pager in mmap(). */ if (minor(dev) != DEV_MEM) return (-1); if (check_pa_acc(off, prot) != 0) return (-1); return (x86_btop(off)); }