-/* $OpenBSD: machdep.c,v 1.89 2024/04/29 13:01:54 jsg Exp $ */
+/* $OpenBSD: machdep.c,v 1.90 2024/07/03 21:04:04 kettenis Exp $ */
/*
* Copyright (c) 2014 Patrick Wildt <patrick@blueri.se>
* Copyright (c) 2021 Mark Kettenis <kettenis@openbsd.org>
{
u_long startpa, pa, endpa;
vaddr_t va;
+ int cache = PMAP_CACHE_DEV_NGNRNE;
+
+ if (flags & BUS_SPACE_MAP_PREFETCHABLE)
+ cache = PMAP_CACHE_CI;
va = virtual_avail; /* steal memory from virtual avail. */
*bshp = (bus_space_handle_t)(va + (bpa - startpa));
for (pa = startpa; pa < endpa; pa += PAGE_SIZE, va += PAGE_SIZE)
- pmap_kenter_cache(va, pa, PROT_READ | PROT_WRITE,
- PMAP_CACHE_DEV_NGNRNE);
+ pmap_kenter_cache(va, pa, PROT_READ | PROT_WRITE, cache);
virtual_avail = va;
-/* $OpenBSD: arm64_bus_space.c,v 1.8 2021/02/16 12:33:22 kettenis Exp $ */
+/* $OpenBSD: arm64_bus_space.c,v 1.9 2024/07/03 21:04:04 kettenis Exp $ */
/*
* Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com)
if (flags & BUS_SPACE_MAP_CACHEABLE)
cache = PMAP_CACHE_WB;
+ if (flags & BUS_SPACE_MAP_PREFETCHABLE)
+ cache = PMAP_CACHE_CI;
if (flags & BUS_SPACE_MAP_POSTED)
cache = PMAP_CACHE_DEV_NGNRE;