From b47856a6735b8872a27d89818296b370cef14248 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Fri, 5 Jul 2019 19:06:51 +0000 Subject: Fix vpci_bus_map() if the case where the "child" space in the "ranges" property doesn't start at address zero. --- sys/arch/sparc64/dev/vpci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/arch/sparc64/dev/vpci.c b/sys/arch/sparc64/dev/vpci.c index eee4b11ee4c..2b9783402f3 100644 --- a/sys/arch/sparc64/dev/vpci.c +++ b/sys/arch/sparc64/dev/vpci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vpci.c,v 1.25 2019/06/11 00:45:31 dlg Exp $ */ +/* $OpenBSD: vpci.c,v 1.26 2019/07/05 19:06:50 kettenis Exp $ */ /* * Copyright (c) 2008 Mark Kettenis * @@ -472,10 +472,10 @@ vpci_bus_map(bus_space_tag_t t, bus_space_tag_t t0, bus_addr_t offset, if (offset < child || offset >= child + size) continue; - paddr = pbm->vp_range[i].phys_lo + offset; + paddr = pbm->vp_range[i].phys_lo; paddr |= ((bus_addr_t)pbm->vp_range[i].phys_hi) << 32; return ((*t->parent->sparc_bus_map) - (t, t0, paddr, size, flags, hp)); + (t, t0, paddr + offset - child, size, flags, hp)); } return (EINVAL); -- cgit v1.2.3