From: kettenis Date: Tue, 5 Dec 2017 21:04:32 +0000 (+0000) Subject: Handle 64-bit-address Memory Space. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b4781e69f12c1f7b27df67fabaddf5b12819c02c;p=openbsd Handle 64-bit-address Memory Space. --- diff --git a/sys/arch/sparc64/dev/vpci.c b/sys/arch/sparc64/dev/vpci.c index e770ccccc19..491b3328b19 100644 --- a/sys/arch/sparc64/dev/vpci.c +++ b/sys/arch/sparc64/dev/vpci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vpci.c,v 1.21 2016/12/20 13:40:50 jsg Exp $ */ +/* $OpenBSD: vpci.c,v 1.22 2017/12/05 21:04:32 kettenis Exp $ */ /* * Copyright (c) 2008 Mark Kettenis * @@ -456,11 +456,22 @@ vpci_bus_map(bus_space_tag_t t, bus_space_tag_t t0, bus_addr_t offset, (t, t0, offset, size, flags, hp)); } + /* Check mappings for 64-bit-address Memory Space if appropriate. */ + if (ss == 0x02 && offset > 0xffffffff) + ss = 0x03; + for (i = 0; i < pbm->vp_nrange; i++) { - bus_addr_t paddr; + bus_addr_t child, paddr; + bus_size_t size; if (((pbm->vp_range[i].cspace >> 24) & 0x03) != ss) continue; + child = pbm->vp_range[i].child_lo; + child |= ((bus_addr_t)pbm->vp_range[i].child_hi) << 32; + size = pbm->vp_range[i].size_lo; + size |= ((bus_size_t)pbm->vp_range[i].size_hi) << 32; + if (offset < child || offset >= child + size) + continue; paddr = pbm->vp_range[i].phys_lo + offset; paddr |= ((bus_addr_t)pbm->vp_range[i].phys_hi) << 32;