use dma64 if available so we don't have do bounce around too much.

This commit is contained in:
christos 2015-10-27 23:08:27 +00:00
parent 9884c86a80
commit 39340d9c97
1 changed files with 6 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: virtio.c,v 1.11 2015/10/26 01:44:48 ozaki-r Exp $ */ /* $NetBSD: virtio.c,v 1.12 2015/10/27 23:08:27 christos Exp $ */
/* /*
* Copyright (c) 2010 Minoura Makoto. * Copyright (c) 2010 Minoura Makoto.
@ -26,7 +26,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.11 2015/10/26 01:44:48 ozaki-r Exp $"); __KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.12 2015/10/27 23:08:27 christos Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -341,6 +341,9 @@ virtio_attach(device_t parent, device_t self, void *aux)
sc->sc_pc = pc; sc->sc_pc = pc;
sc->sc_tag = tag; sc->sc_tag = tag;
sc->sc_iot = pa->pa_iot; sc->sc_iot = pa->pa_iot;
if (pci_dma64_available(pa))
sc->sc_dmat = pa->pa_dmat64;
else
sc->sc_dmat = pa->pa_dmat; sc->sc_dmat = pa->pa_dmat;
sc->sc_config_offset = VIRTIO_CONFIG_DEVICE_CONFIG_NOMSI; sc->sc_config_offset = VIRTIO_CONFIG_DEVICE_CONFIG_NOMSI;