diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2019-07-05 19:06:51 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2019-07-05 19:06:51 +0000 |
commit | b47856a6735b8872a27d89818296b370cef14248 (patch) | |
tree | 62556d08af008607b98cbd926407ccd18c9769ac | |
parent | 194c66aa65ef3c22832a30fa5057d12d5c4d138d (diff) |
Fix vpci_bus_map() if the case where the "child" space in the "ranges"
property doesn't start at address zero.
-rw-r--r-- | sys/arch/sparc64/dev/vpci.c | 6 |
1 files 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 <kettenis@openbsd.org> * @@ -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); |